@@ -3605,30 +3605,6 @@ darwin_fold_builtin (tree fndecl, int n_args, tree
*argp,
void
darwin_rename_builtins (void)
{
- /* The system ___divdc3 routine in libSystem on darwin10 is not
- accurate to 1ulp, ours is, so we avoid ever using the system name
- for this routine and instead install a non-conflicting name that
- is accurate.
-
- When -ffast-math or -funsafe-math-optimizations is given, we can
- use the faster version. */
- if (!flag_unsafe_math_optimizations)
- {
- enum built_in_function dcode
- = (enum built_in_function)(BUILT_IN_COMPLEX_DIV_MIN
- + DCmode - MIN_MODE_COMPLEX_FLOAT);
- tree fn = builtin_decl_explicit (dcode);
- /* Fortran and c call TARGET_INIT_BUILTINS and
- TARGET_INIT_LIBFUNCS at different times, so we have to put a
- call into each to ensure that at least one of them is called
- after build_common_builtin_nodes. A better fix is to add a
- new hook to run after build_common_builtin_nodes runs. */
- if (fn)
- set_user_assembler_name (fn, "___ieee_divdc3");
- fn = builtin_decl_implicit (dcode);
- if (fn)
- set_user_assembler_name (fn, "___ieee_divdc3");
- }
}
bool
@@ -260,14 +260,12 @@ extern GTY(()) int darwin_ms_struct;
/* Tell collect2 to run dsymutil for us as necessary. */
#define COLLECT_RUN_DSYMUTIL 1
-/* Fix PR47558 by linking against libSystem ahead of libgcc. See also
- PR 80556 and the fallout from this. */
-
+/* We only want one instance of %G, since libSystem (Darwin's -lc) does not
+ depend on libgcc, however Darwin 8 relies on __eprintf from libgcc.a so
+ we append that. */
#undef LINK_GCC_C_SEQUENCE_SPEC
#define LINK_GCC_C_SEQUENCE_SPEC \
-"%{!static:%{!static-libgcc: \
- %:version-compare(>= 10.6 mmacosx-version-min= -lSystem) } } \
- %G %{!nolibc:%L}"
+ "%G %{!nolibc:%L} %:version-compare(!> 10.5 mmacosx-version-min= -lgcc)"
/* ld64 supports a sysroot, it just has a different name and there's no easy
way to check for it at config time. */
@@ -375,37 +373,42 @@ extern GTY(()) int darwin_ms_struct;
#define LIB_SPEC "%{!static:-lSystem}"
-/* Support -mmacosx-version-min by supplying different (stub) libgcc_s.dylib
- libraries to link against, and by not linking against libgcc_s on
- earlier-than-10.3.9. If we need exceptions, prior to 10.3.9, then we
have
- to link the static eh lib, since there's no shared version on the system.
-
- Note that by default, except as above, -lgcc_eh is not linked against.
+/*
+ Note that by default, -lgcc_eh is not linked against.
This is because,in general, we need to unwind through system libraries that
are linked with the shared unwinder in libunwind (or libgcc_s for 10.4/5).
- The static version of the current libgcc unwinder (which differs from the
- implementation in libunwind.dylib on systems Darwin10 [10.6]+) can be
used
- by specifying -static-libgcc.
+ For -static-libgcc: < 10.6, use the unwinder in libgcc_eh (and find
+ the emultls impl. there too).
+
+ For -static-libgcc: >= 10.6, the unwinder *still* comes from libSystem
and
+ we find the emutls impl from lemutls_w. In either case, the builtins etc.
+ are linked from -lgcc.
- If libgcc_eh is linked against, it has to be before -lgcc, because it
might
- need symbols from -lgcc. */
+ When we have specified shared-libgcc or any case that might require
+ exceptions, we pull the libgcc content (including emulated tls) from
+ -lgcc_s.1 in GCC and the unwinder from /usr/lib/libgcc_s.1 for < 10.6 and
+ libSystem for >= 10.6 respectively.
+ Otherwise, we just link the emutls/builtins from convenience libs.
+ If we need exceptions, prior to 10.3.9, then we have to link the static
+ eh lib, since there's no shared version on the system.
+
+ In all cases, libgcc_s.1 will be installed with the compiler, or any app
+ built using it, so we can link the builtins and emutls shared on all.
+*/
#undef REAL_LIBGCC_SPEC
-#define REAL_LIBGCC_SPEC \
- "%{static-libgcc|static: -lgcc_eh -lgcc; \
- shared-libgcc|fexceptions|fobjc-exceptions|fgnu-runtime: \
- %:version-compare(!> 10.3.9 mmacosx-version-min= -lgcc_eh) \
- %:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(>< 10.3.9 10.5 mmacosx-version-min=
-lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc ; \
- :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(>< 10.3.9 10.5 mmacosx-version-min=
-lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc }"
+#define REAL_LIBGCC_SPEC \
+"%{static-libgcc|static: \
+ %:version-compare(!> 10.6 mmacosx-version-min= -lgcc_eh) \
+ %:version-compare(>= 10.6 mmacosx-version-min= -lemutls_w) -lgcc; \
+ shared-libgcc|fexceptions|fobjc-exceptions|fgnu-runtime: \
+ -lgcc_s.1.1 \
+ %:version-compare(!> 10.3.9 mmacosx-version-min= -lgcc_eh) \
+ %:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
+ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5); \
+ : -lemutls_w -lgcc \
+ }"
/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
@@ -39,33 +39,6 @@ along with GCC; see the file COPYING3. If not see
#endif
#endif
-/* WORKAROUND pr80556:
- For x86_64 Darwin10 and later, the unwinder is in libunwind (redirected
- from libSystem). This doesn't use the keymgr (see keymgr.c) and
therefore
- the calls that libgcc makes to obtain the KEYMGR_GCC3_DW2_OBJ_LIST are
not
- updated to include new images, and might not even be valid for a single
- image.
- Therefore, for 64b exes at least, we must use the libunwind
implementation,
- even when static-libgcc is specified. We put libSystem first so that
- unwinder symbols are satisfied from there.
- We default to 64b for single-arch builds, so apply this
unconditionally. */
-#undef REAL_LIBGCC_SPEC
-#define REAL_LIBGCC_SPEC \
- "%{static-libgcc|static: \
- %:version-compare(>= 10.6 mmacosx-version-min= -lSystem) \
- -lgcc_eh -lgcc; \
- shared-libgcc|fexceptions|fgnu-runtime: \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc ; \
- :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc }"
-
/* Size of the Obj-C jump buffer. */
#define OBJC_JBLEN ((TARGET_64BIT) ? ((9 * 2) + 3 + 16) : (18))
b/gcc/config/i386/darwin32-biarch.h
@@ -21,32 +21,6 @@ along with GCC; see the file COPYING3. If not see
#undef DARWIN_ARCH_SPEC
#define DARWIN_ARCH_SPEC "%{m64:x86_64;:i386}"
-/* WORKAROUND pr80556:
- For x86_64 Darwin10 and later, the unwinder is in libunwind (redirected
- from libSystem). This doesn't use the keymgr (see keymgr.c) and
therefore
- the calls that libgcc makes to obtain the KEYMGR_GCC3_DW2_OBJ_LIST are
not
- updated to include new images, and might not even be valid for a single
- image.
- Therefore, for 64b exes at least, we must use the libunwind
implementation,
- even when static-libgcc is specified. We put libSystem first so that
- unwinder symbols are satisfied from there. */
-#undef REAL_LIBGCC_SPEC
-#define REAL_LIBGCC_SPEC \
- "%{static-libgcc|static: \
- %{m64:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)} \
- -lgcc_eh -lgcc; \
- shared-libgcc|fexceptions|fgnu-runtime: \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc ; \
- :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc }"
-
#undef DARWIN_SUBARCH_SPEC
#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC
b/gcc/config/i386/darwin64-biarch.h
@@ -22,32 +22,6 @@ along with GCC; see the file COPYING3. If not see
#undef DARWIN_ARCH_SPEC
#define DARWIN_ARCH_SPEC "%{m32:i386;:x86_64}"
-/* WORKAROUND pr80556:
- For x86_64 Darwin10 and later, the unwinder is in libunwind (redirected
- from libSystem). This doesn't use the keymgr (see keymgr.c) and
therefore
- the calls that libgcc makes to obtain the KEYMGR_GCC3_DW2_OBJ_LIST are
not
- updated to include new images, and might not even be valid for a single
- image.
- Therefore, for 64b exes at least, we must use the libunwind
implementation,
- even when static-libgcc is specified. We put libSystem first so that
- unwinder symbols are satisfied from there. */
-#undef REAL_LIBGCC_SPEC
-#define REAL_LIBGCC_SPEC \
- "%{static-libgcc|static: \
- %{!m32:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)} \
- -lgcc_eh -lgcc; \
- shared-libgcc|fexceptions|fgnu-runtime: \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc ; \
- :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
- -lgcc }"
-
#undef DARWIN_SUBARCH_SPEC
#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC
b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c
@@ -4,7 +4,6 @@
/* { dg-require-effective-target int128 } */
/* { dg-require-effective-target fenv } */
/* { dg-options "-frounding-math" } */
-/* { dg-xfail-run-if "see PR80556 c63" { x86_64-*-darwin* i68?-*-darwin* }
{ "*" } { "" } } */
#include <fenv.h>
#include <stdlib.h>
b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c
@@ -4,7 +4,6 @@
/* { dg-require-effective-target int128 } */
/* { dg-require-effective-target fenv } */
/* { dg-options "-frounding-math" } */
-/* { dg-xfail-run-if "see PR80556 c63" { x86_64-*-darwin* i68?-*-darwin* }
{ "*" } { "" } } */
#include <fenv.h>
#include <stdlib.h>
@@ -214,8 +214,11 @@ esac
case ${host} in
*-*-darwin*)
asm_hidden_op=.private_extern
- tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-libgcc-pic
t-slibgcc-darwin"
- extra_parts="crt3.o d10-uwfef.o crttms.o crttme.o"
+ tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-libgcc-pic"
+ extra_parts="crt3.o d10-uwfef.o crttms.o crttme.o libemutls_w.a"
+ # The unwinder is provided by the system shared libraries, do not add one
+ # to the shared libgcc.
+ tmake_file="$tmake_file t-darwin-noeh t-slibgcc-darwin"
;;
*-*-dragonfly*)
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip"
@@ -678,12 +681,12 @@ hppa*-*-netbsd*)
;;
i[34567]86-*-darwin*)
tmake_file="$tmake_file i386/t-crtpc t-crtfm i386/t-msabi"
- tm_file="$tm_file i386/darwin-lib.h"
+ tm_file="$tm_file "
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;;
x86_64-*-darwin*)
tmake_file="$tmake_file i386/t-crtpc t-crtfm i386/t-msabi"
- tm_file="$tm_file i386/darwin-lib.h"
+ tm_file="$tm_file "
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;;
i[34567]86-*-elfiamcu)
b/libgcc/config/i386/libgcc-darwin.10.4.ver
deleted file mode 100644
@@ -1,98 +0,0 @@
-# Copyright (C) 2005-2021 Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GCC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-__Unwind_Backtrace
-__Unwind_DeleteException
-__Unwind_FindEnclosingFunction
-__Unwind_Find_FDE
-__Unwind_ForcedUnwind
-__Unwind_GetCFA
-__Unwind_GetDataRelBase
-__Unwind_GetGR
-__Unwind_GetIP
-__Unwind_GetLanguageSpecificData
-__Unwind_GetRegionStart
-__Unwind_GetTextRelBase
-__Unwind_RaiseException
-__Unwind_Resume
-__Unwind_Resume_or_Rethrow
-__Unwind_SetGR
-__Unwind_SetIP
-___absvdi2
-___absvsi2
-___addvdi3
-___addvsi3
-___ashldi3
-___ashrdi3
-___clear_cache
-___clzdi2
-___clzsi2
-___cmpdi2
-___ctzdi2
-___ctzsi2
-___deregister_frame
-___deregister_frame_info
-___deregister_frame_info_bases
-___divdc3
-___divdi3
-___divsc3
-___divxc3
-___enable_execute_stack
-___ffsdi2
-___fixdfdi
-___fixsfdi
-___fixunsdfdi
-___fixunsdfsi
-___fixunssfdi
-___fixunssfsi
-___fixunsxfdi
-___fixunsxfsi
-___fixxfdi
-___floatdidf
-___floatdisf
-___floatdixf
-___gcc_personality_v0
-___lshrdi3
-___moddi3
-___muldc3
-___muldi3
-___mulsc3
-___mulvdi3
-___mulvsi3
-___mulxc3
-___negdi2
-___negvdi2
-___negvsi2
-___paritydi2
-___paritysi2
-___popcountdi2
-___popcountsi2
-___powidf2
-___powisf2
-___powixf2
-___register_frame
-___register_frame_info
-___register_frame_info_bases
-___register_frame_info_table
-___register_frame_info_table_bases
-___register_frame_table
-___subvdi3
-___subvsi3
-___ucmpdi2
-___udivdi3
-___udivmoddi4
-___umoddi3
b/libgcc/config/i386/libgcc-darwin.10.5.ver
deleted file mode 100644
@@ -1,102 +0,0 @@
-# Copyright (C) 2005-2021 Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GCC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-__Unwind_Backtrace
-__Unwind_DeleteException
-__Unwind_FindEnclosingFunction
-__Unwind_Find_FDE
-__Unwind_ForcedUnwind
-__Unwind_GetCFA
-__Unwind_GetDataRelBase
-__Unwind_GetGR
-__Unwind_GetIP
-__Unwind_GetIPInfo
-__Unwind_GetLanguageSpecificData
-__Unwind_GetRegionStart
-__Unwind_GetTextRelBase
-__Unwind_RaiseException
-__Unwind_Resume
-__Unwind_Resume_or_Rethrow
-__Unwind_SetGR
-__Unwind_SetIP
-___absvdi2
-___absvsi2
-___addvdi3
-___addvsi3
-___ashldi3
-___ashrdi3
-___clear_cache
-___clzdi2
-___clzsi2
-___cmpdi2
-___ctzdi2
-___ctzsi2
-___deregister_frame
-___deregister_frame_info
-___deregister_frame_info_bases
-___divdc3
-___divdi3
-___divsc3
-___divxc3
-___enable_execute_stack
-___ffsdi2
-___fixdfdi
-___fixsfdi
-___fixunsdfdi
-___fixunsdfsi
-___fixunssfdi
-___fixunssfsi
-___fixunsxfdi
-___fixunsxfsi
-___fixxfdi
-___floatdidf
-___floatdisf
-___floatdixf
-___floatundidf
-___floatundisf
-___floatundixf
-___gcc_personality_v0
-___lshrdi3
-___moddi3
-___muldc3
-___muldi3
-___mulsc3
-___mulvdi3
-___mulvsi3
-___mulxc3
-___negdi2
-___negvdi2
-___negvsi2
-___paritydi2
-___paritysi2
-___popcountdi2
-___popcountsi2
-___powidf2
-___powisf2
-___powixf2
-___register_frame
-___register_frame_info
-___register_frame_info_bases
-___register_frame_info_table
-___register_frame_info_table_bases
-___register_frame_table
-___subvdi3
-___subvsi3
-___ucmpdi2
-___udivdi3
-___udivmoddi4
-___umoddi3
b/libgcc/config/i386/libgcc-darwin.ver
new file mode 100644
@@ -0,0 +1,2 @@
+__cpu_model
+__cpu_indicator_init
@@ -1,3 +1,5 @@
LIB2_SIDITI_CONV_FUNCS = yes
LIB2ADD = $(srcdir)/config/darwin-64.c
LIB2FUNCS_EXCLUDE = _fixtfdi _fixunstfdi _floatditf _floatunditf
+
+SHLIB_MAPFILES += $(srcdir)/config/$(cpu_type)/libgcc-darwin.ver
b/libgcc/config/libgcc-libsystem.ver
deleted file mode 100644
@@ -1 +0,0 @@
-_darwin10_Unwind_FindEnclosingFunction
b/libgcc/config/rs6000/libgcc-darwin.10.4.ver
deleted file mode 100644
@@ -1,93 +0,0 @@
-# Copyright (C) 2005-2021 Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GCC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-__Unwind_Backtrace
-__Unwind_DeleteException
-__Unwind_FindEnclosingFunction
-__Unwind_Find_FDE
-__Unwind_ForcedUnwind
-__Unwind_GetCFA
-__Unwind_GetDataRelBase
-__Unwind_GetGR
-__Unwind_GetIP
-__Unwind_GetLanguageSpecificData
-__Unwind_GetRegionStart
-__Unwind_GetTextRelBase
-__Unwind_RaiseException
-__Unwind_Resume
-__Unwind_Resume_or_Rethrow
-__Unwind_SetGR
-__Unwind_SetIP
-___absvdi2
-___absvsi2
-___addvdi3
-___addvsi3
-___ashldi3
-___ashrdi3
-___clear_cache
-___clzdi2
-___clzsi2
-___cmpdi2
-___ctzdi2
-___ctzsi2
-___deregister_frame
-___deregister_frame_info
-___deregister_frame_info_bases
-___divdi3
-___enable_execute_stack
-___ffsdi2
-___fixdfdi
-___fixsfdi
-___fixtfdi
-___fixunsdfdi
-___fixunsdfsi
-___fixunssfdi
-___fixunssfsi
-___fixunstfdi
-___floatdidf
-___floatdisf
-___floatditf
-___gcc_personality_v0
-___gcc_qadd
-___gcc_qdiv
-___gcc_qmul
-___gcc_qsub
-___lshrdi3
-___moddi3
-___muldi3
-___mulvdi3
-___mulvsi3
-___negdi2
-___negvdi2
-___negvsi2
-___paritydi2
-___paritysi2
-___popcountdi2
-___popcountsi2
-___register_frame
-___register_frame_info
-___register_frame_info_bases
-___register_frame_info_table
-___register_frame_info_table_bases
-___register_frame_table
-___subvdi3
-___subvsi3
-___trampoline_setup
-___ucmpdi2
-___udivdi3
-___udivmoddi4
-___umoddi3
b/libgcc/config/rs6000/libgcc-darwin.10.5.ver
deleted file mode 100644
@@ -1,106 +0,0 @@
-# Copyright (C) 2005-2021 Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GCC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-__Unwind_Backtrace
-__Unwind_DeleteException
-__Unwind_FindEnclosingFunction
-__Unwind_Find_FDE
-__Unwind_ForcedUnwind
-__Unwind_GetCFA
-__Unwind_GetDataRelBase
-__Unwind_GetGR
-__Unwind_GetIP
-__Unwind_GetIPInfo
-__Unwind_GetLanguageSpecificData
-__Unwind_GetRegionStart
-__Unwind_GetTextRelBase
-__Unwind_RaiseException
-__Unwind_Resume
-__Unwind_Resume_or_Rethrow
-__Unwind_SetGR
-__Unwind_SetIP
-___absvdi2
-___absvsi2
-___addvdi3
-___addvsi3
-___ashldi3
-___ashrdi3
-___clear_cache
-___clzdi2
-___clzsi2
-___cmpdi2
-___ctzdi2
-___ctzsi2
-___deregister_frame
-___deregister_frame_info
-___deregister_frame_info_bases
-___divdc3
-___divdi3
-___divsc3
-___divtc3
-___enable_execute_stack
-___ffsdi2
-___fixdfdi
-___fixsfdi
-___fixtfdi
-___fixunsdfdi
-___fixunsdfsi
-___fixunssfdi
-___fixunssfsi
-___fixunstfdi
-___floatdidf
-___floatdisf
-___floatditf
-___floatundidf
-___floatundisf
-___floatunditf
-___gcc_personality_v0
-___gcc_qadd
-___gcc_qdiv
-___gcc_qmul
-___gcc_qsub
-___lshrdi3
-___moddi3
-___muldc3
-___muldi3
-___mulsc3
-___multc3
-___mulvdi3
-___mulvsi3
-___negdi2
-___negvdi2
-___negvsi2
-___paritydi2
-___paritysi2
-___popcountdi2
-___popcountsi2
-___powidf2
-___powisf2
-___powitf2
-___register_frame
-___register_frame_info
-___register_frame_info_bases
-___register_frame_info_table
-___register_frame_info_table_bases
-___register_frame_table
-___subvdi3
-___subvsi3
-___trampoline_setup
-___ucmpdi2
-___udivdi3
-___udivmoddi4
-___umoddi3
@@ -15,6 +15,18 @@ crttme.o: $(srcdir)/config/darwin-crt-tm.c
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/config/unwind-dw2-fde-darwin.c \
$(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+# Make a weak version to use in static lib and as a crt.
+emutls.o: HOST_LIBGCC2_CFLAGS += -DEMUTLS_ATTR='__attribute__((__weak__))'
+
+# Make it a convenience lib so that it can be linked optionally.
+libemutls_w.a: emutls.o
+ $(AR_CREATE_FOR_TARGET) $@ $<
+ $(RANLIB_FOR_TARGET) $@
+
# Patch to __Unwind_Find_Enclosing_Function for Darwin10.
d10-uwfef.o: $(srcdir)/config/darwin10-unwind-find-enc-func.c
$(crt_compile) -mmacosx-version-min=10.6 -c $<
+
+# Start with an empty list and allow the arch-specific t-darwin files to
add in
+# any extras, with the main set added by t-slibgcc-darwin.
+SHLIB_MAPFILES =
new file mode 100644
@@ -0,0 +1,4 @@
+# Most Darwin versions get their unwinder from libSystem.
+# so remove the unwinder from the shared lib.
+# We still need it in the _eh.a for Darwin8/9.
+LIB2ADDEHSHARED =
@@ -1,44 +1,35 @@
# Build a shared libgcc library with the darwin linker.
-SHLIB_SOVERSION = 1
-SHLIB_VERSTRING = -compatibility_version $(SHLIB_SOVERSION)
-current_version $(SHLIB_SOVERSION).0
+
+SHLIB_SOVERSION = 1.1
+SHLIB_SO_MINVERSION = 1
+SHLIB_VERSTRING = -compatibility_version $(SHLIB_SO_MINVERSION)
-current_version $(SHLIB_SOVERSION)
SHLIB_EXT = .dylib
+SHLIB_LC = -lc
+
+# Shorthand expressions for the LINK below.
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
+SHLIB_SONAME = @shlib_base_name@$(SHLIB_EXT)
-# 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).
+# Darwin only searches in shlib_slibdir for shared libraries, not in
+# subdirectories. The link builds one architecture slice in its designated
+# subdir. The code under MULTIBUILDTOP combines these into a single FAT
+# library, that is what we eventually install.
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)
+ @multilib_flags@ @shlib_objs@ $(SHLIB_LC)
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MKMAP_OPTS = -v leading_underscore=1
-SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/libgcc-libsystem.ver
-SHLIB_VERPFX = $(srcdir)/config/$(cpu_type)/libgcc-darwin
-
-# 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
+SHLIB_MAPFILES += libgcc-std.ver
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
@@ -52,33 +43,6 @@ 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 \
@@ -89,28 +53,20 @@ libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT): all-multi
libgcc_s$(SHLIB_EXT)
-create libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T*
rm libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T*
+# Install the shared library.
+
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.
+# Do not install shared libraries for any other multilibs. Unless we are
+# putting them in the gcc directory during a build, for compatibility with
+# the pre-top-level layout. In that case we provide symlinks to the FAT lib
+# from the sub-directories.
ifeq ($(enable_shared),yes)
all: install-darwin-libgcc-links
@@ -123,12 +79,4 @@ install-darwin-libgcc-links:
$(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
@@ -50,8 +50,16 @@ struct __emutls_array
void **data[];
};
-void *__emutls_get_address (struct __emutls_object *);
-void __emutls_register_common (struct __emutls_object *, word, word, void
*);
+/* EMUTLS_ATTR is provided to allow targets to build the emulated tls
+ routines as weak functions for inclusion in convenience libraries.
+ If there is no definition, fall back to the default. */
+#ifndef EMUTLS_ATTR
+# define EMUTLS_ATTR
+#endif
+
+void *__emutls_get_address (struct __emutls_object *) EMUTLS_ATTR;
+void __emutls_register_common (struct __emutls_object *,
+ word, word, void *) EMUTLS_ATTR;
#ifdef __GTHREADS