diff options
author | echristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-11 03:17:44 +0000 |
---|---|---|
committer | echristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-11 03:17:44 +0000 |
commit | 4bd2ed9112b04e884b85105cfe5ba824b5a6cb94 (patch) | |
tree | e4db4b998f63376cfecfa05fb3add6e6993b520c /gcc/config/t-slibgcc-darwin | |
parent | 90ad1bea5185846dab369e324438fc68efe91daa (diff) | |
download | gcc-4bd2ed9112b04e884b85105cfe5ba824b5a6cb94.tar.gz |
2006-07-10 Eric Christopher <echristo@apple.com>
* config/t-slibgcc-darwin: Rewrite.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115325 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/t-slibgcc-darwin')
-rw-r--r-- | gcc/config/t-slibgcc-darwin | 56 |
1 files changed, 40 insertions, 16 deletions
diff --git a/gcc/config/t-slibgcc-darwin b/gcc/config/t-slibgcc-darwin index e90f500d74c..7510c136b7b 100644 --- a/gcc/config/t-slibgcc-darwin +++ b/gcc/config/t-slibgcc-darwin @@ -2,26 +2,28 @@ SHLIB_SOVERSION = 1 SHLIB_VERSTRING = -compatibility_version $(SHLIB_SOVERSION) -current_version $(SHLIB_SOVERSION).0 SHLIB_EXT = .dylib -SHLIB_SUFFIX = `if test @multilib_dir@ != . ; then echo _@multilib_dir@ ; fi` -SHLIB_SONAME = @shlib_base_name@$(SHLIB_SUFFIX).$(SHLIB_SOVERSION)$(SHLIB_EXT) +SHLIB_SUFFIX = `if test @multilib_dir@ = ppc64 ; then echo _@multilib_dir@ ; fi` +SHLIB_INSTALL_NAME = @shlib_base_name@$(SHLIB_SUFFIX).$(SHLIB_SOVERSION)$(SHLIB_EXT) +SHLIB_SONAME = @shlib_base_name@.$(SHLIB_SOVERSION)$(SHLIB_EXT) +SHLIB_SOLINK = @shlib_base_name@.so SHLIB_MAP = @shlib_map_file@ SHLIB_OBJS = @shlib_objs@ SHLIB_DIR = @multilib_dir@ +SHLIB_LC = -lc # Darwin only searches in /usr/lib for shared libraries, not in subdirectories, # so the libgcc variants have different names not different locations. # Note that this version is used for the loader, not the linker; the linker # uses the stub versions named by $(LIBGCC). SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \ - -Wl,-install_name,$(slibdir)/$(SHLIB_SONAME) \ - -single_module -o $(SHLIB_SONAME).tmp \ + -Wl,-install_name,$(slibdir)/$(SHLIB_INSTALL_NAME) \ + -single_module -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp \ -Wl,-exported_symbols_list,$(SHLIB_MAP) \ $(SHLIB_VERSTRING) \ - @multilib_flags@ $(SHLIB_OBJS) -lc && \ - if [ -f $(SHLIB_SONAME) ]; then \ - mv -f $(SHLIB_SONAME) $(SHLIB_SONAME).backup; \ - else true; fi && \ - mv $(SHLIB_SONAME).tmp $(SHLIB_SONAME) + @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \ + if [ -f stmp-lipo ]; then \ + rm -f stmp-lipo; \ + else true; fi # $(slibdir) double quoted to protect it from expansion while building # libgcc.mk. We want this delayed until actual install time. @@ -42,10 +44,10 @@ ASM_HIDDEN_OP = .private_extern # each system version supported. They are 'stub' libraries that # contain no code, just a list of exported symbols. # The actual use of the libraries is controlled by REAL_LIBGCC_SPEC. -# +# # This assumes each multilib corresponds to a different architecture. libgcc_s.%.dylib : $(SHLIB_VERPFX).%.ver libgcc.a - # When builting multilibbed target libraries, all the required + # When building multilibbed target libraries, all the required # libraries are expected to exist in the multilib directory. MLIBS=`$(GCC_FOR_TARGET) --print-multi-lib \ | sed -e 's/;.*$$//' -e '/^\.$$/d'` ; \ @@ -54,22 +56,44 @@ libgcc_s.%.dylib : $(SHLIB_VERPFX).%.ver libgcc.a $(LN_S) ../$@ $${mlib}/$@ || exit 1 ; \ done MLIBS=`$(GCC_FOR_TARGET) --print-multi-lib \ - | sed -e 's/;.*$$//' -e '/^\.$$/d' -e 's/^/_/'` ; \ + | sed -e 's/;.*$$//' -e '/^\.$$/d'` ; \ for mlib in '' $$MLIBS ; do \ $(STRIP_FOR_TARGET) -o $(@)_T$${mlib} \ -s $(SHLIB_VERPFX).$(*).ver -c -u \ - libgcc_s$${mlib}.$(SHLIB_SOVERSION)$(SHLIB_EXT) || exit 1 ; \ + ./$${mlib}/libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp || exit 1 ; \ done $(LIPO_FOR_TARGET) -output $@ -create $(@)_T* rm $(@)_T* +stmp-lipo: libgcc_s.10.4.dylib libgcc_s.10.5.dylib + # When building multilibbed target libraries, all the required + # libraries are expected to exist in the multilib directory. + MLIBS=`$(GCC_FOR_TARGET) --print-multi-lib \ + | sed -e 's/;.*$$//' -e '/^\.$$/d'` ; \ + for mlib in '' $$MLIBS ; do \ + cp ./$${mlib}/libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp \ + ./libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T_$${mlib} || exit 1 ; \ + done + $(LIPO_FOR_TARGET) -output libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT) \ + -create libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T* + rm libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T* + $(STAMP) stmp-lipo + # From the point-of-view of the Makefiles, libgcc is built by the 'strip' # and 'lipo' commands above. -LIBGCC=libgcc_s.10.4.dylib libgcc_s.10.5.dylib +LIBGCC=stmp-lipo + +INSTALL_FILES=libgcc_s.10.4.dylib libgcc_s.10.5.dylib libgcc_s.1.dylib -install-darwin-libgcc-stubs : $(LIBGCC) installdirs - for d in $(LIBGCC) ; do \ +install-darwin-libgcc-stubs : $(INSTALL_FILES) installdirs install-multilib \ + stmp-lipo + for d in $(INSTALL_FILES) ; do \ $(INSTALL_DATA) $$d $(DESTDIR)$(slibdir)/$$d || exit 1 ; \ done + if [ -f $(DESTDIR)$(slibdir)/libgcc_s_ppc64.1.dylib ]; then \ + rm -f $(DESTDIR)$(slibdir)/libgcc_s_ppc64.1.dylib; \ + else true; fi + $(LN_S) ./libgcc_s.1.dylib \ + $(DESTDIR)$(slibdir)/libgcc_s_ppc64.1.dylib INSTALL_LIBGCC += install-darwin-libgcc-stubs |