llvm.org GIT mirror llvm / 2155d45
Roll back the shared library, r96559. It broke two darwins and arm, mysteriously. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96569 91177308-0d34-0410-b5e6-96231b3b80d8 Jeffrey Yasskin 9 years ago
10 changed file(s) with 12 addition(s) and 150 deletion(s). Raw diff Collapse all Expand all
2929 DIRS := lib/System lib/Support utils
3030 OPTIONAL_DIRS :=
3131 else
32 DIRS := lib/System lib/Support utils lib/VMCore lib tools/llvm-shlib \
33 tools/llvm-config tools runtime docs unittests
32 DIRS := lib/System lib/Support utils lib/VMCore lib tools/llvm-config \
33 tools runtime docs unittests
3434 OPTIONAL_DIRS := projects bindings
3535 endif
3636
265265 # Do we want to build with position independent code?
266266 ENABLE_PIC := @ENABLE_PIC@
267267
268 # Do we want to link the tools shared?
269 ENABLE_SHARED := @ENABLE_SHARED@
270
271268 # Use -fvisibility-inlines-hidden?
272269 ENABLE_VISIBILITY_INLINES_HIDDEN := @ENABLE_VISIBILITY_INLINES_HIDDEN@
273270
277274
278275 # Enable JIT for this platform
279276 TARGET_HAS_JIT = @TARGET_HAS_JIT@
280
281 # Environment variable to set to change the runtime shared library search path.
282 SHLIBPATH_VAR = @SHLIBPATH_VAR@
283277
284278 # Shared library extension for host platform.
285279 SHLIBEXT = @SHLIBEXT@
612612 ifneq ($(HOST_OS),Darwin)
613613 ifneq ($(DARWIN_MAJVERS),4)
614614 ifdef TOOLNAME
615 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
616 ifdef EXAMPLE_TOOL
617 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(RDYNAMIC)
618 else
619 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(RDYNAMIC)
620 endif
615 ifdef EXAMPLE_TOOL
616 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(RDYNAMIC)
617 else
618 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(RDYNAMIC)
619 endif
621620 endif
622621 endif
623622 endif
952951
953952 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
954953
955 ifeq ($(ENABLE_SHARED), 1)
956 LLVMLibsOptions += -lLLVM$(LLVMVersion)
957 LLVMLibsPaths += $(LibDir)/libLLVM$(LLVMVersion)$(SHLIBEXT)
958 else
959 ifeq ($(EXAMPLE_TOOL), 1)
960 LLVMLibsOptions += -lLLVM$(LLVMVersion)
961 LLVMLibsPaths += $(LibDir)/libLLVM$(LLVMVersion)$(SHLIBEXT)
962 else
963954 LLVMLibsOptions += $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS))
964955 LLVMLibsPaths += $(LLVM_CONFIG) \
965956 $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS))
966 endif
967 endif
968957 endif
969958 endif
970959
11721161 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
11731162 # building an archive.
11741163 #---------------------------------------------------------
1175 ifndef NO_BUILD_ARCHIVE
11761164 ifndef BUILD_ARCHIVE
11771165 ifndef LOADABLE_MODULE
11781166 BUILD_ARCHIVE = 1
1179 endif
11801167 endif
11811168 endif
11821169
469469 AC_DEFINE_UNQUOTED([ENABLE_PIC],$ENABLE_PIC,
470470 [Define if position independent code is enabled])
471471
472 dnl Allow linking tools against the shared library.
473 AC_ARG_ENABLE(shared,
474 AS_HELP_STRING([--enable-shared],
475 [Link LLVM tools shared (default is NO)]),,
476 enableval=default)
477 case "$enableval" in
478 yes) AC_SUBST(ENABLE_SHARED,[1]) ;;
479 no) AC_SUBST(ENABLE_SHARED,[0]) ;;
480 default) AC_SUBST(ENABLE_SHARED,[0]) ;;
481 *) AC_MSG_ERROR([Invalid setting for --enable-shared. Use "yes" or "no"]) ;;
482 esac
483
484472 dnl Allow specific targets to be specified for building (or not)
485473 TARGETS_TO_BUILD=""
486474 AC_ARG_ENABLE([targets],AS_HELP_STRING([--enable-targets],
12761264 dnl the Makefiles so we can use it there too
12771265 AC_SUBST(SHLIBEXT,$libltdl_cv_shlibext)
12781266
1279 dnl Propagate the run-time library path variable that the libltdl
1280 dnl checks found to the Makefiles so we can use it there too
1281 AC_SUBST(SHLIBPATH_VAR,$libltdl_cv_shlibpath_var)
1282
12831267 # Translate the various configuration directories and other basic
12841268 # information into substitutions that will end up in Makefile.config.in
12851269 # that these configured values can be used by the makefiles
688688 ENABLE_DOXYGEN
689689 ENABLE_THREADS
690690 ENABLE_PIC
691 ENABLE_SHARED
692691 TARGETS_TO_BUILD
693692 LLVM_ENUM_TARGETS
694693 LLVM_ENUM_ASM_PRINTERS
769768 LLVMGCC_MAJVERS
770769 LLVMGCC_LANGS
771770 SHLIBEXT
772 SHLIBPATH_VAR
773771 LLVM_PREFIX
774772 LLVM_BINDIR
775773 LLVM_LIBDIR
14021400 --enable-threads Use threads if available (default is YES)
14031401 --enable-pic Build LLVM with Position Independent Code (default
14041402 is YES)
1405 --enable-shared Link LLVM tools shared (default is NO)
14061403 --enable-targets Build specific host targets: all or
14071404 target1,target2,... Valid targets are: host, x86,
14081405 x86_64, sparc, powerpc, alpha, arm, mips, spu,
48594856 _ACEOF
48604857
48614858
4862 # Check whether --enable-shared was given.
4863 if test "${enable_shared+set}" = set; then
4864 enableval=$enable_shared;
4865 else
4866 enableval=default
4867 fi
4868
4869 case "$enableval" in
4870 yes) ENABLE_SHARED=1
4871 ;;
4872 no) ENABLE_SHARED=0
4873 ;;
4874 default) ENABLE_SHARED=0
4875 ;;
4876 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-shared. Use \"yes\" or \"no\"" >&5
4877 echo "$as_me: error: Invalid setting for --enable-shared. Use \"yes\" or \"no\"" >&2;}
4878 { (exit 1); exit 1; }; } ;;
4879 esac
4880
48814859 TARGETS_TO_BUILD=""
48824860 # Check whether --enable-targets was given.
48834861 if test "${enable_targets+set}" = set; then
1105611034 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1105711035 lt_status=$lt_dlunknown
1105811036 cat > conftest.$ac_ext <
11059 #line 11060 "configure"
11037 #line 11038 "configure"
1106011038 #include "confdefs.h"
1106111039
1106211040 #if HAVE_DLFCN_H
1961419592 fi
1961519593
1961619594 SHLIBEXT=$libltdl_cv_shlibext
19617
19618
19619 SHLIBPATH_VAR=$libltdl_cv_shlibpath_var
1962019595
1962119596
1962219597 # Translate the various configuration directories and other basic
2067620651 ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim
2067720652 ENABLE_THREADS!$ENABLE_THREADS$ac_delim
2067820653 ENABLE_PIC!$ENABLE_PIC$ac_delim
20679 ENABLE_SHARED!$ENABLE_SHARED$ac_delim
2068020654 TARGETS_TO_BUILD!$TARGETS_TO_BUILD$ac_delim
2068120655 LLVM_ENUM_TARGETS!$LLVM_ENUM_TARGETS$ac_delim
2068220656 LLVM_ENUM_ASM_PRINTERS!$LLVM_ENUM_ASM_PRINTERS$ac_delim
2068620660 OPTIMIZE_OPTION!$OPTIMIZE_OPTION$ac_delim
2068720661 EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim
2068820662 BINUTILS_INCDIR!$BINUTILS_INCDIR$ac_delim
20663 ENABLE_LLVMC_DYNAMIC!$ENABLE_LLVMC_DYNAMIC$ac_delim
2068920664 _ACEOF
2069020665
2069120666 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2072720702 ac_delim='%!_!# '
2072820703 for ac_last_try in false false false false false :; do
2072920704 cat >conf$$subs.sed <<_ACEOF
20730 ENABLE_LLVMC_DYNAMIC!$ENABLE_LLVMC_DYNAMIC$ac_delim
2073120705 ENABLE_LLVMC_DYNAMIC_PLUGINS!$ENABLE_LLVMC_DYNAMIC_PLUGINS$ac_delim
2073220706 CXX!$CXX$ac_delim
2073320707 CXXFLAGS!$CXXFLAGS$ac_delim
2079820772 LLVMGCC_MAJVERS!$LLVMGCC_MAJVERS$ac_delim
2079920773 LLVMGCC_LANGS!$LLVMGCC_LANGS$ac_delim
2080020774 SHLIBEXT!$SHLIBEXT$ac_delim
20801 SHLIBPATH_VAR!$SHLIBPATH_VAR$ac_delim
2080220775 LLVM_PREFIX!$LLVM_PREFIX$ac_delim
2080320776 LLVM_BINDIR!$LLVM_BINDIR$ac_delim
2080420777 LLVM_LIBDIR!$LLVM_LIBDIR$ac_delim
2081920792 LTLIBOBJS!$LTLIBOBJS$ac_delim
2082020793 _ACEOF
2082120794
20822 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
20795 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 88; then
2082320796 break
2082420797 elif $ac_last_try; then
2082520798 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
199199 -e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
200200 -e "s#@LLVMGCCDIR@#$(LLVMGCCDIR)#g" \
201201 -e "s#@LLVM_BUILD_MODE@#$(BuildMode)#g" \
202 -e "s#@ENABLE_SHARED@#$(ENABLE_SHARED)#g" \
203 -e "s#@SHLIBPATH_VAR@#$(SHLIBPATH_VAR)#g" \
204202 $(PROJ_SRC_DIR)/Unit/lit.site.cfg.in > $@
2222
2323 ###
2424
25 # If necessary, point the dynamic loader at libLLVM.so.
26 if config.enable_shared:
27 libdir = os.path.join(config.llvm_obj_root, config.llvm_build_mode, 'lib')
28 shlibpath = config.environment.get(config.shlibpath_var,'')
29 if shlibpath:
30 shlibpath = ':' + shlibpath
31 shlibpath = libdir + shlibpath
32 config.environment[config.shlibpath_var] = shlibpath
25 import os
3326
3427 # Check that the object root is known.
3528 if config.test_exec_root is None:
44 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
55 config.llvmgcc_dir = "@LLVMGCCDIR@"
66 config.llvm_build_mode = "@LLVM_BUILD_MODE@"
7 config.enable_shared = @ENABLE_SHARED@
8 config.shlibpath_var = "@SHLIBPATH_VAR@"
97
108 # Let the main config do the real work.
119 lit.load_config(config, "@LLVM_SOURCE_DIR@/test/Unit/lit.cfg")
+0
-61
tools/llvm-shlib/Makefile less more
None ##===- tools/shlib/Makefile --------------------------------*- Makefile -*-===##
1 #
2 # The LLVM Compiler Infrastructure
3 #
4 # This file is distributed under the University of Illinois Open Source
5 # License. See LICENSE.TXT for details.
6 #
7 ##===----------------------------------------------------------------------===##
8
9 LEVEL = ../..
10 LIBRARYNAME = LLVM$(LLVMVersion)
11
12 NO_BUILD_ARCHIVE = 1
13 LINK_LIBS_IN_SHARED = 1
14 SHARED_LIBRARY = 1
15
16 include $(LEVEL)/Makefile.common
17
18 # Include all archives in libLLVM.(so|dylib) except the ones that have
19 # their own dynamic libraries.
20 Archives := $(wildcard $(LibDir)/libLLVM*.a)
21 SharedLibraries := $(wildcard $(LibDir)/libLLVM*$(SHLIBEXT))
22 IncludeInLibLlvm := $(filter-out $(basename $(SharedLibraries)).a, $(Archives))
23 LLVMLibsOptions := $(IncludeInLibLlvm:$(LibDir)/lib%.a=-l%)
24 LLVMLibsPaths := $(IncludeInLibLlvm)
25
26 $(LibName.SO): $(LLVMLibsPaths)
27
28 ifeq ($(HOST_OS),Darwin)
29 # set dylib internal version number to llvmCore submission number
30 ifdef LLVM_SUBMIT_VERSION
31 LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
32 -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
33 -Wl,-compatibility_version -Wl,1
34 endif
35 # Include everything from the .a's into the shared library.
36 LLVMLibsOptions := $(LLVMLibsOptions) \
37 -Wl,-all_load
38 # extra options to override libtool defaults
39 LLVMLibsOptions := $(LLVMLibsOptions) \
40 -avoid-version \
41 -Wl,-dead_strip \
42 -Wl,-seg1addr -Wl,0xE0000000
43
44 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
45 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
46 ifneq ($(DARWIN_VERS),8)
47 LLVMLibsOptions := $(LLVMLibsOptions) \
48 -Wl,-install_name \
49 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
50 endif
51 endif
52
53 ifeq ($(HOST_OS), Linux)
54 # Include everything from the .a's into the shared library.
55 LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \
56 -Wl,--no-whole-archive
57 # Don't allow unresolved symbols, and warn if we'll need to modify
58 # the text segment when loading libLLVM.so.
59 LLVMLibsOptions += -Wl,--no-undefined,--warn-shared-textrel
60 endif
2727 CPP.Flags += $(NO_VARIADIC_MACROS)
2828 TESTLIBS = -lGoogleTest -lUnitTestMain
2929
30 ifeq ($(ENABLE_SHARED), 1)
31 Run.Shared := $(SHLIBPATH_VAR)="$(LibDir)$${$(SHLIBPATH_VAR):+:}$$$(SHLIBPATH_VAR)"
32 endif
33
3430 $(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
3531 $(Echo) Linking $(BuildMode) unit test $(TESTNAME) $(StripWarnMsg)
3632 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
4137 all:: $(LLVMUnitTestExe)
4238
4339 unitcheck:: $(LLVMUnitTestExe)
44 $(Run.Shared) $(LLVMUnitTestExe)
40 $(LLVMUnitTestExe)
4541
4642 endif