Use of CC_COMPILE and CXX_COMPILE

David Holmes david.holmes at oracle.com
Thu Jul 18 04:08:59 PDT 2013


On 18/07/2013 12:20 AM, Andrew Hughes wrote:
> In the Solaris, *BSD and GNU/Linux makefiles, it states:
>
> "# $(CC) is the c compiler (cc/gcc), $(CXX) is the c++ compiler (CC/g++)."
>
> (make/{solaris,bsd,linux}/makefiles/rules.make)
>
> However, both CC_COMPILE and CXX_COMPILE are then defined in the same way.
>
> CC_COMPILE       = $(CC) $(CXXFLAGS) $(CFLAGS)
> CXX_COMPILE      = $(CXX) $(CXXFLAGS) $(CFLAGS)
>
> Shouldn't CXXFLAGS only be added to CXX_COMPILE and not CC_COMPILE?
>
> It also appears that C++ flags are being added to $(CFLAGS):

It is a mess and the mess was compounded by a variable renaming that, it 
seems, confused CPP with C++ when it looks like it meant the C preprocessor.

There are very few actual C compiles, as opposed to C++, and those tend 
to redefine the compile command as has been noted by others.

David
-----

> make/solaris/makefiles/gcc.make:CFLAGS += -fcheck-new
> make/bsd/makefiles/gcc.make:CFLAGS += -fcheck-new
> make/linux/makefiles/gcc.make:CFLAGS += -fcheck-new
>
> We hit this when trying to build some C code (mkbc.c for our ARM32 port)
> using $(CC_COMPILE).  Has $(CC_COMPILE) ever been used with C code?
> Is there any in HotSpot itself?
>
> Thanks,
>


More information about the hotspot-dev mailing list