Re: Build OpenJDK 8 on MacOS Mojave (10.14.3)

2019-03-21 Thread Andrew John Hughes
On 21/03/2019 15:49, Erik Joelsson wrote:
> I don't think anyone has tried. Just removing the check in configure
> should be simple enough, but I suspect there will be lots of follow-on
> issues.
> 
> /Erik
> 
> On 2019-03-21 03:05, Langer, Christoph wrote:
>> Hi,
>>
>> the Mac experts will probably find my question to be silly and start
>> laughing… but nevertheless, I’m asking it here 😊
>>
>> I was looking into building OpenJDK 8 today on my developer Mac, which
>> runs Mojave (10.14.3). configure immediately tells me, I need Xcode 4.
>> So I was trying to install xcode 4.6.3 – but seems this wouldn’t run
>> on Mojave. What can I do?
>>
>> Ok, on the build requirements page [0], the requirements are
>> documented to be MacOS 10.7 (Lion). However, I’m thinking, since
>> OpenJDK 8 is not completely legacy yet, at least a developer build
>> should be possible on a current operating system. I would accept
>> having to install the oldest running Xcode compiler for sure, but not
>> at all being able to build on a recent MacOS is not good.
>>
>> So, question to the experts: Will it be impossible to bump the build
>> environment because changes would be too complex? Or is there a
>> solution to this which I’m just not aware of?
>>
>> Thank you and Best regards
>> Christoph
>>
>> [0] https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms
>>

Yes, I generally think such version checks are a bad idea, as they only
serve to hide the real errors.

What are the versions of LLVM & clang on Mojave? We may be able to look
at some issues on Linux with the same compiler.

Thanks,
-- 
Andrew :)

Senior Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222
https://keybase.io/gnu_andrew



Re: Fail to make images when enable ASan for OpenJDK X86 with LLVM toolchain

2019-03-21 Thread Leslie Zhai

Hi Erik,


在 2019年03月20日 00:51, Erik Joelsson 写道:

Hello Leslie,

The failure you see is happening when the newly built exploded image 
is used for the first time. I'm not familiar with ASAN, but it seems 
that the JDK you create does not quite work. There are some ways 
around this.


Indeed.  Stack alignment issue:

# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/os_linux_x86.cpp:818
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error 
(/home/xiangzhai/project/jdk/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp:818), 
pid=21908, tid=21909
#  assert(((intptr_t)os::current_stack_pointer() & 
(StackAlignmentInBytes-1)) == 0) failed: incorrect stack alignment

#
# JRE version:  (13.0) (fastdebug build )
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 
13-internal+0-adhoc.xiangzhai.jdk, mixed mode, tiered, compressed oops, 
g1 gc, linux-amd64)

# Problematic frame:
# V  [libjvm.so+0x120e3a5]  os::verify_stack_alignment()+0x15
- 8<  8<  8<  8<  8<  8< ---

Martin filed the bug[1].  It also effect jdk12-mips64el.  But jdk8u is 
able to work compiled with clang-8[2].


[1] https://bugs.openjdk.java.net/browse/JDK-8186780
[2] 
https://mail.openjdk.java.net/pipermail/jdk8u-dev/2018-September/007890.html 






If you are unfamiliar with the exploded image, it's something we 
create while building everything (classes, libraries etc) that can run 
directly, but will not be as performant as the real jlinked image that 
the "images" target creates. Normally you build this with "make 
exploded-image" or "make jdk", but this includes the optimization step 
that is failing for you. To build just the exploded image and skip the 
optimization step, you can run "make exploded-image-base". In the 
build output you find the exploded image in 
build/linux-x86_64-server-fastdebug/jdk.  After your failure, you 
should be able to investigate this image by running things directly in 
it. From there you should be able to see if there is a problem with 
the binaries you built.


Another thing that could help you (perhaps not right now since it 
fails too early, but in general when you add special instrumentation 
to the build) is to first build a normal JDK. Then when you configure 
your special build, add --with-build-jdk=/path/to/normal/image. The 
"build-jdk" must exactly match the sources of the special build you 
are building and will be used for running all the jmod/jlink etc steps 
in the build instead of your special JDK build.


/Erik

On 2019-03-19 08:33, Leslie Zhai wrote:

Hi,

I want to run dynamic analysis test with the help of Address 
Sanitizer.  And I read the blog 'Running Java with 
AddressSanitizer'[1]  wrote by Artem who also added support for 
ASan[2].  Thanks for his great job!


But I failed to make images for X86:

Compiling 4 files for BUILD_JIGSAW_TOOLS
ERROR: Invalid value for bool option: '0"'
ERROR: Flag parsing failed.
ExplodedImageOptimize.gmk:39: recipe for target 
'/home/xiangzhai/project/jdk/build/linux-x86_64-server-fastdebug/jdk/_optimize_image_exec.marker' 
failed
gmake[3]: *** 
[/home/xiangzhai/project/jdk/build/linux-x86_64-server-fastdebug/jdk/_optimize_image_exec.marker] 
Error 1

make/Main.gmk:372: recipe for target 'exploded-image-optimize' failed
gmake[2]: *** [exploded-image-optimize] Error 1

ERROR: Build failed for target 'images' in configuration 
'linux-x86_64-server-fastdebug' (exit code 2)

Stopping sjavac server

=== Output from failing command(s) repeated here ===
* For target jdk__optimize_image_exec:
ERROR: Invalid value for bool option: '0"'
ERROR: Flag parsing failed.

- 8<  8<  8<  8<  8<  8< ---

jdk__optimize_image_exec.cmdline[3], 
jdk__optimize_image_exec.log[4],  and dynamic analysis report[5] by 
running the cmdline.


using configure arguments '--with-toolchain-type=clang 
--disable-warnings-as-errors --enable-asan 
--with-boot-jdk=/home/xiangzhai/jdk-11.0.2 --with-debug-level=fastdebug'


- 8<  8<  8<  8<  8<  8< ---

And I also make images with extra CFLAGS, CXXFLAGS and LDFLAGS to 
enable TSan for mips64el with LLVM toolchain especially integrated 
assembler:


sh configure --with-toolchain-type=clang \
  --disable-warnings-as-errors \
--with-boot-jdk=/home/loongson/zhaixiang/jdk-mips-f21-build-server-release-072 
\

  --with-debug-level=fastdebug \
  --with-extra-cflags="-fintegrated-as -fsanitize=thread" \
  --with-extra-cxxflags="-fintegrated-as -fsanitize=thread" \
  --with-extra-ldflags="-fsanitize=thread"

Although successfully built libjvm.so,  it means make hotspot works,  
failed to bootstrap near the end of make images.


So workaround might be make images at first without ASan nor TSan, 
then make hotspot with ASan or TSan?


Thanks,

Leslie Zhai

[1] 
https://blog.gypsyengineer.com/en/security/running-java-with-addresssanitize

RFR: JDK-8221179: Zero builds fail when linking with gold and bundling libffi.so

2019-03-21 Thread Erik Joelsson
This patch adds a missing RPATH to libjvm.so which is needed when 
bundling libffi.so for zero builds. The rpath is only added when 
building zero and bundling of libffi is enabled. When linking with bfd 
(the old binutils linker), it seems that the rpath of the library that 
loaded libjvm.so (libjli.so) is implicitly still active, so this isn't a 
problem. At Oracle we recently switched to the gold linker and then the 
implicit rpath is no longer in effect.


Bug: https://bugs.openjdk.java.net/browse/JDK-8221179

Webrev: http://cr.openjdk.java.net/~erikj/8221179/webrev.01/

/Erik



Re: Build OpenJDK 8 on MacOS Mojave (10.14.3)

2019-03-21 Thread Erik Joelsson
I don't think anyone has tried. Just removing the check in configure 
should be simple enough, but I suspect there will be lots of follow-on 
issues.


/Erik

On 2019-03-21 03:05, Langer, Christoph wrote:

Hi,

the Mac experts will probably find my question to be silly and start laughing… 
but nevertheless, I’m asking it here 😊

I was looking into building OpenJDK 8 today on my developer Mac, which runs 
Mojave (10.14.3). configure immediately tells me, I need Xcode 4. So I was 
trying to install xcode 4.6.3 – but seems this wouldn’t run on Mojave. What can 
I do?

Ok, on the build requirements page [0], the requirements are documented to be 
MacOS 10.7 (Lion). However, I’m thinking, since OpenJDK 8 is not completely 
legacy yet, at least a developer build should be possible on a current 
operating system. I would accept having to install the oldest running Xcode 
compiler for sure, but not at all being able to build on a recent MacOS is not 
good.

So, question to the experts: Will it be impossible to bump the build 
environment because changes would be too complex? Or is there a solution to 
this which I’m just not aware of?

Thank you and Best regards
Christoph

[0] https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms



Re: RFR: [8u] Build failed on Ubuntu 18.04 due to deprecated-declarations warnings

2019-03-21 Thread Andrew Haley
On 3/20/19 3:53 PM, Andrew John Hughes wrote:
> On 19/03/2019 15:09, Martin Buchholz wrote:
>> Probably it's because glibc deprecated readdir, and we don't have
>> --disable-warnings-as-errors by default?
>>
>> (I think warnings should not be errors except as opt-in by openjdk
>> developers/maintainers)
> I agree

I'm pretty sure that -Wall should never be used with -Werror, because
-Wall is a grab bag of unconnected warnings. The official doc is "all
the warnings about constructions that some users consider
questionable, and that are easy to avoid (or modify to prevent the
warning)".

So, I think that warnings-as-errors makes sense, but not in
conjunction with -Wall. I guess no-one wants to start the bikeshed
discussion about which warnings should be on, though.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. 
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


Build OpenJDK 8 on MacOS Mojave (10.14.3)

2019-03-21 Thread Langer, Christoph
Hi,

the Mac experts will probably find my question to be silly and start laughing… 
but nevertheless, I’m asking it here 😊

I was looking into building OpenJDK 8 today on my developer Mac, which runs 
Mojave (10.14.3). configure immediately tells me, I need Xcode 4. So I was 
trying to install xcode 4.6.3 – but seems this wouldn’t run on Mojave. What can 
I do?

Ok, on the build requirements page [0], the requirements are documented to be 
MacOS 10.7 (Lion). However, I’m thinking, since OpenJDK 8 is not completely 
legacy yet, at least a developer build should be possible on a current 
operating system. I would accept having to install the oldest running Xcode 
compiler for sure, but not at all being able to build on a recent MacOS is not 
good.

So, question to the experts: Will it be impossible to bump the build 
environment because changes would be too complex? Or is there a solution to 
this which I’m just not aware of?

Thank you and Best regards
Christoph

[0] https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms