python-torch/0001-disable-as-needed-for-libtorch.patch
Tom Rix 48192fa108 Initial import
Signed-off-by: Tom Rix <trix@redhat.com>
2023-12-02 15:19:42 -05:00

28 lines
859 B
Diff

From 06499575b177a218846f0e43ff4bc77d245f207f Mon Sep 17 00:00:00 2001
From: Tom Rix <trix@redhat.com>
Date: Fri, 1 Dec 2023 09:38:05 -0500
Subject: [PATCH] disable as-needed for libtorch
Signed-off-by: Tom Rix <trix@redhat.com>
---
caffe2/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
index b975d388a7..5e9fd3b3f3 100644
--- a/caffe2/CMakeLists.txt
+++ b/caffe2/CMakeLists.txt
@@ -914,6 +914,10 @@ if(HAVE_SOVERSION)
VERSION ${TORCH_VERSION} SOVERSION ${TORCH_SOVERSION})
endif()
+# Disable global as-needed
+set_target_properties(torch PROPERTIES LINK_FLAGS -Wl,--no-as-needed)
+
+
if(USE_ROCM)
filter_list(__caffe2_hip_srcs_cpp Caffe2_HIP_SRCS "\\.(cu|hip)$")
set_source_files_properties(${__caffe2_hip_srcs_cpp} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
--
2.42.1