How to bootstrap GCC with custom flags for libcc1?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

>From this website[0], to bootstrap GCC with custom flags, one has to set
BOOT_CFLAGS and CFLAGS_FOR_TARGET. However, this is not sufficient. For
example, I have to set CPPFLAGS_FOR_TARGET to add custom flags for c++
target libraries. However, it seems that libcc1 neither honor
BOOT_CFLAGS, CFLAGS_FOR_TARGET nor CPPFLAGS_FOR_TARGET. What environment
variable should I set to add custom flags when building it?

I am building GCC 7.3.0 with Guix on Debian 10. I want to add these flags:
'-mindirect-branch=thunk -mfunction-return=thunk -mindirect-branch-register'.
The build log is in the attachment. Thank you.


A good line looks like this:

/tmp/guix-build-gcc-7.3.0.drv-0/build/./gcc/xgcc -B/tmp/guix-build-gcc-7.3.0.drv-0/build/./gcc/ -B/gnu/store/fy4zdrsy6li4977a8dlkhg46yqjn51fi-gcc-7.3.0/x86_64-unknown-linux-gnu/bin/ -B/gnu/store/fy4zdrsy6li4977a8dlkhg46yqjn51fi-gcc-7.3.0/x86_64-unknown-linux-gnu/lib/ -isystem /gnu/store/fy4zdrsy6li4977a8dlkhg46yqjn51fi-gcc-7.3.0/x86_64-unknown-linux-gnu/include -isystem /gnu/store/fy4zdrsy6li4977a8dlkhg46yqjn51fi-gcc-7.3.0/x86_64-unknown-linux-gnu/sys-include    -mindirect-branch=thunk -mfunction-return=thunk -mindirect-branch-register -O2  -mindirect-branch=thunk -mfunction-return=thunk -mindirect-branch-register -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I../../../gcc-7.3.0/libgcc -I../../../gcc-7.3.0/libgcc/. -I../../../gcc-7.3.0/libgcc/../gcc -I../../../gcc-7.3.0/libgcc/../include -I../../../gcc-7.3.0/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS  -DUSE_TLS -o _gcov_merge_add.o -MT _gcov_merge_add.o -MD -MP -MF _gcov_merge_add.dep -DL_gcov_merge_add -c ../../../gcc-7.3.0/libgcc/libgcov-merge.c


A problematic line looks like this:

/gnu/store/kpxi8h3669afr9r1bgvaf9ij3y4wdyyn-bash-minimal-4.4.12/bin/bash ./libtool --tag=CXX   --mode=compile /tmp/guix-build-gcc-7.3.0.drv-0/build/./gcc/xg++ -B/tmp/guix-build-gcc-7.3.0.drv-0/build/./gcc/ -nostdinc++ `if test -f /tmp/guix-build-gcc-7.3.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/scripts/testsuite_flags; then /gnu/store/kpxi8h3669afr9r1bgvaf9ij3y4wdyyn-bash-minimal-4.4.12/bin/bash /tmp/guix-build-gcc-7.3.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L/tmp/guix-build-gcc-7.3.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src -L/tmp/guix-build-gcc-7.3.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/tmp/guix-build-gcc-7.3.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -B/tmp/guix-build-gcc-7.3.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/tmp/guix-build-gcc-7.3.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -B/gnu/store/fy4zdrsy6li4977a8dlkhg46yqjn51fi-gcc-7.3.0/x86_64-unknown-linux-gnu/bin/ -B/gnu/store/fy4zdrsy6li4977a8dlkhg46yqjn51fi-gcc-7.3.0/x86_64-unknown-linux-gnu/lib/ -isystem /gnu/store/fy4zdrsy6li4977a8dlkhg46yqjn51fi-gcc-7.3.0/x86_64-unknown-linux-gnu/include -isystem /gnu/store/fy4zdrsy6li4977a8dlkhg46yqjn51fi-gcc-7.3.0/x86_64-unknown-linux-gnu/sys-include    -DHAVE_CONFIG_H -I. -I../../gcc-7.3.0/libcc1  -I ../../gcc-7.3.0/libcc1/../include -I ../../gcc-7.3.0/libcc1/../libgcc -I ../gcc -I../../gcc-7.3.0/libcc1/../gcc    -W -Wall  -fvisibility=hidden -g -O2 -D_GNU_SOURCE -MT findcomp.lo -MD -MP -MF .deps/findcomp.Tpo -c -o findcomp.lo ../../gcc-7.3.0/libcc1/findcomp.cc


[0]: https://gcc.gnu.org/install/build.html

Cheers,
Alex




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux