svn commit: r257691 - head/gnu/lib/libgcc

Dimitry Andric dim at FreeBSD.org
Tue Nov 5 20:57:37 UTC 2013


On 05 Nov 2013, at 16:45, Luigi Rizzo <rizzo at iet.unipi.it> wrote:
...
> I wonder if it is worthwhile adding to the default rules some
> compiler-specific CFLAGS, say CFLAGS_CLANG and CFLAGS_GCC
> 
> (there is only a handful of cases now so maybe it is overkill,
> and it harms readability; on the other hand, the Makefiles
> already make a lot of assumptions on variable names)
> 
> % find ../head -name Makefile -exec grep -H COMPILER_TYPE \{\} \;
> ../head/gnu/lib/libgcc/Makefile:.if ${COMPILER_TYPE} != "clang" || ${TARGET_CPUARCH} != "arm"
> ../head/gnu/lib/libgcc/Makefile:.if ${COMPILER_TYPE} == "clang"
> ../head/gnu/lib/libsupc++/Makefile:.if ${COMPILER_TYPE} == "clang"
> ../head/gnu/lib/libstdc++/Makefile:.if ${COMPILER_TYPE} == "clang"
> ../head/tools/tools/ath/athstats/Makefile:.if (${COMPILER_TYPE} == "clang")
> ../head/tools/tools/net80211/wlanstats/Makefile:.if ${COMPILER_TYPE} == "clang"

Something like the attached?  We already had NO_WERROR.clang and
NO_WFORMAT.clang, so I added CFLAGS.clang, CXXFLAGS.clang and their
counterparts CFLAGS.gcc and CXXFLAGS.gcc.

The only potential problem is flag ordering, since these are added to
CFLAGS and CXXFLAGS in bsd.sys.mk, so they might appear earlier on the
command line than when you specify them explicitly in individual
Makefiles.

I'm currently running test builds with clang and gcc, and it seems to
run fine until now, but I will probably want to build a full universe
before I commit it...

-Dimitry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-clang-and-gcc-specific-cflags-1.diff
Type: application/octet-stream
Size: 4895 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20131105/10fe81c7/attachment.obj>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20131105/10fe81c7/attachment.sig>


More information about the svn-src-all mailing list