What's up with CXXFLAGS_FOR_BUILD?
Robert Dubner
rdubner@symas.com
Fri Jul 4 20:51:44 GMT 2025
> -----Original Message-----
> From: Eric Botcazou <ebotcazou@libertysurf.fr>
> Sent: Friday, July 4, 2025 04:11
> To: Robert Dubner <rdubner@symas.com>
> Cc: gcc@gcc.gnu.org
> Subject: Re: What's up with CXXFLAGS_FOR_BUILD?
>
> > This raises two, presumably related, questions.
> >
> > 1) What is CXXFLAGS_FOR_BUILD supposed to be doing?
>
> Set CXXFLAGS when you're compiling something for the build platform.
>
> > 2) How can I set compilation switches for gcc stuff (like the
gcc/cobol
> > front end) without affecting lib*** stuff?
>
> In this case you're compiling something for the host platform and
CXXFLAGS
> is
> the appropriate variable.
And therein lies the rub.
With the COBOL front end, we recently hit a situation where we
inadvertently used a C++17 feature that resulted in a compilation failure
using GCC-9.
So, I want to be able to set "-std=c++14" when compiling the COBOL front
end.
But when I set CXXFLAGS="-std=c++14", that causes the compilation of
libcody to fail. It insists on the standard being exactly C++11.
I suppose the proper question is, "How do I set compilation flags for just
the gcc/cobol front end compilation?"
Best regards, and thanks very much for getting back to me on this...
Bob Dubner
>
> You need to pass the various FLAGS on the 'make' command line instead of
> the
> 'configure' command line.
>
> --
> Eric Botcazou
>
More information about the Gcc
mailing list