http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53891

             Bug #: 53891
           Summary: CFLAGS set in configure don't propagate
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: other
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: ji...@gmx.net


In a standard autotooled application it is only necessary to set CFLAGS on the
./configure command or in the environment. In gcc this is not enough, and at
least BOOT_CFLAGS needs to be set on the make command line. For example the
following is not enough:

$ CFL="-O0 -g3 -fno-inline -march=i586"
$ export -p | grep FLAG
declare -x BOOT_CFLAGS="-O0 -g3 -fno-inline -march=i586"
declare -x BOOT_CXXFLAGS="-O0 -g3 -fno-inline -march=i586"
declare -x CFLAGS="-O0 -g3 -fno-inline -march=i586"
declare -x CXXFLAGS="-O0 -g3 -fno-inline -march=i586"
$ ~/path/to/gcc/configure --prefix=`pwd` --enable-checking=release
--disable-multilib --disable-plugins --enable-languages=c,c++ CFLAGS="$CFL"
BOOT_CFLAGS="$CFL" CXXFLAGS="$CFL" BOOT_CXXFLAGS="$CFL"
$ make

And I need this to actually get a final gcc compiled with my flags:

$ make BOOT_CFLAGS="$CFL" BOOT_CXXFLAGS="$CFL"


I think we should require setting the flags only on ./configure, and it would
also be nice if CFLAGS propagated aumatically to CXXFLAGS.

Reply via email to