Re: [jdk18] RFR: JDK-8278967 rmiregistry fails to start because SecurityManager is disabled
On Fri, 17 Dec 2021 20:01:27 GMT, Stuart Marks wrote: > Enable the security manager in rmiregistry's launcher arguments. Hi Stuart, I think specifying "allow" would be the behaviour preserving change here. That avoids any risk that enabling the SM earlier changes some behaviour during VM initialization. Cheers, David - Changes requested by dholmes (Reviewer). PR: https://git.openjdk.java.net/jdk18/pull/45
[jdk18] RFR: JDK-8278967 rmiregistry fails to start because SecurityManager is disabled
Enable the security manager in rmiregistry's launcher arguments. - Commit messages: - Add security manager property to rmiregistry launcher arguments. Changes: https://git.openjdk.java.net/jdk18/pull/45/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk18&pr=45&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8278967 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk18/pull/45.diff Fetch: git fetch https://git.openjdk.java.net/jdk18 pull/45/head:pull/45 PR: https://git.openjdk.java.net/jdk18/pull/45
Re: RFR: 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date
On Fri, 17 Dec 2021 16:29:21 GMT, Magnus Ihse Bursie wrote: >> Oh, that's ... interesting. (I'm pretty sure I wrote that code myself :)) >> >> I still think it would be good to keep the new code close to the old. If we >> set SOURCE_DATE to "updated", I think that should reflect in >> SOURCE_DATE_ISO_8601 as well. Maybe it does by the current design, but if it >> does, it could be more obvious. >> >> I'm sorry I don't have any ready-made suggestion. :( I'm really on vacation >> now and can't really dive into this, so if you can't find any better >> solution, then this'll have to do. > > But I think the code in InitSupport will be executed always; Init.gmk is our > "bootstrapper" / "trampoline" which wraps all calls to make (and > InitSupport.gmk contains gory implementation details of Init.gmk). @magicus don't worry, enjoy your holiday, I think @erik has pointed out it should work, so I probably made a mistake when I tried it... - PR: https://git.openjdk.java.net/jdk/pull/6878
Re: RFR: 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date
On Fri, 17 Dec 2021 17:53:12 GMT, Erik Joelsson wrote: >> But I think the code in InitSupport will be executed always; Init.gmk is our >> "bootstrapper" / "trampoline" which wraps all calls to make (and >> InitSupport.gmk contains gory implementation details of Init.gmk). > > SOURCE_DATE_EPOCH is initialized and exported in InitSupport.gmk so it's > always available in the environment. We did this because we want various > tools to pick this variable up from the environment, as this is a commonly > expected variable name for doing so. The new variable SOURCE_DATE_ISO_8601 is > a variant with a different format and there is no standard for reading this > from the environment, so it's not as obvious that we should just export it > the same way. > > On the other hand, we do not want to execute a shell expression every time we > import MakeBase.gmk, so I would still vote for doing this in InitSupport.gmk > and export SOURCE_DATE_ISO_8601. @erikj79 Interesting, I tried adding it to InitSupport.gmk, but it wasn't always set... odd, I will revisit, I probably did something wrong...! will give that another try, thanks - PR: https://git.openjdk.java.net/jdk/pull/6878
Re: RFR: 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date
On Fri, 17 Dec 2021 17:54:46 GMT, Erik Joelsson wrote: >> If "reproducible build" is enabled, then utilize the new --date option in >> the building of jar's and jmods. >> Validating the boot jdk supports --date for the building of the jars. >> >> Signed-off-by: Andrew Leonard > > make/common/MakeBase.gmk line 148: > >> 146: ifeq ($(SOURCE_DATE_ISO_8601), ) >> 147: # GNU date format did not work, try BSD date options >> 148: SOURCE_DATE_ISO_8601 := $(shell $(DATE) -u -j -f "%s" >> "$(SOURCE_DATE_EPOCH)" +"%Y-%m-%dT%H:%M:%SZ" 2> /dev/null) > > Could we maybe figure out the date command line to use in configure instead > to avoid the trial and error at build time? I based this trial and error based on util.m4 code and copied the method, so yes I can store the result from then... - PR: https://git.openjdk.java.net/jdk/pull/6878
Re: RFR: 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date
On Fri, 17 Dec 2021 16:29:21 GMT, Magnus Ihse Bursie wrote: >> Oh, that's ... interesting. (I'm pretty sure I wrote that code myself :)) >> >> I still think it would be good to keep the new code close to the old. If we >> set SOURCE_DATE to "updated", I think that should reflect in >> SOURCE_DATE_ISO_8601 as well. Maybe it does by the current design, but if it >> does, it could be more obvious. >> >> I'm sorry I don't have any ready-made suggestion. :( I'm really on vacation >> now and can't really dive into this, so if you can't find any better >> solution, then this'll have to do. > > But I think the code in InitSupport will be executed always; Init.gmk is our > "bootstrapper" / "trampoline" which wraps all calls to make (and > InitSupport.gmk contains gory implementation details of Init.gmk). SOURCE_DATE_EPOCH is initialized and exported in InitSupport.gmk so it's always available in the environment. We did this because we want various tools to pick this variable up from the environment, as this is a commonly expected variable name for doing so. The new variable SOURCE_DATE_ISO_8601 is a variant with a different format and there is no standard for reading this from the environment, so it's not as obvious that we should just export it the same way. On the other hand, we do not want to execute a shell expression every time we import MakeBase.gmk, so I would still vote for doing this in InitSupport.gmk and export SOURCE_DATE_ISO_8601. - PR: https://git.openjdk.java.net/jdk/pull/6878
Re: RFR: 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date
On Fri, 17 Dec 2021 09:18:03 GMT, Andrew Leonard wrote: > If "reproducible build" is enabled, then utilize the new --date option in the > building of jar's and jmods. > Validating the boot jdk supports --date for the building of the jars. > > Signed-off-by: Andrew Leonard make/common/JarArchive.gmk line 234: > 232: endif > 233: else > 234: $1_JAR_OPTIONS := $$($1_JAR_SOURCE_DATE) Instead of adding $$($1_JAR_SOURCE_DATE) to every branch of this conditional, you can use += to build the $1_JAR_OPTIONS variable one step at a time. I don't think we need a separate variable JAR_SOURCE_DATE. make/common/MakeBase.gmk line 148: > 146: ifeq ($(SOURCE_DATE_ISO_8601), ) > 147: # GNU date format did not work, try BSD date options > 148: SOURCE_DATE_ISO_8601 := $(shell $(DATE) -u -j -f "%s" > "$(SOURCE_DATE_EPOCH)" +"%Y-%m-%dT%H:%M:%SZ" 2> /dev/null) Could we maybe figure out the date command line to use in configure instead to avoid the trial and error at build time? - PR: https://git.openjdk.java.net/jdk/pull/6878
Re: RFR: 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date
On Fri, 17 Dec 2021 16:27:39 GMT, Magnus Ihse Bursie wrote: >> @magicus I looked at that, but the problem is SOURCE_DATE_EPOCH is set in >> InitSupport.gmk depending on whether SOURCE_DATE=="updated" : >> https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/make/InitSupport.gmk#L315 >> I also couldn't add it in InitSupport.gmk because that marco is not included >> from every place SetupJarArchive is resolved. >> Thoughts? > > Oh, that's ... interesting. (I'm pretty sure I wrote that code myself :)) > > I still think it would be good to keep the new code close to the old. If we > set SOURCE_DATE to "updated", I think that should reflect in > SOURCE_DATE_ISO_8601 as well. Maybe it does by the current design, but if it > does, it could be more obvious. > > I'm sorry I don't have any ready-made suggestion. :( I'm really on vacation > now and can't really dive into this, so if you can't find any better > solution, then this'll have to do. But I think the code in InitSupport will be executed always; Init.gmk is our "bootstrapper" / "trampoline" which wraps all calls to make (and InitSupport.gmk contains gory implementation details of Init.gmk). - PR: https://git.openjdk.java.net/jdk/pull/6878
Re: RFR: 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date
On Fri, 17 Dec 2021 13:51:28 GMT, Andrew Leonard wrote: >> make/common/MakeBase.gmk line 145: >> >>> 143: # If reproducible builds are enabled then set SOURCE_DATE_ISO_8601 >>> string variable >>> 144: ifeq ($(ENABLE_REPRODUCIBLE_BUILD), true) >>> 145: SOURCE_DATE_ISO_8601 := $(shell $(DATE) --utc >>> --date="@$(SOURCE_DATE_EPOCH)" +"%Y-%m-%dT%H:%M:%SZ" 2> /dev/null) >> >> This should be set up by the configure script. Look for where we are >> currently doing the SOURCE_DATE_EPOCH stuff. >> >> Also consider the possibility to *just* use this variable, and pass it on to >> jar if it is present, and not if it's missing. That way you can get rid of >> the redundant boolean variable. > > @magicus I looked at that, but the problem is SOURCE_DATE_EPOCH is set in > InitSupport.gmk depending on whether SOURCE_DATE=="updated" : > https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/make/InitSupport.gmk#L315 > I also couldn't add it in InitSupport.gmk because that marco is not included > from every place SetupJarArchive is resolved. > Thoughts? Oh, that's ... interesting. (I'm pretty sure I wrote that code myself :)) I still think it would be good to keep the new code close to the old. If we set SOURCE_DATE to "updated", I think that should reflect in SOURCE_DATE_ISO_8601 as well. Maybe it does by the current design, but if it does, it could be more obvious. I'm sorry I don't have any ready-made suggestion. :( I'm really on vacation now and can't really dive into this, so if you can't find any better solution, then this'll have to do. - PR: https://git.openjdk.java.net/jdk/pull/6878
Integrated: 8278954: Using clang together with devkit on linux doesn't work for building
On Fri, 17 Dec 2021 11:27:43 GMT, Gilles Duboscq wrote: > When running `configure`, using `--with-devkit=` to point to a typical linux > devkit along with `--with-toolchain-path=` and `--with-toolchain-type=clang` > to point to a clang-based toolchain results in: > > configure:75064: checking whether the C compiler works > configure:75086: /dl/tools/clang -m64 -isysroot > /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot -isysroot > /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot -m64 > -isysroot /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot > conftest.c >&5 > d.lld: error: cannot open crt1.o: No such file or directory > ld.lld: error: cannot open crti.o: No such file or directory > ld.lld: error: cannot open crtbegin.o: No such file or directory > ld.lld: error: unable to find library -lgcc > ld.lld: error: unable to find library -lgcc_s > ld.lld: error: unable to find library -lc > ld.lld: error: unable to find library -lgcc > ld.lld: error: unable to find library -lgcc_s > ld.lld: error: cannot open crtend.o: No such file or directory > ld.lld: error: cannot open crtn.o: No such file or directory > clang-12: error: linker command failed with exit code 1 (use -v to see > invocation) > ``` > This is because clang is unable to locate the gcc installation from the > devkit. > The gcc toolchain is not in the location clang expects in the sysroot (that's > not how our devkits are structured). > Note that it might go unnoticed on machines that have gcc installed because > clang will fallback to system-global locations. > > We can help clang by letting it now about the gcc location in the devkit with > `--gcc-toolchain=`. > However that's not enough and we then get: > > ld.lld: error: cannot open crt1.o: No such file or directory > ld.lld: error: cannot open crti.o: No such file or directory > ld.lld: error: unable to find library -lc > ld.lld: error: cannot open crtn.o: No such file or directory > > clang was able to locate the gcc support libraries but is not able to locate > required system libraries. > That's because `-isysroot` is not intended for libraries (only headers) but > also because `-isysroot` has no effect for clang on linux (see > [llvm#11503](https://bugs.llvm.org/show_bug.cgi?id=11503)). > Using `--sysroot=` in this case (clang on linux) resolves this issue. This pull request has now been integrated. Changeset: b17f8d5b Author:Gilles Duboscq URL: https://git.openjdk.java.net/jdk/commit/b17f8d5b6c4d4ec75bb57f1d2009e30332bdb3ce Stats: 15 lines in 1 file changed: 13 ins; 0 del; 2 mod 8278954: Using clang together with devkit on linux doesn't work for building Reviewed-by: erikj - PR: https://git.openjdk.java.net/jdk/pull/6880
Re: RFR: 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date
On Fri, 17 Dec 2021 11:18:10 GMT, Magnus Ihse Bursie wrote: >> If "reproducible build" is enabled, then utilize the new --date option in >> the building of jar's and jmods. >> Validating the boot jdk supports --date for the building of the jars. >> >> Signed-off-by: Andrew Leonard > > make/common/MakeBase.gmk line 145: > >> 143: # If reproducible builds are enabled then set SOURCE_DATE_ISO_8601 >> string variable >> 144: ifeq ($(ENABLE_REPRODUCIBLE_BUILD), true) >> 145: SOURCE_DATE_ISO_8601 := $(shell $(DATE) --utc >> --date="@$(SOURCE_DATE_EPOCH)" +"%Y-%m-%dT%H:%M:%SZ" 2> /dev/null) > > This should be set up by the configure script. Look for where we are > currently doing the SOURCE_DATE_EPOCH stuff. > > Also consider the possibility to *just* use this variable, and pass it on to > jar if it is present, and not if it's missing. That way you can get rid of > the redundant boolean variable. @magicus I looked at that, but the problem is SOURCE_DATE_EPOCH is set in InitSupport.gmk depending on whether SOURCE_DATE=="updated" : https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/make/InitSupport.gmk#L315 I also couldn't add it in InitSupport.gmk because that marco is not included from every place SetupJarArchive is resolved. Thoughts? - PR: https://git.openjdk.java.net/jdk/pull/6878
Re: RFR: 8278954: Using clang together with devkit on linux doesn't work for building
On Fri, 17 Dec 2021 13:35:04 GMT, Erik Joelsson wrote: >> When running `configure`, using `--with-devkit=` to point to a typical linux >> devkit along with `--with-toolchain-path=` and `--with-toolchain-type=clang` >> to point to a clang-based toolchain results in: >> >> configure:75064: checking whether the C compiler works >> configure:75086: /dl/tools/clang -m64 -isysroot >> /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot -isysroot >> /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot -m64 >> -isysroot /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot >> conftest.c >&5 >> d.lld: error: cannot open crt1.o: No such file or directory >> ld.lld: error: cannot open crti.o: No such file or directory >> ld.lld: error: cannot open crtbegin.o: No such file or directory >> ld.lld: error: unable to find library -lgcc >> ld.lld: error: unable to find library -lgcc_s >> ld.lld: error: unable to find library -lc >> ld.lld: error: unable to find library -lgcc >> ld.lld: error: unable to find library -lgcc_s >> ld.lld: error: cannot open crtend.o: No such file or directory >> ld.lld: error: cannot open crtn.o: No such file or directory >> clang-12: error: linker command failed with exit code 1 (use -v to see >> invocation) >> ``` >> This is because clang is unable to locate the gcc installation from the >> devkit. >> The gcc toolchain is not in the location clang expects in the sysroot >> (that's not how our devkits are structured). >> Note that it might go unnoticed on machines that have gcc installed because >> clang will fallback to system-global locations. >> >> We can help clang by letting it now about the gcc location in the devkit >> with `--gcc-toolchain=`. >> However that's not enough and we then get: >> >> ld.lld: error: cannot open crt1.o: No such file or directory >> ld.lld: error: cannot open crti.o: No such file or directory >> ld.lld: error: unable to find library -lc >> ld.lld: error: cannot open crtn.o: No such file or directory >> >> clang was able to locate the gcc support libraries but is not able to locate >> required system libraries. >> That's because `-isysroot` is not intended for libraries (only headers) but >> also because `-isysroot` has no effect for clang on linux (see >> [llvm#11503](https://bugs.llvm.org/show_bug.cgi?id=11503)). >> Using `--sysroot=` in this case (clang on linux) resolves this issue. > > Marked as reviewed by erikj (Reviewer). Thanks for the prompt review @erikj79! - PR: https://git.openjdk.java.net/jdk/pull/6880
Re: RFR: 8278954: Using clang together with devkit on linux doesn't work for building
On Fri, 17 Dec 2021 11:27:43 GMT, Gilles Duboscq wrote: > When running `configure`, using `--with-devkit=` to point to a typical linux > devkit along with `--with-toolchain-path=` and `--with-toolchain-type=clang` > to point to a clang-based toolchain results in: > > configure:75064: checking whether the C compiler works > configure:75086: /dl/tools/clang -m64 -isysroot > /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot -isysroot > /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot -m64 > -isysroot /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot > conftest.c >&5 > d.lld: error: cannot open crt1.o: No such file or directory > ld.lld: error: cannot open crti.o: No such file or directory > ld.lld: error: cannot open crtbegin.o: No such file or directory > ld.lld: error: unable to find library -lgcc > ld.lld: error: unable to find library -lgcc_s > ld.lld: error: unable to find library -lc > ld.lld: error: unable to find library -lgcc > ld.lld: error: unable to find library -lgcc_s > ld.lld: error: cannot open crtend.o: No such file or directory > ld.lld: error: cannot open crtn.o: No such file or directory > clang-12: error: linker command failed with exit code 1 (use -v to see > invocation) > ``` > This is because clang is unable to locate the gcc installation from the > devkit. > The gcc toolchain is not in the location clang expects in the sysroot (that's > not how our devkits are structured). > Note that it might go unnoticed on machines that have gcc installed because > clang will fallback to system-global locations. > > We can help clang by letting it now about the gcc location in the devkit with > `--gcc-toolchain=`. > However that's not enough and we then get: > > ld.lld: error: cannot open crt1.o: No such file or directory > ld.lld: error: cannot open crti.o: No such file or directory > ld.lld: error: unable to find library -lc > ld.lld: error: cannot open crtn.o: No such file or directory > > clang was able to locate the gcc support libraries but is not able to locate > required system libraries. > That's because `-isysroot` is not intended for libraries (only headers) but > also because `-isysroot` has no effect for clang on linux (see > [llvm#11503](https://bugs.llvm.org/show_bug.cgi?id=11503)). > Using `--sysroot=` in this case (clang on linux) resolves this issue. Marked as reviewed by erikj (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/6880
RFR: 8278954: Using clang together with devkit on linux doesn't work for building
When running `configure`, using `--with-devkit=` to point to a typical linux devkit along with `--with-toolchain-path=` and `--with-toolchain-type=clang` to point to a clang-based toolchain results in: configure:75064: checking whether the C compiler works configure:75086: /dl/tools/clang -m64 -isysroot /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot -isysroot /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot -m64 -isysroot /dl/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/sysroot conftest.c >&5 d.lld: error: cannot open crt1.o: No such file or directory ld.lld: error: cannot open crti.o: No such file or directory ld.lld: error: cannot open crtbegin.o: No such file or directory ld.lld: error: unable to find library -lgcc ld.lld: error: unable to find library -lgcc_s ld.lld: error: unable to find library -lc ld.lld: error: unable to find library -lgcc ld.lld: error: unable to find library -lgcc_s ld.lld: error: cannot open crtend.o: No such file or directory ld.lld: error: cannot open crtn.o: No such file or directory clang-12: error: linker command failed with exit code 1 (use -v to see invocation) ``` This is because clang is unable to locate the gcc installation from the devkit. The gcc toolchain is not in the location clang expects in the sysroot (that's not how our devkits are structured). Note that it might go unnoticed on machines that have gcc installed because clang will fallback to system-global locations. We can help clang by letting it now about the gcc location in the devkit with `--gcc-toolchain=`. However that's not enough and we then get: ld.lld: error: cannot open crt1.o: No such file or directory ld.lld: error: cannot open crti.o: No such file or directory ld.lld: error: unable to find library -lc ld.lld: error: cannot open crtn.o: No such file or directory clang was able to locate the gcc support libraries but is not able to locate required system libraries. That's because `-isysroot` is not intended for libraries (only headers) but also because `-isysroot` has no effect for clang on linux (see [llvm#11503](https://bugs.llvm.org/show_bug.cgi?id=11503)). Using `--sysroot=` in this case (clang on linux) resolves this issue. - Commit messages: - 8278954: Using clang together with devkit on linux doesn't work for building Changes: https://git.openjdk.java.net/jdk/pull/6880/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6880&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8278954 Stats: 15 lines in 1 file changed: 13 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/6880.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/6880/head:pull/6880 PR: https://git.openjdk.java.net/jdk/pull/6880
Re: RFR: 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date
On Fri, 17 Dec 2021 09:18:03 GMT, Andrew Leonard wrote: > If "reproducible build" is enabled, then utilize the new --date option in the > building of jar's and jmods. > Validating the boot jdk supports --date for the building of the jars. > > Signed-off-by: Andrew Leonard make/common/MakeBase.gmk line 145: > 143: # If reproducible builds are enabled then set SOURCE_DATE_ISO_8601 > string variable > 144: ifeq ($(ENABLE_REPRODUCIBLE_BUILD), true) > 145: SOURCE_DATE_ISO_8601 := $(shell $(DATE) --utc > --date="@$(SOURCE_DATE_EPOCH)" +"%Y-%m-%dT%H:%M:%SZ" 2> /dev/null) This should be set up by the configure script. Look for where we are currently doing the SOURCE_DATE_EPOCH stuff. Also consider the possibility to *just* use this variable, and pass it on to jar if it is present, and not if it's missing. That way you can get rid of the redundant boolean variable. - PR: https://git.openjdk.java.net/jdk/pull/6878
RFR: 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date
If "reproducible build" is enabled, then utilize the new --date option in the building of jar's and jmods. Validating the boot jdk supports --date for the building of the jars. Signed-off-by: Andrew Leonard - Commit messages: - 8278766: Enable OpenJDK build support for reproducible jars and jmods using --date Changes: https://git.openjdk.java.net/jdk/pull/6878/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6878&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8278766 Stats: 55 lines in 6 files changed: 40 ins; 3 del; 12 mod Patch: https://git.openjdk.java.net/jdk/pull/6878.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/6878/head:pull/6878 PR: https://git.openjdk.java.net/jdk/pull/6878