This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem building gcc-4.2.2 64-bit on hp-ux 11.11, more problems, SUCCESS


Andreas:

"For the "ld" you should use the OS "ld""

Why is the local OS's ld preferable to the GNU ld?

Thomas Dineen


Thomas Mittelstaedt wrote:


Thank you, Andreas,

That got it through, though not cleanly as I had to specify those linker flags '-pthread -lpthread' in 2
more generated Makefile's, gcc-build/Makefile and fixincludes/Makefile after the comparison and when libstdc++ was
built. Somebody can be point to the way to do this properly?
The installed gcc still complains about unsatisfied symbols when linking a small test program. Have add -lpthread all the time.



ld: Unsatisfied symbol "pthread_mutex_unlock" in file /localbuild/opt/gcc64-4.2.2/lib/gcc/hppa64-hp-hpux11.11/4.2.2/libgcc_eh.a[unwind-dw2-fde.o]


ld: Unsatisfied symbol "pthread_mutex_lock" in file /localbuild/opt/gcc64-4.2.2/lib/gcc/hppa64-hp-hpux11.11/4.2.2/libgcc_eh.a[unwind-dw2-fde.o]

2 errors.
collect2: ld returned 1 exit status







Here is my build script:
PATH=/opt/gcc-4.1.2-64/bin:/usr/local/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/pd/bin:/opt/resmon/bin:/opt/gnome/bin:/opt/mozilla:/opt/wbem/bin:/opt/wbem/sbin:/opt/graphics/common/bin:/opt/atok/bin:/opt/egb/bin:/usr/sbin/diag/contrib:/opt/vje/bin:/opt/hpsmh/bin:/opt/perl/bin:




LDFLAGS='-pthread -lpthread'
BOOT_LDFLAGS='-pthread -lpthread'
LDFLAGS_FOR_BUILD='-pthread -lpthread'
export PATH LDFLAGS BOOT_LDFLAGS LDFLAGS_FOR_BUILD

export CONFIG_SHELL=/usr/local/bin/bash
export LANG=C
export CC='/opt/gcc-4.1.2-64/bin/gcc'

../gcc-4.2.2/configure --prefix=/localbuild/opt/gcc64-4.2.2 --enable-version-specific-runtime-libs --enable-static --enable-shared --with-ar=/usr/bin/ar --with-gnu-as --with-as=/opt/gcc-4.1.2-64/bin/as --enable-threads=posix --disable-nls --without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-languages=c,c++,objc

make CFLAGS='-O' LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' LDFLAGS='-pthread -lpthread' BOOT_LDFLAGS='-pthread -lpthread' LDFLAGS_FOR_BUILD='-pthread -lpthread' bootstrap



*** Makefile~    Thu Dec 20 11:51:02 2007
--- Makefile    Thu Dec 20 15:21:51 2007
***************
*** 149,155 ****
     CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
     DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
     LD="$(LD)"; export LD; \
!     LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
     NM="$(NM)"; export NM; \
     RANLIB="$(RANLIB)"; export RANLIB; \
     WINDRES="$(WINDRES)"; export WINDRES; \
--- 149,155 ----
     CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
     DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
     LD="$(LD)"; export LD; \
!     LDFLAGS="$(LDFLAGS) -pthread -lpthread"; export LDFLAGS; \
     NM="$(NM)"; export NM; \
     RANLIB="$(RANLIB)"; export RANLIB; \
     WINDRES="$(WINDRES)"; export WINDRES; \
***************
*** 10502,10508 ****
     srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \
     libsrcdir="$$s/libstdc++-v3"; \
     rm -f no-such-file || : ; \
!     CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
       $(TARGET_CONFIGARGS) $${srcdiroption}  \
       || exit 1

--- 10502,10508 ----
srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \
libsrcdir="$$s/libstdc++-v3"; \
rm -f no-such-file || : ; \
! CONFIG_SITE=no-such-file LDFLAGS='-pthread -lpthread' $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
|| exit 1


***************
*** 12017,12023 ****
     srcdiroption="--srcdir=$${topdir}/libiberty"; \
     libsrcdir="$$s/libiberty"; \
     rm -f no-such-file || : ; \
!     CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
       $(TARGET_CONFIGARGS) $${srcdiroption}  \
       || exit 1

--- 12017,12023 ----
srcdiroption="--srcdir=$${topdir}/libiberty"; \
libsrcdir="$$s/libiberty"; \
rm -f no-such-file || : ; \
! CONFIG_SITE=no-such-file LDFLAGS='-pthread -lpthread' $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
|| exit 1


***************
*** 12970,12976 ****
     srcdiroption="--srcdir=$${topdir}/libgomp"; \
     libsrcdir="$$s/libgomp"; \
     rm -f no-such-file || : ; \
!     CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
       $(TARGET_CONFIGARGS) $${srcdiroption}  \
       || exit 1

--- 12970,12976 ----
srcdiroption="--srcdir=$${topdir}/libgomp"; \
libsrcdir="$$s/libgomp"; \
rm -f no-such-file || : ; \
! CONFIG_SITE=no-such-file LDFLAGS='-pthread -lpthread' $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
|| exit 1


*** ./fixincludes/Makefile~     Thu Dec 20 14:53:07 2007
--- ./fixincludes/Makefile      Thu Dec 20 14:55:46 2007
***************
*** 103,109 ****
 twoprocess : test-stamp $(AF)

 full-stamp : $(ALLOBJ) $(LIBIBERTY)
!       $(CC) $(CFLAGS) $(LDFLAGS) -o $(FI) $(ALLOBJ) $(LIBIBERTY)
       $(STAMP) $@

 test-stamp : $(TESTOBJ) $(LIBIBERTY)
--- 103,109 ----
 twoprocess : test-stamp $(AF)

full-stamp : $(ALLOBJ) $(LIBIBERTY)
! $(CC) $(CFLAGS) $(LDFLAGS) -pthread -lpthread -o $(FI) $(ALLOBJ) $(LIBIBERTY)
$(STAMP) $@


test-stamp : $(TESTOBJ) $(LIBIBERTY)





Listaccount schrieb:

Zitat von Thomas Mittelstaedt <T.Mittelstaedt@cadenas.de>:



With a lot of ugly fixing in generated Makefile's, I got past stage 3,
but now libstdc++ does not build.
The generated config.h in hppa64-hp-hpux11.11/libstdc++-v3 seems to be
wrong, as there is an fabsf and altera
on my system, at least in the headers.


That's how we succed after some trouble when compiling GCC 4.2.2 on HP-UX 11.11 (PA-RISC) :

export CONFIG_SHELL=/usr/bin/bash
(Installed from OSS Archiv)

export LANG=C
(wird für gcc 4.x wegen awk/sed auf HPUX und AIX benötigt!!)

export CC=<verwendeter Compiler>
We used some gcc 3.4.x in 32/64Bit build

Config/Build für PA-32Bit 4.2.2: ../configure --prefix=/opt/gcc-4.2.2 --mandir=/usr/local/man --with-gnu-as --with-as=/usr/local/bin/gnu-as --without-gnu-ld --with-ld=/usr/ccs/bin/ld --disable-nls --enable-threads=posix --enable-languages=c,c++

Config/Build für PA-64Bit 4.2.2: ../configure --prefix=/opt/gcc64-4.2.2 --mandir=/usr/local/man --with-ar=/usr/bin/ar --with-gnu-as --with-as=/usr/local/bin/gnu64-as --without-gnu-ld --with-ld=/usr/ccs/bin/ld --disable-nls --enable-threads=posix --enable-languages=c,c++

Important is to *not* use the OS "as" but use some GNU-as with the matching 32/64Bit build. For the "ld" you should use the OS "ld", but your system should be on a recent patchlevel. It is useful to have GNU "awk" and "sed" instead of the OS ones.

For all of the used tools you should always double-check if the intentioned one is used by configure.

Regards & good luck

Andreas







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]