This is the mail archive of the libstdc++@gcc.gnu.org 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]
Other format: [Raw text]

Re: Unoptimized compilation in src - bug or intentional?


On Tue, Jun 26, 2007 at 06:57:55PM -0700, Brian Dessent wrote:
> Rask Ingemann Lambertsen wrote:
> 
> >    There's no -O2 anywhere when compiling in the src subdirectory. Is that
> > intentional?
> 
> I'm not sure if this applies to your situation, but I have noticed that
> the multilib infrastructure relies on the toplevel Makefile descending
> into each target library to set CFLAGS/CXXFLAGS to the appropriate
> values, thus if you run make directly in a target lib directory instead
> of running it from the toplevel, you get empty CFLAGS and no
> optimization.

   I'm running make from the top level. I configured like this:

/n/12/rask/src/all/configure --target=m32c-unknown-elf --enable-languages=c,c++ --with-newlib --enable-sim --disable-{multilib,nls,gdb}

   The same thing happens in the libsupc++ subdirectory:

libtool: compile:  /home/rask/testbuild/./gcc/xgcc -shared-libgcc -B/home/rask/testbuild/./gcc -nostdinc++ -L/home/rask/testbuild/m32c-unknown-elf/libstdc++-v3/src
-L/home/rask/testbuild/m32c-unknown-elf/libstdc++-v3/src/.libs -nostdinc -B/home/rask/testbuild/m32c-unknown-elf/newlib/ -isystem /home/rask/testbuild/m32c-unknown-elf/newlib/targ-include
-isystem /n/12/rask/src/all/newlib/libc/include -B/usr/local/m32c-unknown-elf/bin/ -B/usr/local/m32c-unknown-elf/lib/ -isystem /usr/local/m32c-unknown-elf/include
-isystem /usr/local/m32c-unknown-elf/sys-include -L/home/rask/testbuild/./ld -B/home/rask/testbuild/m32c-unknown-elf/libgloss/m32c -L/home/rask/testbuild/m32c-unknown-elf/libgloss/m32c
-L/home/rask/testbuild/m32c-unknown-elf/libgloss/libnosys -I/n/12/rask/src/all/libstdc++-v3/../gcc -I/home/rask/testbuild/m32c-unknown-elf/libstdc++-v3/include/m32c-unknown-elf
-I/home/rask/testbuild/m32c-unknown-elf/libstdc++-v3/include -I/n/12/rask/src/all/libstdc++-v3/libsupc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings
-Wcast-qual -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -c /n/12/rask/src/all/libstdc++-v3/libsupc++/eh_throw.cc -o eh_throw.o

   I tried mipsisa64-unknown-elf also. Generally the same result. I
noticed that some files do get an -O2 attached while others don't:

/bin/sh ../libtool --tag CXX --tag disable-shared --mode=compile /home/rask/build/gcc-mipsisa64-unknown-elf/./gcc/xgcc -shared-libgcc -B/home/rask/build/gcc-mipsisa64-unknown-elf/./gcc
-nostdinc++ -L/home/rask/build/gcc-mipsisa64-unknown-elf/mipsisa64-unknown-elf/libstdc++-v3/src -L/home/rask/build/gcc-mipsisa64-unknown-elf/mipsisa64-unknown-elf/libstdc++-v3/src/.libs
-nostdinc -B/home/rask/build/gcc-mipsisa64-unknown-elf/mipsisa64-unknown-elf/newlib/ -isystem /home/rask/build/gcc-mipsisa64-unknown-elf/mipsisa64-unknown-elf/newlib/targ-include
-isystem /n/12/rask/src/all/newlib/libc/include -B/usr/local/mipsisa64-unknown-elf/bin/ -B/usr/local/mipsisa64-unknown-elf/lib/ -isystem /usr/local/mipsisa64-unknown-elf/include
-isystem /usr/local/mipsisa64-unknown-elf/sys-include -L/home/rask/build/gcc-mipsisa64-unknown-elf/./ld -I/n/12/rask/src/all/libstdc++-v3/../gcc
-I/home/rask/build/gcc-mipsisa64-unknown-elf/mipsisa64-unknown-elf/libstdc++-v3/include/mipsisa64-unknown-elf -I/home/rask/build/gcc-mipsisa64-unknown-elf/mipsisa64-unknown-elf/libstdc++-v3/include
-I/n/12/rask/src/all/libstdc++-v3/libsupc++  -fno-implicit-templates  -Wall -Wextra -Wwrite-strings -Wcast-qual  -fdiagnostics-show-location=once  -ffunction-sections -fdata-sections    
-c -o vterminate.lo /n/12/rask/src/all/libstdc++-v3/libsupc++/vterminate.cc

/bin/sh ../libtool --tag CC --tag disable-shared --mode=compile /home/rask/build/gcc-mipsisa64-unknown-elf/./gcc/xgcc -B/home/rask/build/gcc-mipsisa64-unknown-elf/./gcc/
-nostdinc -B/home/rask/build/gcc-mipsisa64-unknown-elf/mipsisa64-unknown-elf/newlib/ -isystem /home/rask/build/gcc-mipsisa64-unknown-elf/mipsisa64-unknown-elf/newlib/targ-include
-isystem /n/12/rask/src/all/newlib/libc/include -B/usr/local/mipsisa64-unknown-elf/bin/ -B/usr/local/mipsisa64-unknown-elf/lib/ -isystem /usr/local/mipsisa64-unknown-elf/include
-isystem /usr/local/mipsisa64-unknown-elf/sys-include -L/home/rask/build/gcc-mipsisa64-unknown-elf/./ld -DHAVE_CONFIG_H -I.. -I/n/12/rask/src/all/libstdc++-v3/../libiberty
-I/n/12/rask/src/all/libstdc++-v3/../include  -I/home/rask/build/gcc-mipsisa64-unknown-elf/mipsisa64-unknown-elf/libstdc++-v3/include/mipsisa64-unknown-elf
-I/home/rask/build/gcc-mipsisa64-unknown-elf/mipsisa64-unknown-elf/libstdc++-v3/include -I/n/12/rask/src/all/libstdc++-v3/libsupc++   
-O2 -g -O2  -DIN_GLIBCPP_V3 -Wno-error -c cp-demangle.c

I.e. no -O2 for C++ files but -O2 for C files.

-- 
Rask Ingemann Lambertsen


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