Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 722978
Collapse All | Expand All

(-)a/sys-devel/llvm/files/9999/unwind_linking.patch (+44 lines)
Line 0 Link Here
1
--- /CMakeLists.txt
2
+++ /CMakeLists.txt
3
@@ -335,6 +335,7 @@ if(LLVM_ENABLE_BACKTRACES)
4
 endif()
5
 
6
 option(LLVM_ENABLE_UNWIND_TABLES "Emit unwind tables for the libraries" ON)
7
+set(UNWIND_LIBRARIES "" CACHE STRING "Additional libraries needed for unwind functions")
8
 
9
 option(LLVM_ENABLE_CRASH_OVERRIDES "Enable crash overrides." ON)
10
 if(LLVM_ENABLE_CRASH_OVERRIDES)
11
--- /cmake/modules/AddLLVM.cmake
12
+++ /cmake/modules/AddLLVM.cmake
13
@@ -641,6 +641,9 @@ function(llvm_add_library name)
14
       ${lib_deps}
15
       ${llvm_libs}
16
       )
17
+  if(UNWIND_LIBRARIES)
18
+    target_link_libraries(${name} PRIVATE -Wl,--push-state -Wl,--as-needed ${UNWIND_LIBRARIES} -Wl,--pop-state)
19
+  endif()
20
 
21
   if(LLVM_COMMON_DEPENDS)
22
     add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
23
@@ -868,6 +871,9 @@ macro(add_llvm_executable name)
24
     # API for all shared libaries loaded by this executable.
25
     target_link_libraries(${name} PRIVATE ${LLVM_PTHREAD_LIB})
26
   endif()
27
+  if(UNWIND_LIBRARIES)
28
+    target_link_libraries(${name} PRIVATE -Wl,--push-state -Wl,--as-needed ${UNWIND_LIBRARIES} -Wl,--pop-state)
29
+  endif()
30
 
31
   llvm_codesign(${name} ENTITLEMENTS ${ARG_ENTITLEMENTS} BUNDLE_PATH ${ARG_BUNDLE_PATH})
32
 endmacro(add_llvm_executable name)
33
--- /unittests/Support/DynamicLibrary/CMakeLists.txt
34
+++ /unittests/Support/DynamicLibrary/CMakeLists.txt
35
@@ -26,6 +26,9 @@ function(dynlib_add_module NAME)
36
     PipSqueak.cpp
37
     )
38
   set_target_properties(${NAME} PROPERTIES FOLDER "Tests")
39
+  if(UNWIND_LIBRARIES)
40
+    target_link_libraries(${NAME} PRIVATE -Wl,--push-state -Wl,--as-needed ${UNWIND_LIBRARIES} -Wl,--pop-state)
41
+  endif()
42
 
43
   set_output_directory(${NAME}
44
     BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
(-)a/sys-devel/llvm/llvm-10.0.0.9999.ebuild (+17 lines)
Lines 174-179 src_prepare() { Link Here
174
	# https://bugs.gentoo.org/show_bug.cgi?id=565358
174
	# https://bugs.gentoo.org/show_bug.cgi?id=565358
175
	eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
175
	eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
176
176
177
	eapply "${FILESDIR}"/9999/unwind_linking.patch
178
177
	# disable use of SDK on OSX, bug #568758
179
	# disable use of SDK on OSX, bug #568758
178
	sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
180
	sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
179
181
Lines 372-377 multilib_src_configure() { Link Here
372
		)
374
		)
373
	fi
375
	fi
374
376
377
	if tc-is-clang; then
378
		local compiler_rt=$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -print-libgcc-file-name)
379
		if [[ ${compiler_rt} == *libclang_rt* ]]; then
380
			if has_version sys-libs/llvm-libunwind; then
381
				mycmakeargs+=(
382
					-DUNWIND_LIBRARIES=unwind
383
				)
384
			else
385
				mycmakeargs+=(
386
					-DUNWIND_LIBRARIES=gcc_s
387
				)
388
			fi
389
		fi
390
	fi
391
375
#	Note: go bindings have no CMake rules at the moment
392
#	Note: go bindings have no CMake rules at the moment
376
#	but let's kill the check in case they are introduced
393
#	but let's kill the check in case they are introduced
377
#	if ! multilib_is_native_abi || ! use go; then
394
#	if ! multilib_is_native_abi || ! use go; then
(-)a/sys-devel/llvm/llvm-10.0.0.ebuild (+17 lines)
Lines 99-104 src_prepare() { Link Here
99
	# https://bugs.gentoo.org/show_bug.cgi?id=565358
99
	# https://bugs.gentoo.org/show_bug.cgi?id=565358
100
	eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
100
	eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
101
101
102
	eapply "${FILESDIR}"/9999/unwind_linking.patch
103
102
	# disable use of SDK on OSX, bug #568758
104
	# disable use of SDK on OSX, bug #568758
103
	sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
105
	sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
104
106
Lines 294-299 multilib_src_configure() { Link Here
294
		)
296
		)
295
	fi
297
	fi
296
298
299
	if tc-is-clang; then
300
		local compiler_rt=$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -print-libgcc-file-name)
301
		if [[ ${compiler_rt} == *libclang_rt* ]]; then
302
			if has_version sys-libs/llvm-libunwind; then
303
				mycmakeargs+=(
304
					-DUNWIND_LIBRARIES=unwind
305
				)
306
			else
307
				mycmakeargs+=(
308
					-DUNWIND_LIBRARIES=gcc_s
309
				)
310
			fi
311
		fi
312
	fi
313
297
#	Note: go bindings have no CMake rules at the moment
314
#	Note: go bindings have no CMake rules at the moment
298
#	but let's kill the check in case they are introduced
315
#	but let's kill the check in case they are introduced
299
#	if ! multilib_is_native_abi || ! use go; then
316
#	if ! multilib_is_native_abi || ! use go; then
(-)a/sys-devel/llvm/llvm-11.0.0.9999.ebuild (-1 / +17 lines)
Lines 174-179 src_prepare() { Link Here
174
	# https://bugs.gentoo.org/show_bug.cgi?id=565358
174
	# https://bugs.gentoo.org/show_bug.cgi?id=565358
175
	eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
175
	eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
176
176
177
	eapply "${FILESDIR}"/9999/unwind_linking.patch
178
177
	# disable use of SDK on OSX, bug #568758
179
	# disable use of SDK on OSX, bug #568758
178
	sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
180
	sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
179
181
Lines 374-379 multilib_src_configure() { Link Here
374
		)
376
		)
375
	fi
377
	fi
376
378
379
	if tc-is-clang; then
380
		local compiler_rt=$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -print-libgcc-file-name)
381
		if [[ ${compiler_rt} == *libclang_rt* ]]; then
382
			if has_version sys-libs/llvm-libunwind; then
383
				mycmakeargs+=(
384
					-DUNWIND_LIBRARIES=unwind
385
				)
386
			else
387
				mycmakeargs+=(
388
					-DUNWIND_LIBRARIES=gcc_s
389
				)
390
			fi
391
		fi
392
	fi
393
377
#	Note: go bindings have no CMake rules at the moment
394
#	Note: go bindings have no CMake rules at the moment
378
#	but let's kill the check in case they are introduced
395
#	but let's kill the check in case they are introduced
379
#	if ! multilib_is_native_abi || ! use go; then
396
#	if ! multilib_is_native_abi || ! use go; then
380
- 

Return to bug 722978