RFR: JDK-8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erik.joelsson at oracle.com
Wed Feb 3 12:48:00 UTC 2016
Please review this small fix for building on Solaris using a
devkit/sysroot. The Solaris Studio compiler does special inlining and
intrinsics with system calls, like memcpy. The problem is that it only
seems to do this if it finds the definition of the system call in a
header file in the /usr/include directory. See bug description and
comments for details.
I have found a way to work around this. Internally, the compiler adds
the option -I-xbuiltin to mark the start of the system header includes
when calling a sub process. By adding this to our SYSROOT_CFLAGS, the
special inlining is re-enabled.
diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
@@ -80,8 +80,9 @@
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
# Solaris Studio does not have a concept of sysroot. Instead
# make sure the default include and lib dirs are appended to each
- # compile and link command line.
+ # compile and link command line. Must also add -I-xbuiltin to
+ # inlining of system functions and intrinsics.
+ $1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include"
More information about the build-dev