fa9585134f
./ * Makefile.def (target_modules): Add libgcc. (lang_env_dependencies): Remove default items. Use no_c and no_gcc. * Makefile.tpl (clean-target-libgcc): Delete. (configure-target-[+module+]): Emit --disable-bootstrap dependencies on gcc even for bootstrapped modules. Rewrite handling of lang_env_dependencies to loop over target_modules. * configure.in (target_libraries): Add target-libgcc. * Makefile.in, configure: Regenerated. gcc/ * config.gcc: Mention libgcc/config.host. * Makefile.in: Update comments mentioning libgcc. (LIBGCC, INSTALL_LIBGCC, GCC_PARTS, mklibgcc): Delete. (all.cross, start.encap, rest.encap, rest.cross): Update dependencies for libgcc move. (libgcc.mk, LIBGCC_DEPS, libgcov.a, libgcc.a, stmp-multilib) (clean-target, clean-target-libgcc): Delete. (srcdirify, GCC_EXTRA_PARTS): New macros. (libgcc-support, libgcc.mvars): New rules. (distclean): Remove mention of mklibgcc. (install): Don't reference INSTALL_LIBGCC. (install-common): Don't reference EXTRA_PARTS. (install-libgcc, install-multilib): Delete rules. * mklibgcc.in: Delete file. * doc/configfiles.texi: Don't mention mklibgcc. * config/i386/t-darwin (SHLIB_VERPFX): Delete (moved to libgcc). * config/i386/t-darwin64 (SHLIB_VERPFX): Likewise. * config/rs6000/t-darwin (SHLIB_VERPFX): Likewise. * config/rs6000/t-ppccomm (TARGET_LIBGCC2_CFLAGS, SHLIB_MAPFILES) (mklibgcc, ldblspecs): Likewise. * config/i386/t-nwld (libgcc.def, libc.def, libpcre.def) (posixpre.def): Use $(T). (SHLIB_EXT, SHLIB_NAME, SHLIB_SLIBDIR_QUAL, SHLIB_DEF, SHLIB_MAP) (SHLIB_SRC, SHLIB_INSTALL): Delete. (SHLIB_LINK): Make dummy. * config/t-slibgcc-darwin: Delete contents except for dummy SHLIB_LINK. * config/frv/t-linux (EXTRA_MULTILIB_PARTS): Clear. * config/alpha/t-crtfm: Use $(T) in rules for EXTRA_PARTS. * config/alpha/t-vms, config/alpha/t-vms64, config/fr30/t-fr30, config/i386/t-rtems-i386, config/ia64/t-ia64, config/rs6000/t-beos, config/rs6000/t-newas, config/sparc/t-elf: Likewise. * configure.ac (all_outputs): Remove mklibgcc. * configure: Regenerated. libgcc/ * Makefile.in, config/i386/t-darwin, config/i386/t-darwin64, config/i386/t-nwld, config/rs6000/t-darwin, config/rs6000/t-ldbl128, config/i386/t-crtfm, config/alpha/t-crtfm, config/ia64/t-ia64, config/sparc/t-crtfm, config/t-slibgcc-darwin, config/rs6000/t-ppccomm, config.host, configure.ac, empty.mk, shared-object.mk, siditi-object.mk, static-object.mk: New files. * configure: Generated. Co-Authored-By: Paolo Bonzini <bonzini@gnu.org> From-SVN: r120429
123 lines
4.5 KiB
Plaintext
123 lines
4.5 KiB
Plaintext
# 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_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 the versioned members of $(INSTALL_FILES).
|
|
SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \
|
|
-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) $(SHLIB_LC)
|
|
|
|
SHLIB_MKMAP = $(gcc_srcdir)/mkmap-flat.awk
|
|
SHLIB_MKMAP_OPTS = -v leading_underscore=1
|
|
SHLIB_MAPFILES += $(gcc_srcdir)/libgcc-std.ver
|
|
|
|
INSTALL_FILES=libgcc_s.10.4.dylib libgcc_s.10.5.dylib libgcc_s.1.dylib
|
|
|
|
# For the toplevel multilib, build a fat archive including all the multilibs.
|
|
ifeq ($(MULTIBUILDTOP),)
|
|
|
|
SHLIB_INSTALL = \
|
|
$(mkinstalldirs) $(DESTDIR)$(slibdir); \
|
|
$(INSTALL_DATA) $(SHLIB_SONAME) \
|
|
$(DESTDIR)$(slibdir)/$(SHLIB_SONAME)
|
|
|
|
ifeq ($(enable_shared),yes)
|
|
all: $(INSTALL_FILES)
|
|
install: 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 : $(SHLIB_VERPFX).%.ver libgcc_s$(SHLIB_EXT) all-multi
|
|
$(STRIP) -o $(@)_T \
|
|
-s $(SHLIB_VERPFX).$(*).ver -c -u \
|
|
./libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp
|
|
MLIBS=`$(CC) --print-multi-lib \
|
|
| sed -e 's/;.*$$//' -e '/^\.$$/d'` ; \
|
|
for mlib in $$MLIBS ; do \
|
|
$(STRIP) -o $(@)_T$${mlib} \
|
|
-s $(SHLIB_VERPFX).$(*).ver -c -u \
|
|
../$${mlib}/libgcc/$${mlib}/libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp || exit 1 ; \
|
|
done
|
|
$(LIPO) -output $@ -create $(@)_T*
|
|
rm $(@)_T*
|
|
|
|
libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT): all-multi libgcc_s$(SHLIB_EXT) \
|
|
libgcc_s.10.4.dylib libgcc_s.10.5.dylib
|
|
cp libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp \
|
|
./libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T_ || exit 1 ; \
|
|
MLIBS=`$(CC) --print-multi-lib \
|
|
| sed -e 's/;.*$$//' -e '/^\.$$/d'` ; \
|
|
for mlib in $$MLIBS ; do \
|
|
cp ../$${mlib}/libgcc/$${mlib}/libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp \
|
|
./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 : $(INSTALL_FILES)
|
|
$(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.
|
|
SHLIB_INSTALL =
|
|
|
|
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
|