%{!mt:%{!pthread:-a shared -lc -a archive}}}}\
%{shared:%{mt|pthread:-lpthread}}"
-/* The libgcc_stub.a library needs to come last. */
-#undef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC \
- "%G %{!nolibc:%L} %G %{!nostdlib:%{!nodefaultlibs:%{!shared:-lgcc_stub}}}"
-
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}} \
}
#endif
+/* We need to link against libgcc.a for __canonicalize_funcptr_for_compare
+ and $$dyncall. */
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC GNU_USER_TARGET_ENDFILE_SPEC "libgcc.a%s"
+
#undef WCHAR_TYPE
#define WCHAR_TYPE "long int"
%{shared:%{mt|pthread:-lpthread}}"
#endif
-/* The libgcc_stub.a and milli.a libraries need to come last. */
-#undef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC "\
- %G %{!nolibc:%L} %G %{!nostdlib:%{!nodefaultlibs:%{!shared:-lgcc_stub}\
- milli.a%s}}"
-
/* Under hpux11, the normal location of the `ld' and `as' programs is the
/usr/ccs/bin directory. */
%{static:crtbeginT%O%s} %{!static:%{!shared:crtbegin%O%s} \
%{shared:crtbeginS%O%s}}"
#endif
+
+/* The libgcc_stub.a and milli.a libraries must come last. We need
+ to link with these libraries whenever start files are needed. */
#undef ENDFILE_SPEC
-#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
+#define ENDFILE_SPEC \
+ "%{!shared:crtend%O%s libgcc_stub.a%s} %{shared:crtendS%O%s} milli.a%s"
/* Since HP uses the .init and .fini sections for array initializers
and finalizers, we need different defines for INIT_SECTION_ASM_OP