[RFR] JDK-8156980: Hotspot build doesn't have -std=gnu++98 gcc option

Kim Barrett kim.barrett at oracle.com
Tue Jul 5 15:44:46 UTC 2016


> On Jul 5, 2016, at 11:22 AM, Andrew Hughes <gnu.andrew at redhat.com> wrote:
> 
> ----- Original Message -----
>> Hello,
>> 
>> In general it looks good. It's nice to see that this also fixes that
>> warning output from configure. My only nit is the comment describing the
>> parameters for FLAGS_SETUP_GCC6_COMPILER_FLAGS. It indicates that it
>> takes named parameters while it actually just takes positional. Please
>> either change it to named parameters or fix the comment.
>> 
> 
> Ah, that's because it was named parameters for a while, then I changed it
> because it was easier than trying to get ARG_PREFIX instead of $1 into
> [$]$1CFLAGS_JDK and friends.
> 
> Fixed in:
> 
> http://cr.openjdk.java.net/~andrew/8156980/webrev.02/
> 
> I'll let someone on your side push it through so you can regenerate
> your internal configure script at the same time.

I've also been looking at this area.  It looks like we've found pretty
much the same set of problems and have similar solutions, so that's
good.  I have a few suggestions or possible improvements.

------------------------------------------------------------------------------
common/autoconf/flags.m4
 716     $2JVM_CFLAGS="${$2JVM_CFLAGS} ${$2CXXSTD_CXXFLAG}"

There is a pre-existing bug in the setup of ${$2CXXSTD_CXXFLAG}.  It
is using FLAGS_CXX_COMPILER_CHECK_ARGUMENTS, which doesn't know about
the BUILD/TARGET distinction.

Note that this also doesn't seem to affect some non-VM chunks of code,
such as adlc (in hotspot/src/share/vm/adlc).  I don't know whether
that matters.

------------------------------------------------------------------------------ 
common/autoconf/flags.m4
 771     if test "x$1" = xTARGET; then
 772       TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS
 773     else
 774       TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS(BUILD_,$2)
 775     fi

This is a fix for
https://bugs.openjdk.java.net/browse/JDK-8157358
Syntax error in TOOLCHAIN_CHECK_COMPILER_VERSION

I think the change I suggested in that CR is better.

------------------------------------------------------------------------------ 
common/autoconf/flags.m4  
1458 AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],

Changing from AC_DEFUN_ONCE to AC_DEFUN is good.

It's needed in order to pass in the prefix.  Even ignoring that issue,
something needed to be done because the defun_once defined later was
not being expanded where used.

------------------------------------------------------------------------------  
common/autoconf/flags.m4  
1470   $1CFLAGS_JDK="[$]$1CFLAGS_JDK ${NO_NULL_POINTER_CHECK_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
1471   $1JVM_CFLAGS="[$]$1JVM_CFLAGS ${NO_NULL_POINTER_CHECK_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"

Adding the prefix to the CFLAGS variables is good.

Since we've already determined we're using gcc6+ to get here, I don't 
think there's any benefit to the pre-existing argument checks.

More importantly, FLAGS_COMPILER_CHECK_ARGUMENTS doesn't account for
the BUILD / TARGET distinction, so may produce the wrong answer if the
build and target compilers are different versions of gcc.

So I think those checks should be eliminated.

Also, I think the variables capturing the options probably also need
to be prefixed, if they are retained.

Aside: I also think the variable name for
-fno-delete-null-pointer-checks is mildly confusing, as the absence of
"DELETE" inverts the apparent meaning.

------------------------------------------------------------------------------ 
common/autoconf/spec.gmk
[removed]
 395 NO_NULL_POINTER_CHECK_FLAG=@NO_NULL_POINTER_CHECK_CFLAG@
 396 NO_LIFETIME_DSE_CFLAG=@NO_LIFETIME_DSE_CFLAG@
 397 CXXSTD_CXXFLAG=@CXXSTD_CXXFLAG@

These removals are good. This also eliminates the "FLAG" for "CFLAG"
typo in NO_NULL_POINTER_CHECK_FLAG=.

------------------------------------------------------------------------------




More information about the build-dev mailing list