bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ld trapped in endless loop (was Re: config? bootstrap on


From: John David Anglin
Subject: Re: ld trapped in endless loop (was Re: config? bootstrap on
Date: Mon, 21 Jan 2002 14:30:22 -0500 (EST)

>  In message <address@hidden>, "John David 
> Anglin
> " writes:
>  > > I was told that for 64 bit building with hp's compiler was deprecated.
>  > > So binutils changed in this point?
>  > 
>  > I am only reporting my experience.  Obviously, you either have to start
>  > with HP's compiler, prebuilt sources, or cross compile.  So, it doesn't
>  > make much sense to me to deprecate HP's compiler for building binutils
>  > and gcc.
> It hasn't been deprecated -- it never worked due to major limitations in
> HP's compilers.  If folks can get this to work in a clean manner, I 
> suspectthe 
> binutils maintainers would appreciate it.

There are definitely some issues that haven't been worked out.  With
respect to binutils, it definitely will build a hppa64 toolset using
the HP ansi compiler in 11.00.  It will also build the GCC C compiler
which can be used to bootstrap the rest.  I used CC="cc +DA2.0W -Ae".

I think that the non-ansi shipped with 11.11 will build binutils but
not gcc.  I used CC="cc +DA2.0W".  Currently, I get a ICE in stage2
in emit-rtl.c when I start with the HP compiler.  To work around this,
I brought over the build from the 11.00 system and bootstrapped with
it.  I now have a working set of tools on 11.11 which I have 
bootstrapped several times.  As noted, if you build binutils with
gcc, ld is currently miscompiled and seg faults when it tries to
build a shared libstdc++.  Some work needs to be done on the binutils
testsuite for hppa64.  I have a patch for ld/configure.host but it
needs some modification when the build is done with the Hp compiler.

I enclose below the patch to pa/pa64-hpux.h which allows me to boot these
configurations.  I changed MD_EXEC_PREFIX and MD_STARTFILE_PREFIX
because the the langtools files are not available on systems without
the optional HP C compiler.  Defining EH_FRAME_IN_DATA_SECTION was
a suggestion from Jack Cummings.  I had to undefine ENDFILE_SPEC and
redefine STARTFILE_SPEC because the defaults are not suitable.  These
were changed a couple of weeks ago.

I explored using init sections and crtbegin, etc.  However, I found
there is a problem with weak references.  P relocations are used for
function references (plabels).  These are treated as data references
and dld.sl resolves all data references immediately at program startup.
Thus, you can't check a function reference to see if the function has
been bound or not.  I think we need to use Q relocations for weak
function references.  However, the GAS assembler doesn't support
them.  Jeff, do you know how hard that would be to implement.  There
are some other relocations documented in the HP assembler manual that
GAS doesn't support.

I have posted testresults for hppa64-hp-hpux11.00 and hppa64-hp-hpux11.11:
<http://gcc.gnu.org/ml/gcc-testresults/2002-01/msg00413.html>
<http://gcc.gnu.org/ml/gcc-testresults/2002-01/msg00392.html>.

Dave
-- 
J. David Anglin                                  address@hidden
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2002-01-21  John David Anglin  <address@hidden>

        * pa64-hpux.h (MD_EXEC_PREFIX): Set to "/usr/ccs/bin".
        (MD_STARTFILE_PREFIX): Set to "/usr/ccs/lib/pa20_64/".
        (MD_STARTFILE_PREFIX_1): Set to "/opt/langtools/lib/pa20_64/".
        (EH_FRAME_IN_DATA_SECTION): Define and update comment on init sections.
        (ENDFILE_SPEC): Undefine.
        (STARTFILE_SPEC): Redefine for PA.

--- pa64-hpux.h.orig    Fri Jan  4 12:33:12 2002
+++ pa64-hpux.h Sat Jan 19 14:25:12 2002
@@ -41,15 +41,21 @@
 
 #ifndef CROSS_COMPILE
 #undef MD_EXEC_PREFIX
-#define MD_EXEC_PREFIX "/opt/langtools/bin"
+#define MD_EXEC_PREFIX "/usr/ccs/bin"
 #endif
 
-/* Under hpux11 the normal location of the various *crt*.o files is the
-   /usr/ccs/lib directory.  */
+/* Under hpux11 the normal location of the various pa20_64 *crt*.o files
+   is the /usr/ccs/lib/pa20_64 directory.  Some files may also be in the
+   /opt/langtools/lib/pa20_64 directory.  */
 
 #ifndef CROSS_COMPILE
 #undef MD_STARTFILE_PREFIX
-#define MD_STARTFILE_PREFIX "/opt/langtools/lib/pa20_64/"
+#define MD_STARTFILE_PREFIX "/usr/ccs/lib/pa20_64/"
+#endif
+
+#ifndef CROSS_COMPILE
+#undef MD_STARTFILE_PREFIX_1
+#define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/pa20_64/"
 #endif
 
 /* hpux11 has the new HP assembler.  It's still lousy, but it's a whole lot
@@ -107,10 +113,26 @@
    The definitions say how to change sections to the .init and .fini
    sections.  This is the same for all known svr4 assemblers.  */
 
-/* ??? For the time being, we aren't using init sections.  */
+/* For the time being, we aren't using init sections.  `P' relocations
+   are currently used for function references.  However, P relocations are
+   treated as data references and data references are bound by dld.sl
+   immediately at program startup.  This causes an abort due to undefined
+   weak symbols in crtbegin.o (e.g., __register_frame_info).  Possibly
+   Q relocations might avoid this problem but the GNU assembler doesn't
+   support them.  */
 #if 0
 #define INIT_SECTION_ASM_OP    "\t.section\t.init"
 #define FINI_SECTION_ASM_OP    "\t.section\t.fini"
+#else
+#define EH_FRAME_IN_DATA_SECTION 1
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC ""
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "%{!shared: \
+                        %{!symbolic: \
+                         %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}"
 #endif
 
 /* A default list of other sections which we might be "in" at any given



reply via email to

[Prev in Thread] Current Thread [Next in Thread]