aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2020-09-20 19:37:17 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2020-09-20 19:37:17 +0000
commit363e7755f227656684c8e284307ceee451503ca4 (patch)
tree38376199b2a550400bb640f2eb8320dc4c9ad8f3 /gcc
parent0968df43cdd7cbb154c021cd32a7cac25a19aff7 (diff)
downloadgcc-363e7755f227656684c8e284307ceee451503ca4.zip
gcc-363e7755f227656684c8e284307ceee451503ca4.tar.gz
gcc-363e7755f227656684c8e284307ceee451503ca4.tar.bz2
Fix linkage with -nodefaultlibs option.
2020-09-20 John David Anglin < danglin@gcc.gnu.org> gcc/ChangeLog * config/pa/pa-hpux11.h (LINK_GCC_C_SEQUENCE_SPEC): Delete. * config/pa/pa64-hpux.h (LINK_GCC_C_SEQUENCE_SPEC): Likewise. (ENDFILE_SPEC): Link with libgcc_stub.a and mill.a. * config/pa/pa32-linux.h (ENDFILE_SPEC): Link with libgcc.a.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/pa/pa-hpux11.h5
-rw-r--r--gcc/config/pa/pa32-linux.h5
-rw-r--r--gcc/config/pa/pa64-hpux.h12
3 files changed, 10 insertions, 12 deletions
diff --git a/gcc/config/pa/pa-hpux11.h b/gcc/config/pa/pa-hpux11.h
index 794bf8e..2820720 100644
--- a/gcc/config/pa/pa-hpux11.h
+++ b/gcc/config/pa/pa-hpux11.h
@@ -154,11 +154,6 @@ along with GCC; see the file COPYING3. If not see
%{!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}} \
diff --git a/gcc/config/pa/pa32-linux.h b/gcc/config/pa/pa32-linux.h
index f271bbf..970722a 100644
--- a/gcc/config/pa/pa32-linux.h
+++ b/gcc/config/pa/pa32-linux.h
@@ -57,6 +57,11 @@ call_ ## FUNC (void) \
}
#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"
diff --git a/gcc/config/pa/pa64-hpux.h b/gcc/config/pa/pa64-hpux.h
index c7d127f7..096aa4b 100644
--- a/gcc/config/pa/pa64-hpux.h
+++ b/gcc/config/pa/pa64-hpux.h
@@ -103,12 +103,6 @@ along with GCC; see the file COPYING3. If not see
%{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. */
@@ -335,8 +329,12 @@ do { \
%{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