Request for reviews (XS): 6769748: Fix solaris makefile for the case when "CC -V" produces several lines

John Coomes John.Coomes at sun.com
Mon Nov 10 14:51:32 PST 2008


Vladimir Kozlov (Vladimir.Kozlov at Sun.COM) wrote:
> 
> http://webrev.invokedynamic.info/kvn/6769748/index.html
> 
> Fixed 6769748: Fix solaris makefile for the case when "CC -V" produces several lines
> 
> Problem:
> 5.10 C++ produces several lines with -V:
> % CC -V
> CC: Sun Ceres C++ 5.10 SunOS_i386 2008/07/10
> Usage: CC [ options ] files.  Use 'CC -flags' for details
> 
> Current VM makefile does not handle such case.
> 
> Solution:
> Fix the makefile.

Hi Vladimir,

I discovered that if you invoke CC -V through a link with a different
name, then that different name shows up in the version string.
Example:

	$ ls -l CXX
	lrwxrwxrwx   1 jcoomes  green         37 Nov 10 14:11 CXX -> /export/SS12/bin/CC
	$ ./CXX -V
	CXX: Sun C++ 5.9 SunOS_sparc 2007/05/03

So the 'grep "CC:"' is slightly fragile.  I think it'd be better check
for the string "C++" and to fold the string match into the sed command
like this:

	$(shell $(CPP) -V 2>&1 | sed -n 's/^.*[ 	]C++[ 	]\([1-9]\.[0-9][0-9]*\).*/\1/p')

The -n says don't print anything unless told to and the 'p' at the end
says to print after a match.

FWIW, the message from the cc command *doesn't* change when you use a
link, at least w/5.9 and 5.10.  But if it were me, I'd update the
makefile for cc also (change the "C++" above to "C").

-John




More information about the hotspot-compiler-dev mailing list