This is the mail archive of the 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]


The g++ flag sommelier recommended some exciting flags to me, and I
thought I'd share them with this group.

They are:

enable namespaces (ie std::)

enable new, table-driven exception model on hosts that support it
(x86/powerpc ELF targets)

enable compressed mangling schemes

enable efficient vtable generation
(is already the default on x86/linux)

-fvtable-gc -ffunction-sections
enables putting functions into individual sections, so that the
linking process can be optimized. This is an automatic way to do what
the string*.o instantiation files are doing manually right now.
(ELF targets using binutils-2.9.4)

To use these flags, some twisting and contortions may be necessary. For
those with an adventurous palette, please read on.

Step 1: Figure out which of the new varietals CXXFLAGS is going to
include, and stick with it. These actually work right now: 
CXXFLAGS="-fhonor-std -fsquangle"

Step 2: Rebuild libstdc++-v3 with the new flags.
This should be automated, and easier to do, but it is not.

a) mkcheck
Change line 62

# gcc compiler flags


CXX_FLAG="-fsquangle -fhonor-std -g -O2 -DDEBUG_ASSERT "

b) src/
Change line 46




c) src/
Change line 8

CXXFLAGS = -g -D_GNU_SOURCE -fno-implicit-templates 


CXXFLAGS = -g -D_GNU_SOURCE -fno-implicit-templates \
	   -fsquangle -fhonor-std 

d) go to the top level of the source directory and run automake

e) go to a new build directory, and configure/build libstdc++

Step 3: Rebuild libgcc.a

1) go into the build directory of your compiler, say


2) rm libgcc2.*
   rm libgcc.*

3) make libgcc2.a TARGET_LIBGCC2_CFLAGS="-fsquangle -fhonor-std"

4) make libgcc.a

5) cp this new libgcc.a into your EXE_PREFIX_DIRECTORY, and rename the old one.
For me, this means that 


now has:

lrwxrwxrwx   1 bkoz     bkoz           12 Jul 28 14:52 libgcc.a ->
-rw-rw-r--   1 bkoz     bkoz       734588 Jul 28 14:51
-rw-r--r--   1 bkoz     bkoz       772410 Jul 27 23:05 libgcc.a.old

Step 4: Now, try to use. . ..weeee!

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