This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

some notes on installation with "-fnew-abi -fhonor-std"


Compiling libstdc++v3 with the new recommended options "-fnew-abi
-fhonor-std" has its problems. For others also trying this, 
I would like to tell how I worked around them, 
and point them out so someone might decide to fix them. 
(this is also probably well known, but not in the docs )

So what's the point ...:

A)libstdc++v3 needs a working libstdc++ to compile (not very wise):
    a)To finish the configure script (test for working c++) probably the
        reason is b)
    b)Inside the mknumeric_limits script a complete g++ is called. Using
        g++ -nostdinc++ and a linkstep without -lstdc++ would work.
B)in src/Makefile CXXFLAGS is defined; 
    so with CXXFLAGS=... configure...
    the CXXFLAGS specified will not reach into src/ .
    
---------here comes the mini mini howto
[This is with i686-pc-linux-gnu, bash, ...] 
A) egcs: [snapshot 19990517 works well]
First we will need a working egcs with its libstdc++v2:

[note: compiling egcs with "-fnew-abi -fno-honor-std" 
  and libstdc++v3 with "-fnew-abi -fhonor-std" does not work]

do the standard procedure:

>$EGCSSRC_/configure \
 --prefix=$INSTDIR_1_ --enable-shared --with-gnu-as --with-gnu-ld
>make bootstrap # or simply make if you trust your installed gcc
>make install

make it the new default compiler:

>export PATH=$INSTDIR_1_/bin:$PATH
>export LD_LIBRARY_PATH=$INSTDIR_1_/lib:$LD_LIBRARY_PATH

now we need a libgcc compiled with "-fnew-abi -fhonor-std". 
Easiest (but not fast) is to compile the whole egcs, 
but the old libstdc++v2 will not compile with
"-fhonor-std" so remove it from the sourcedir:

>rm -rf $EGCSSRC_/libstdc++

clear your build directory and do the standard procedure (mind the new
install directory)

>CFLAGS='-fnew-abi -fhonor-std' CXXFLAGS='-fnew-abi -fhonor-std' \
 $EGCSSRC_/configure \
 --prefix=$INSTDIR_2_ --enable-shared --with-gnu-as --with-gnu-ld
>make 
>make install

B)libstdc++: [I used the 1999-05-21 cvs, 
  snapshot 6 is probably the same]

clear your build directory and do

>CFLAGS='-fnew-abi -fhonor-std' CXXFLAGS='-fnew-abi -fhonor-std' \
 $LIBSRC_/configure --prefix=$INSTDIR_3_

in the build directory edit the src/Makefile:
change: "CXXFLAGS = -g -D_GNU_SOURCE -fno-implicit-templates"
into: "CXXFLAGS = -fnew-abi -fhonor-std -g -D_GNU_SOURCE
-fno-implicit-templates"

>make
>make install

get the new libgcc from $INSTDIR_2_ [dependent on your system and egcs
version]:

>cp $INSTDIR_2_/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.93.22/libgcc.a \
 $INSTDIR_3_/lib

you no longer need $INSTDIR_2_.

to use the new library:

>export PATH=$INSTDIR_1_/bin:$PATH 
>export LD_LIBRARY_PATH=$INSTDIR_3_/lib:$LD_LIBRARY_PATH
and compile with -I$INSTDIR_3_/include/g++-v3 -L$INSTDIR_3_/lib
-fnew-abi -fhonor-std 
----------

Alfred


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