RFR: 8251365: Build failure on AIX after 8250636
Peter Tribble
peter.tribble at gmail.com
Thu Aug 13 18:49:00 UTC 2020
On Mon, Aug 10, 2020 at 9:27 PM Dmitry Cherepanov <dcherepanov at azul.com>
wrote:
> Please review the fix for build failure on AIX. With this change,
> "tm_gmtoff" is used only if _ALLBSD_SOURCE or _GNU_SOURCE is set. In the
> case of AIX, we'll continue to use "timezone".
>
> I'll start jdk-submit testing for this change shortly, unfortunately I do
> not have an AIX machine at hand and would appreciate if someone (with
> access to AIX) could verify that the change fixes AIX build . Thanks in
> advance.
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8251365
> Webrev: http://cr.openjdk.java.net/~dcherepanov/8251365/webrev.v1/
>
Apologies for butting in at this late stage, but this doesn't look quite
right.
It still breaks on illumos/Solaris (not supported, but I'm continuing with
an external
gcc-based port).
The reason is that guarding with _GNU_SOURCE isn't the correct
discriminant. I think this
is set up in this block of make/autoconf/flags-cflags.m4
#### TOOLCHAIN DEFINES
if test "x$TOOLCHAIN_TYPE" = xgcc; then
ALWAYS_DEFINES_JVM="-D_GNU_SOURCE -D_REENTRANT"
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
ALWAYS_DEFINES_JVM="-D_GNU_SOURCE"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
ALWAYS_DEFINES_JVM="-D_REENTRANT"
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE
-DSTDC"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE \
-D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -DIAL"
ALWAYS_DEFINES_JVM="-DNOMINMAX -DWIN32_LEAN_AND_MEAN"
fi
In other words, you get _GNU_SOURCE defined if you're using gcc or clang;
the fix
works on AIX by accident, as a side-effect of using the xlc toolchain there.
I'll work out a way of patching it for my own work, but it may be worth
looking at a
proper fix.
Thanks,
--
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
More information about the hotspot-runtime-dev
mailing list