when linking a shared library out of .a files. This is what other packages that use -Wl,--whole-archive seem to do. This works with and without cwrappers. XXX someone please apply similar fixes for Darwin and SunOS if necessary
30 lines
1.3 KiB
Text
30 lines
1.3 KiB
Text
$NetBSD: patch-tools_llvm-shlib_Makefile,v 1.2 2015/04/26 13:08:38 tnn Exp $
|
|
|
|
Add NetBSD support.
|
|
Use full paths to archive files instead of -lfoo to avoid wrapper reordering.
|
|
|
|
--- tools/llvm-shlib/Makefile.orig 2014-05-15 00:15:27.000000000 +0000
|
|
+++ tools/llvm-shlib/Makefile
|
|
@@ -64,18 +64,18 @@ ifeq ($(HOST_OS),Darwin)
|
|
endif
|
|
endif
|
|
|
|
-ifeq ($(HOST_OS), $(filter $(HOST_OS), DragonFly Linux FreeBSD GNU/kFreeBSD OpenBSD GNU Bitrig))
|
|
+ifeq ($(HOST_OS), $(filter $(HOST_OS), DragonFly Linux FreeBSD GNU/kFreeBSD NetBSD OpenBSD GNU Bitrig))
|
|
# Include everything from the .a's into the shared library.
|
|
- LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \
|
|
+ LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsPaths) \
|
|
-Wl,--no-whole-archive
|
|
endif
|
|
|
|
-ifeq ($(HOST_OS), $(filter $(HOST_OS), DragonFly Linux FreeBSD GNU/kFreeBSD GNU))
|
|
+ifeq ($(HOST_OS), $(filter $(HOST_OS), DragonFly Linux FreeBSD GNU/kFreeBSD NetBSD GNU))
|
|
# Add soname to the library.
|
|
LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT)
|
|
endif
|
|
|
|
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD))
|
|
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD NetBSD))
|
|
# Don't allow unresolved symbols.
|
|
LLVMLibsOptions += -Wl,--no-undefined
|
|
endif
|