CFLAGS only for clang in mixed-compiler project?

Daniel Eischen deischen at
Thu Jan 1 16:36:46 UTC 2015

On Thu, 1 Jan 2015, Lev Serebryakov wrote:

> Hash: SHA512
> I'm trying to update arm-eabi (microcontroller) cross-gcc port to
> latest version 4.9 and have one weird problem.
> Some part of gcc for arm (neon coprocessor machine description, to be
> precise) requires more than 256 nested parenthesis in version 4.9 (4.8
> doesn't have this problem). Due to this parenthesis madness clang
> needs "-fbracket-depth=1024" option. If I add this option to CFLAGS in
> environment variable, I have other problem. Later in build process gcc
> uses newly-built gcc (xgcc) to build library. And this gcc picks up
> "-fbracket-depth=1024" from environment and fails due to unknown option!
> How could I provide options only for clang but not for gcc?

Hmm, I found CFLAGS.clang (or rather CFLAGS.${COMPILER_TYPE})
in /usr/share/mk/, so you might try setting that instead of
just CFLAGS.  Just a guess...


More information about the freebsd-ports mailing list