From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- libgcc/config/t-slibgcc-darwin | 133 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 libgcc/config/t-slibgcc-darwin (limited to 'libgcc/config/t-slibgcc-darwin') diff --git a/libgcc/config/t-slibgcc-darwin b/libgcc/config/t-slibgcc-darwin new file mode 100644 index 000000000..0ba8f7913 --- /dev/null +++ b/libgcc/config/t-slibgcc-darwin @@ -0,0 +1,133 @@ +# Build a shared libgcc library with the darwin linker. +SHLIB_SOVERSION = 1 +SHLIB_VERSTRING = -compatibility_version $(SHLIB_SOVERSION) -current_version $(SHLIB_SOVERSION).0 +SHLIB_EXT = .dylib +SHLIB_INSTALL_NAME = @shlib_base_name@.$(SHLIB_SOVERSION)$(SHLIB_EXT) +SHLIB_SONAME = @shlib_base_name@$(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 the versioned members of $(INSTALL_FILES). + +SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \ + -install_name @shlib_slibdir@/$(SHLIB_INSTALL_NAME) \ + -single_module -o $(SHLIB_DIR)/$(SHLIB_SONAME) \ + -Wl,-exported_symbols_list,$(SHLIB_MAP) \ + $(SHLIB_VERSTRING) \ + @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) + +SHLIB_MKMAP = $(gcc_srcdir)/mkmap-flat.awk +SHLIB_MKMAP_OPTS = -v leading_underscore=1 +SHLIB_MAPFILES += $(gcc_srcdir)/libgcc-std.ver $(gcc_srcdir)/libgcc-libsystem.ver + +# we're only going to build the stubs if the target slib is /usr/lib +# there is no other case in which they're useful in a live system. +ifeq (/usr/lib,$(shlib_slibdir)) +LGCC_STUBS = libgcc_s.10.4.dylib libgcc_s.10.5.dylib +else +LGCC_STUBS = +endif + +LGCC_FILES = libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT) +LGCC_FILES += $(LGCC_STUBS) +LEXT_STUBS = libgcc_ext.10.4$(SHLIB_EXT) libgcc_ext.10.5$(SHLIB_EXT) +LGCC_FILES += $(LEXT_STUBS) +INSTALL_FILES=$(LGCC_FILES) + +# we do our own thing +SHLIB_INSTALL = + +# For the toplevel multilib, build a fat archive including all the multilibs. +ifeq ($(MULTIBUILDTOP),) + +ifeq ($(enable_shared),yes) +all: $(INSTALL_FILES) +install-leaf: install-darwin-libgcc-stubs +endif + +# In order to support -mmacosx-version-min, you need to have multiple +# different libgcc_s libraries that actually get linked against, one for +# 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 : all-multi $(SHLIB_VERPFX).%.ver libgcc_s$(SHLIB_EXT) + MLIBS=`$(CC) --print-multi-lib | sed -e 's/;.*$$//'` ; \ + for mlib in $$MLIBS ; do \ + $(STRIP) -o $(@)_T$${mlib} \ + -s $(SHLIB_VERPFX).$(*).ver -c -u \ + ../$${mlib}/libgcc/$${mlib}/libgcc_s$(SHLIB_EXT) || exit 1 ; \ + done + $(LIPO) -output $@ -create $(@)_T* + rm $(@)_T* + +libgcc_ext.%.dylib : all-multi $(SHLIB_VERPFX).%.ver libgcc_s$(SHLIB_EXT) + MLIBS=`$(CC) --print-multi-lib | sed -e 's/;.*$$//'` ; \ + for mlib in $$MLIBS ; do \ + $(STRIP) -o $(@)_T$${mlib} \ + -R $(SHLIB_VERPFX).$(*).ver -c -urx \ + ../$${mlib}/libgcc/$${mlib}/libgcc_s$(SHLIB_EXT) || exit 1 ; \ + done + $(LIPO) -output $@ -create $(@)_T* + rm $(@)_T* + +libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT): all-multi libgcc_s$(SHLIB_EXT) + MLIBS=`$(CC) --print-multi-lib | sed -e 's/;.*$$//'` ; \ + for mlib in $$MLIBS ; do \ + cp ../$${mlib}/libgcc/$${mlib}/libgcc_s$(SHLIB_EXT) \ + ./libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T_$${mlib} || exit 1 ; \ + done + $(LIPO) -output libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT) \ + -create libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T* + rm libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T* + +install-darwin-libgcc-stubs : + $(mkinstalldirs) $(DESTDIR)$(slibdir) + 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 + if [ -f $(DESTDIR)$(slibdir)/libgcc_s_x86_64.1.dylib ]; then \ + rm -f $(DESTDIR)$(slibdir)/libgcc_s_x86_64.1.dylib; \ + else true; fi + $(LN_S) libgcc_s.1.dylib \ + $(DESTDIR)$(slibdir)/libgcc_s_x86_64.1.dylib + +else + +# Do not install shared libraries for any other multilibs. Unless +# we're putting them in the gcc directory during a build, for +# compatibility with the pre-top-level layout. In that case we +# need symlinks. + +ifeq ($(enable_shared),yes) +all: install-darwin-libgcc-links +endif + +install-darwin-libgcc-links: + $(mkinstalldirs) $(gcc_objdir)$(MULTISUBDIR) + for file in $(INSTALL_FILES); do \ + rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file; \ + $(LN_S) ../$$file $(gcc_objdir)$(MULTISUBDIR)/; \ + done + + rm -f $(gcc_objdir)$(MULTISUBDIR)/libgcc_s_x86_64.1.dylib + $(LN_S) libgcc_s.1.dylib \ + $(gcc_objdir)$(MULTISUBDIR)/libgcc_s_x86_64.1.dylib + + rm -f $(gcc_objdir)$(MULTISUBDIR)/libgcc_s_ppc64.1.dylib + $(LN_S) libgcc_s.1.dylib \ + $(gcc_objdir)$(MULTISUBDIR)/libgcc_s_ppc64.1.dylib + +endif -- cgit v1.2.3