egcs-980221: build fails for shared libstdc++ on HP-UX 10.20

Manfred Hollstein manfred@s-direktnet.de
Wed Feb 25 10:39:00 GMT 1998


On Wed, 25 February 1998, 02:09:45, law@hurl.cygnus.com wrote:

 > 
 >   In message < 34F2AECF.5825@mltsa.uk.lucent.com >you write:
 >   > Dear EGCS Maintainers,
 >   > 
 >   >     For the last few snapshots, I have not been able to build
 >   >     egcs on HP-UX 10.20, with the build failing for a shared
 >   >     version of libstdc++. I've held off from reporting this,
 >   >     expecting many other similar bug reports to have been sent
 >   >     in by others. Since this does not appear to be happening,
 >   >     here goes ...
 >   >     
 >   >     Config.status is:
 >   >     
 >   >         ./configure --host=hppa1.1-hp-hpux10.20 \
 >   >                 --prefix=/apps/gcc/egcs1.0 --with-gnu-as \
 >   >                 --enable-shared --norecursion
 >   >     
 >   >     'GNU as' used is v2.8.1, 'GNU sed' used is v2.05.
 >   >     
 >   >     After configuring, I manually edit gcc/Makefile to set the
 >   >     LANGUAGES to 'c gcov c++' (although I could pass LANGUAGES
 >   >     in on the 'make bootstrap' command line).
 >   >     
 >   >     After building stage1, stage2 and stage3 (?) of the compilers,
 >   >     the build fails during the libraries:
 >   > 
 >   >         mv tlist stdlist
 >   >         rm -f tlibstdc++.a
 >   >         ar rc tlibstdc++.a `cat stdlist`
 >   >         mv tlibstdc++.a libstdc++.a
 >   >         true libstdc++.a
 >   >         rm -f tlist
 >   >         cp stdlist tlist
 >   >         if [ x"yes" = xyes ]; then \
 >   >           sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
 >   >           mv tlist2 tlist ; \
 >   >         else true ; fi
 >   >         mv tlist piclist
 >   >         /home/gnusrc/egcs-980221-hpux10/gcc/xgcc
 >   > -B/home/gnusrc/egcs-980221-hpux10/gcc/ -g -O2 -fno-implicit-templates 
 >   > -shared -o libstdc++.sl `cat piclist` 
 > Hmm, this line is missing a -fPIC.
 > 
 > I suspect this is probably a side effect of Manfred's recent
 > reorganization of the PIC support.

Perhaps this might be the reason :-(

 > 
 > Manfred -- can you take a look at how to fix this problem?  I think
 > we have systems that absolutely must have the -fPIC and others which
 > absolutely must not have the -fPIC on the command line to actually
 > create the shared library.

Well, I believe the  patch doesn't actually  change this;  the PICFLAG
macros from the toplevel-dir/config/m[ht]-*pic  files will be  emitted
into  every generated  Makefile, right?!  Since mh-papic and  mt-papic
contain definitions for PICFLAG  and PICFLAG_FOR_TARGET they should be
in every generated Makefile as well.

I  really suspect, `make distclean' does   _not_ clean everything that
should be removed.

This guy particulary is  building  in the srcdir:

 >   >     Config.status is:
 >   >     
 >   >         ./configure --host=hppa1.1-hp-hpux10.20 \

I've seen  similar problems  from another  user   on SunOS  which were
caused by exactly these circumstances. I  advised him to use `distinct
directories as srcdir and for building', which cured his problem.

 > 
 > The -fPIC used to get added via the SHFLAGS definition in the
 > libstdc++/config/hpux.ml file.
 > 
 > It looks like sunos4 might also be suffering from this problem.

See above. I  strongly believe the  problem is in `make distclean'  or
people are configuring, building,  installing, updating via CVS all in
one directory. This doesn't work.

Please, really cleanup your source directories:

 $ make distclean
 $ find . -name config.cache -o -name config.log -o -name config.status \
     -o -name Makefile -exec rm -f {} \;

and then _always_ build in a separate directory (as recommended in one
of the INSTALL files)!

Manfred



More information about the Gcc-bugs mailing list