Alex Vong <alexvong1995@xxxxxxxxx> writes: > Alex Vong <alexvong1995@xxxxxxxxx> writes: > >> Alex Vong <alexvong1995@xxxxxxxxx> writes: >> >> [...] >>> >>> 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. >>> >> [...] >> >> Turns out the log is too large to be attached, so I put it here: >> >> https://notabug.org/alexvong1995/logs/src/master/gcc/dl4kjm4148xrk4zh6r3fx87yj2kg6w-gcc-7.3.0.drv > > I understand the problem now. I mistype CXXFLAGS as CPPFLAGS. I will try > if this resolves the problem. Yes, it does. So setting BOOT_CFLAGS, CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET covers everything.