Mix of CFLAGS and CXXFLAGS

Diego 'Flameeyes' Pettenò flameeyes at gmail.com
Wed May 9 15:42:27 UTC 2007


(I've submitted this on bugs.sun.com originally, not sure how to report
the problem, but probably here is more appropriate.)

I've been trying to build OpenJDK with Gentoo's ebuild, and I found a
little flaw in the hotspot build system. My CFLAGS and CXXFLAGS
variables are set in different ways, as I usually want to enable a few
more warnings on C code; this causes the build process to spit these
warnings:

     [exec] cc1plus: warning: command line option "-Wno-pointer-sign"
is valid for C/ObjC but not for C++
     [exec] cc1plus: warning: command line option
"-Wno-format-zero-length" is valid for C/ObjC but not for C++ 

The problem seems to be in
openjdk/hotspot/build/linux/makefiles/rules.make: the rule to compile
C++ source code uses CFLAGS exactly as the C source code compile.

I've been working on a tentative patch (attached) that tries to make
sure that CFLAGS and CXXFLAGS are differentiated, by moving the
defines to CPPFLAGS, by adding the C++-only options only to CXXFLAGS,
and by duplicating the flags that re common.

Unfortunately as it is it doesn't work, as CPPFLAGS is reset and
ignored, probably because of CPPFLAGS being set somewhere in the
process, not sure where yet (I would have bet on vm.make, but changing
that to += didn't help.

-- 
Diego "Flameeyes" Pettenò
http://farragut.flameeyes.is-a-geek.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openjdk-cxxflags.patch
Type: text/x-patch
Size: 6317 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/build-dev/attachments/20070509/a9bad5f2/openjdk-cxxflags.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/build-dev/attachments/20070509/a9bad5f2/signature.asc>


More information about the build-dev mailing list