8039426: gcc can target wrong instruction set when building JDK native code
authorerikj
Tue, 12 May 2015 09:08:03 +0200
changeset 30418 aa3cd6848aa0
parent 30417 581a2762eef1
child 30419 8fb7370e2d33
8039426: gcc can target wrong instruction set when building JDK native code Reviewed-by: ihse, dholmes
common/autoconf/flags.m4
common/autoconf/generated-configure.sh
--- a/common/autoconf/flags.m4	Mon May 11 13:45:39 2015 +0200
+++ b/common/autoconf/flags.m4	Tue May 12 09:08:03 2015 +0200
@@ -523,6 +523,10 @@
   #    CXXFLAGS_JDK  - C++ Compiler flags
   #    COMMON_CCXXFLAGS_JDK - common to C and C++
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
+    if test "x$OPENJDK_TARGET_CPU" = xx86; then
+      # Force compatibility with i586 on 32 bit intel platforms.
+      COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
+    fi
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
         -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
     case $OPENJDK_TARGET_CPU_ARCH in
--- a/common/autoconf/generated-configure.sh	Mon May 11 13:45:39 2015 +0200
+++ b/common/autoconf/generated-configure.sh	Tue May 12 09:08:03 2015 +0200
@@ -4366,7 +4366,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1431344623
+DATE_WHEN_GENERATED=1431414369
 
 ###############################################################################
 #
@@ -42035,6 +42035,10 @@
   #    CXXFLAGS_JDK  - C++ Compiler flags
   #    COMMON_CCXXFLAGS_JDK - common to C and C++
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
+    if test "x$OPENJDK_TARGET_CPU" = xx86; then
+      # Force compatibility with i586 on 32 bit intel platforms.
+      COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
+    fi
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
         -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
     case $OPENJDK_TARGET_CPU_ARCH in