+2003-04-11 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * doc/install.texi (hppa): Update links for HP-UX patches. Revise
+ notes on linker selection and configuration for 64-bit HP-UX port.
+ * doc/invoke.texi (hppa): Remove hppa text from description for
+ -ffunction-sections and -fdata-sections. Document -static, -nolibdld
+ and -threads options.
+
+ * pa-hpux10.h (LIB_SPEC): Add link options to resolve dependency of
+ libc.a on libdld.sl when -static is specified and -nolibdld is not
+ specified.
+ * pa64-hpux.h (LIB_SPEC): Likewise.
+ * pa-hpux11.h (LIB_SPEC): Likewise.
+ (LINK_SPEC): Add __gcc_plt_call as an undefined symbol when -shared
+ is not specified.
+
2003-04-11 Zack Weinberg <zack@codesourcery.com>
* config/darwin-c.c (darwin_pragma_unused): Use lookup_name,
#define LIB_SPEC \
"%{!shared:\
%{!p:%{!pg:\
- %{!threads:-lc}\
+ %{!threads:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
%{threads:-lcma -lc_r}}}\
- %{p: -L/lib/libp/ -lc}\
- %{pg: -L/lib/libp/ -lc}}"
+ %{p: -L/lib/libp/ -lc\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
+ %{pg: -L/lib/libp/ -lc\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}"
#undef THREAD_MODEL_SPEC
#define THREAD_MODEL_SPEC "%{!threads:single}%{threads:dce}"
#undef LINK_SPEC
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 1)
#define LINK_SPEC \
- "%{!mpa-risc-1-0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }} -z %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-b}"
+ "%{!mpa-risc-1-0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }} -z\
+ %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
+ %{static:-a archive} %{shared:-b}"
#else
#define LINK_SPEC \
- "-z %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-b}"
+ "-z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
+ %{static:-a archive} %{shared:-b}"
#endif
/* Like the default, except no -lg. */
#define LIB_SPEC \
"%{!shared:\
%{!p:%{!pg:\
- %{!threads:-lc}\
+ %{!threads:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
%{threads:-lcma -lc_r}}}\
- %{p: -L/lib/libp/ -lc}\
- %{pg: -L/lib/libp/ -lc}}"
+ %{p: -L/lib/libp/ -lc\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
+ %{pg: -L/lib/libp/ -lc\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}"
/* Under hpux11, the normal location of the `ld' and `as' programs is the
/usr/ccs/bin directory. */
#undef LIB_SPEC
#define LIB_SPEC \
"%{!shared:\
- %{!p:\
- %{!pg: %{!threads:-lc} %{threads:-lcma -lc_r}}\
- %{pg: -L/usr/lib/pa20_64/libp/ -lgprof -lc}}\
- %{p: -L/usr/lib/pa20_64/libp/ -lprof -lc}} /usr/lib/pa20_64/milli.a"
+ %{!p:%{!pg: -lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
+ %{pg: -L/usr/lib/pa20_64/libp/ -lgprof -lc\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
+ %{p: -L/usr/lib/pa20_64/libp/ -lprof -lc\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
+ /usr/lib/pa20_64/milli.a"
/* Under hpux11, the normal location of the `ld' and `as' programs is the
/usr/ccs/bin directory. */
@itemize @bullet
@item
@html
-<a href="http://us-support.external.hp.com">US, Canada, Asia-Pacific, and
+<a href="http://us.itrc.hp.com/service/home/home.do">US, Canada, Asia-Pacific, and
Latin-America</a>
@end html
@ifnothtml
-@uref{http://us-support.external.hp.com,,}US, Canada, Asia-Pacific, and
-Latin-America
+@uref{http://us.itrc.hp.com/service/home/home.do,,} US, Canada, Asia-Pacific,
+and Latin-America.
@end ifnothtml
@item
-@uref{http://europe-support.external.hp.com,,Europe}
+@uref{http://europe.itrc.hp.com/service/home/home.do,,} Europe.
@end itemize
The HP assembler on these systems is much better than the hpux9 assembler,
compiler for the initial bootstrap. Different prefixes must be used if
both ports are to be installed on the same system.
+It is best to explicitly configure the @samp{hppa64-hp-hpux11*} target
+with the @option{--with-ld=@dots{}} option. We support both the HP
+and GNU linkers for this target. The two linkers require different
+link commands. Thus, it's not possible to switch linkers during a
+GCC build. This has been been reported to occur in a unified build
+of binutils and GCC.
+
GCC 2.95.x is not supported under HP-UX 11 and cannot be used to
compile GCC 3.0 and up. Refer to @uref{binaries.html,,binaries} for
information about obtaining precompiled GCC binaries for HP-UX.
The HP assembler has many limitations and is not recommended for either
the 32 or 64-bit ports. For example, it does not support weak symbols
or alias definitions. As a result, explicit template instantiations
-are required when using C++. You also can't generate debugging information
-when using the HP assembler. Either the HP or GNU linker can be used
-with the 64-bit port but it may be necessary to use the GNU linker
-when dwarf2 exception support is implemented.
+are required when using C++. This will make it difficult if not
+impossible to build many C++ applications. You also can't generate
+debugging information when using the HP assembler with GCC.
+
+There are a number of issues to consider in selecting which linker to
+use with the 64-bit port. The GNU 64-bit linker can only create dynamic
+binaries. The @option{-static} option causes linking with archive
+libraries but doesn't produce a truly static binary. Dynamic binaries
+still require final binding by the dynamic loader to resolve a set of
+dynamic-loader-defined symbols. The default behavior of the HP linker
+is the same as the GNU linker. However, it can generate true 64-bit
+static binaries using the @option{+compat} option.
+
+The HP 64-bit linker doesn't support linkonce semantics. As a
+result, C++ programs have many more sections than they should.
+
+The GNU 64-bit linker has some issues with shared library support
+and exceptions. As a result, we only support libgcc in archive
+format. For similar reasons, dwarf2 unwind and exception support
+are disabled. The GNU linker also has problems creating binaries
+with @option{-static}. It doesn't provide stubs for internal
+calls to global functions in shared libraries, so these calls
+can't be overloaded.
There are several possible approaches to building the distribution.
Binutils can be built first using the HP tools. Then, the GCC
-mno-portable-runtime -mno-soft-float @gol
-mno-space-regs -msoft-float -mpa-risc-1-0 @gol
-mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime @gol
--mschedule=@var{cpu-type} -mspace-regs -msio -mwsio}
+-mschedule=@var{cpu-type} -mspace-regs -msio -mwsio @gol
+-nolibdld -static -threads}
@emph{Intel 960 Options}
@gccoptlist{-m@var{cpu-type} -masm-compat -mclean-linkage @gol
in the output file.
Use these options on systems where the linker can perform optimizations
-to improve locality of reference in the instruction space. HPPA
-processors running HP-UX and SPARC processors running Solaris 2 have
-linkers with such optimizations. Other systems using the ELF object format
-as well as AIX may have these optimizations in the future.
+to improve locality of reference in the instruction space. Most systems
+using the ELF object format and SPARC processors running Solaris 2 have
+linkers with such optimizations. AIX may have these optimizations in
+the future.
Only use these options when there are significant benefits from doing
so. When you specify these options, the assembler and linker will
However, an indirect call is used on 32-bit ELF systems in pic code
and it is quite long.
+@item -nolibdld
+@opindex nolibdld
+Suppress the generation of link options to search libdld.sl when the
+@option{-static} option is specified on HP-UX 10 and later.
+
+@item -static
+@opindex static
+The HP-UX implementation of setlocale in libc has a dependency on
+libdld.sl. There isn't an archive version of libdld.sl. Thus,
+when the @option{-static} option is specified, special link options
+are needed to resolve this dependency.
+
+On HP-UX 10 and later, the GCC driver adds the necessary options to
+link with libdld.sl when the @option{-static} option is specified.
+This causes the resulting binary to be dynamic. On the 64-bit port,
+the linkers generate dynamic binaries by default in any case. The
+@option{-nolibdld} option can be used to prevent the GCC driver from
+adding these link options.
+
+@item -threads
+@opindex threads
+Add support for multithreading with the @dfn{dce thread} library
+under HP-UX. This option sets flags for both the preprocessor and
+linker.
@end table
@node Intel 960 Options