Details
-
Bug
-
Resolution: Fixed
-
P4
-
None
-
None
-
b22
-
other
Description
On alpha and sh, the build fails due to collisions of autoconf definitions with variable names found in the JDK source code. The problem is that autoconf passes the content of VAR_CPU to CFLAGS which means that - on alpha and sh - CFLAGS contain "-Dalpha" and "-Dsh" respectively which results in a naming collision with some JDK source files:
=== Output from failing command(s) repeated here ===
/usr/bin/printf "* For target support_native_java.desktop_libmlib_image_mlib_ImageAffine.o:\n"
* For target support_native_java.desktop_libmlib_image_mlib_ImageAffine.o:
(/bin/grep -v -e "^Note: including file:" < /<<PKGBUILDDIR>>/build/make-support/failure-logs/support_native_java.desktop_libmlib_image_mlib_ImageAffine.o.log || true) | /usr/bin/head -n 12
<command-line>:0:7: error: expected ';', ',' or ')' before numeric constant
/<<PKGBUILDDIR>>/src/jdk/src/java.desktop/share/native/libmlib_image/mlib_image_proto.h:152:50: note: in expansion of macro 'alpha'
const mlib_image *alpha);
^~~~~
<command-line>:0:7: error: expected ';', ',' or ')' before numeric constant
/<<PKGBUILDDIR>>/src/jdk/src/java.desktop/share/native/libmlib_image/mlib_image_proto.h:161:58: note: in expansion of macro 'alpha'
const mlib_image *alpha);
^~~~~
<command-line>:0:7: error: expected ';', ',' or ')' before numeric constant
/<<PKGBUILDDIR>>/src/jdk/src/java.desktop/share/native/libmlib_image/mlib_image_proto.h:170:55: note: in expansion of macro 'alpha'
const mlib_image *alpha);
^~~~~
if test `/usr/bin/wc -l < /<<PKGBUILDDIR>>/build/make-support/failure-logs/support_native_java.desktop_libmlib_image_mlib_ImageAffine.o.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi
... (rest of output omitted)
/usr/bin/printf "\n* All command lines available in /<<PKGBUILDDIR>>/build/make-support/failure-logs.\n"
* All command lines available in /<<PKGBUILDDIR>>/build/make-support/failure-logs.
/usr/bin/printf "=== End of repeated output ===\n"
=== End of repeated output ===
To resolve this, we can just extend the following code from common/autoconf/platform.m4 to redefine OPENJDK_$1_CPU_LEGACY on alpha and sh:
# Also store the legacy naming of the cpu.
# Ie i586 and amd64 instead of x86 and x86_64
OPENJDK_$1_CPU_LEGACY="$OPENJDK_$1_CPU"
if test "x$OPENJDK_$1_CPU" = xx86; then
OPENJDK_$1_CPU_LEGACY="i586"
elif test "x$OPENJDK_$1_OS" != xmacosx && test "x$OPENJDK_$1_CPU" = xx86_64; then
# On all platforms except MacOSX replace x86_64 with amd64.
OPENJDK_$1_CPU_LEGACY="amd64"
fi
=== Output from failing command(s) repeated here ===
/usr/bin/printf "* For target support_native_java.desktop_libmlib_image_mlib_ImageAffine.o:\n"
* For target support_native_java.desktop_libmlib_image_mlib_ImageAffine.o:
(/bin/grep -v -e "^Note: including file:" < /<<PKGBUILDDIR>>/build/make-support/failure-logs/support_native_java.desktop_libmlib_image_mlib_ImageAffine.o.log || true) | /usr/bin/head -n 12
<command-line>:0:7: error: expected ';', ',' or ')' before numeric constant
/<<PKGBUILDDIR>>/src/jdk/src/java.desktop/share/native/libmlib_image/mlib_image_proto.h:152:50: note: in expansion of macro 'alpha'
const mlib_image *alpha);
^~~~~
<command-line>:0:7: error: expected ';', ',' or ')' before numeric constant
/<<PKGBUILDDIR>>/src/jdk/src/java.desktop/share/native/libmlib_image/mlib_image_proto.h:161:58: note: in expansion of macro 'alpha'
const mlib_image *alpha);
^~~~~
<command-line>:0:7: error: expected ';', ',' or ')' before numeric constant
/<<PKGBUILDDIR>>/src/jdk/src/java.desktop/share/native/libmlib_image/mlib_image_proto.h:170:55: note: in expansion of macro 'alpha'
const mlib_image *alpha);
^~~~~
if test `/usr/bin/wc -l < /<<PKGBUILDDIR>>/build/make-support/failure-logs/support_native_java.desktop_libmlib_image_mlib_ImageAffine.o.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi
... (rest of output omitted)
/usr/bin/printf "\n* All command lines available in /<<PKGBUILDDIR>>/build/make-support/failure-logs.\n"
* All command lines available in /<<PKGBUILDDIR>>/build/make-support/failure-logs.
/usr/bin/printf "=== End of repeated output ===\n"
=== End of repeated output ===
To resolve this, we can just extend the following code from common/autoconf/platform.m4 to redefine OPENJDK_$1_CPU_LEGACY on alpha and sh:
# Also store the legacy naming of the cpu.
# Ie i586 and amd64 instead of x86 and x86_64
OPENJDK_$1_CPU_LEGACY="$OPENJDK_$1_CPU"
if test "x$OPENJDK_$1_CPU" = xx86; then
OPENJDK_$1_CPU_LEGACY="i586"
elif test "x$OPENJDK_$1_OS" != xmacosx && test "x$OPENJDK_$1_CPU" = xx86_64; then
# On all platforms except MacOSX replace x86_64 with amd64.
OPENJDK_$1_CPU_LEGACY="amd64"
fi