RFR: JDK-8139657: Incremental build of jdk.vm.ci-gensrc creates repeated entries in services file

2015-10-15 Thread Erik Joelsson

Hello,

Sorry for not noticing this earlier. Here is a fix for the problem with 
repeating lines in the services file.


Bug: https://bugs.openjdk.java.net/browse/JDK-8139657
Patch:
diff -r 9ab5571ccea8 make/gensrc/Gensrc-jdk.vm.ci.gmk
--- a/make/gensrc/Gensrc-jdk.vm.ci.gmk
+++ b/make/gensrc/Gensrc-jdk.vm.ci.gmk
@@ -108,7 +108,11 @@
 ($(CD) $(GENSRC_DIR)/META-INF/jvmci.providers && \
 for i in $$($(LS)); do \
   c=$$($(CAT) $$i | $(TR) -d '\n\r'); \
-  $(ECHO) $$i >> $(GENSRC_DIR)/META-INF/services/$$c; \
+  $(ECHO) $$i >> $(GENSRC_DIR)/META-INF/services/$$c.tmp; \
+done)
+($(CD) $(GENSRC_DIR)/META-INF/services && \
+for i in $$($(LS) *.tmp); do \
+  $(MV) $$i $${i%.tmp}; \
 done)
 $(TOUCH) $@

/Erik

On 2015-10-08 04:42, Christian Thalinger wrote:

On Oct 5, 2015, at 2:47 AM, Magnus Ihse Bursie  
wrote:

On 2015-09-29 03:12, Christian Thalinger wrote:

On Sep 27, 2015, at 11:25 PM, Magnus Ihse Bursie 
 wrote:

On 2015-09-25 22:00, Christian Thalinger wrote:

Btw. we found a bug in creating the OptionDescriptors files; we get duplicate 
entries:

$ cat 
build/macosx-x86_64-normal-server-release/jdk/modules/java.base/META-INF/services/jdk.internal.jvmci.options.OptionDescriptors
jdk.internal.jvmci.compiler.Compiler_OptionDescriptors
jdk.internal.jvmci.hotspot.HotSpotConstantReflectionProvider_OptionDescriptors
jdk.internal.jvmci.hotspot.HotSpotResolvedJavaFieldImpl_OptionDescriptors
jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethodImpl_OptionDescriptors
jdk.internal.jvmci.compiler.Compiler_OptionDescriptors
jdk.internal.jvmci.hotspot.HotSpotConstantReflectionProvider_OptionDescriptors
jdk.internal.jvmci.hotspot.HotSpotResolvedJavaFieldImpl_OptionDescriptors
jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethodImpl_OptionDescriptors
…

Would this be the right fix?

diff -r db1a815d2f6c make/gensrc/Gensrc-java.base.gmk
--- a/make/gensrc/Gensrc-java.base.gmkThu Sep 24 15:35:49 2015 -1000
+++ b/make/gensrc/Gensrc-java.base.gmkFri Sep 25 18:18:35 2015 +0200
@@ -94,6 +94,7 @@
$(GENSRC_DIR)/_gensrc_proc_done
$(MKDIR) -p $(@D)
($(CD) $(GENSRC_DIR)/META-INF/jvmci.options && \
+$(RM) -f $@; \
for i in $$(ls); do \
  echo $${i}_OptionDescriptors >> $@; \
done)


That seems like a reasonable fix, yes.

Thanks, but… (see below)


And I see the same behavior for HotSpotJVMCIBackendFactory:

$ cat 
build/macosx-x86_64-normal-server-release/jdk/modules/java.base/META-INF/services/jdk.internal.jvmci.hotspot.HotSpotJVMCIBackendFactory
jdk.internal.jvmci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory
jdk.internal.jvmci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory
jdk.internal.jvmci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory
jdk.internal.jvmci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory
…

So I think a similar fix needs to be applied there.

…I’ve look at the code that creates this file and it isn’t obvious to me how to 
fix it.  Any good ideas?

Try this:
 ($(CD) $(GENSRC_DIR)/META-INF/jvmci.providers && \
 for i in $$($(LS)); do \
   c=$$($(CAT) $$i | $(TR) -d '\n\r'); \
+  $(RM) $(GENSRC_DIR)/META-INF/services/$$c; \
   $(ECHO) $$i >> $(GENSRC_DIR)/META-INF/services/$$c; \
 done)
 $(TOUCH) $@

I have not tested it but it should work.

No, this won’t work.  Both implementations of HotSpotJVMCIBackendFactory 
(AMD64HotSpotJVMCIBackendFactory and SPARCHotSpotJVMCIBackendFactory) contain 
the same service file name:

jdk.internal.jvmci.hotspot.HotSpotJVMCIBackendFactory

since we need to collect all available factories in one service.


/Magnus




RFR: JDK-8139668 Generate README-build.html from markdown

2015-10-15 Thread Magnus Ihse Bursie

Finished.
The build documentation is currently available in README-build.html. The 
problem with having the build instructions in html format is two-fold:


1) It is hard to read from a terminal

2) It is unnecessary difficult to modify

At least 2) means that it is an extra threshold to get over, in order to 
update or rewrite the build documentation.


Instead, we should have the documentation in markdown format, which is 
easy to read in a console even in source format, and is easy to modify. 
From this source format, a html version can easily be generated.


In this change, I have intentionally *not* modified the contents of the 
documentation. Instead, this patch will prepare the ground for future 
fixes to the documentation. There are a few, minor changes that was 
needed. Tables are not very easy to represent in markdown, so I replaced 
a few tables with lists. I also modified a few places (e.g. when 
refering to the documentation file as "html").


The markdown file originated from the old html file. I started out using 
automated tools for converting html to markdown, but then spent some 
time polishing the markdown to make sure the resulting html matched the 
original file as closely as possible. I also wanted to make sure the 
markdown was readable in itself, to address item 1 above.


Bug: https://bugs.openjdk.java.net/browse/JDK-8139668
WebRev: 
http://cr.openjdk.java.net/~ihse/JDK-8139668-markdown-documentation/webrev.01


RFR: 8136556 - Add the ability to perform static builds of MacOSX x64 binaries

2015-10-15 Thread Bob Vandette
Resending after joining mailing list …


Please review this JDK 9 enhancement which allows a completely static build of 
the JDK for MacOSX x64 platforms.

https://bugs.openjdk.java.net/browse/JDK-8136556 


The change involves:

1. Producing “.a” archives for each native libraries.
2. Ensuring that all symbols across the JDK native libraries are unique.
3. Changing the JNI_OnLoad and JNI_OnUnload (and the Agent equivalents) to have 
the each library name appended per
   the JNI specification.
4. Modifications to the launcher and launcher Makefiles to allow them to be 
linked with the java.base and jdk.jdwp.agent libraries
   and function.

http://cr.openjdk.java.net/~bobv/8136556/webrev.00/ 

http://cr.openjdk.java.net/~bobv/8136556/hotspot/webrev.00/ 

http://cr.openjdk.java.net/~bobv/8136556/jdk/webrev.00/ 


Note: This change does not link every possible static library with the 
launchers.  It is currently limited to
the java.base and jdk.jdwp.agent libraries in order to allow for the TCK 
validation of the base module only.


Bob.

Re: RFR: 8136556 - Add the ability to perform static builds of MacOSX x64 binaries

2015-10-15 Thread Christian Thalinger
Copy-pasting the comment I made earlier (internally):

>> make/bsd/makefiles/gcc.make:
>> 
>> + ifeq ($(BUILD_STATIC),true)
>> + CXXFLAGS += -DSTATIC_BUILD
>> + CFLAGS += -DSTATIC_BUILD
>> 
>> Can we use the same name everywhere?
> 
> We were trying to differentiate Makefile options from compile time 
> conditionals.
> In one case it’s set to true and the other it’s defined.
> 
> Are there no other cases where this is done?

I’m not sure but looking at make/excludeSrc.make all of them use the same name.

> On Oct 15, 2015, at 8:10 AM, Bob Vandette  wrote:
> 
> Please review this JDK 9 enhancement which allows a completely static build 
> of the JDK for MacOSX x64 platforms.
> 
> https://bugs.openjdk.java.net/browse/JDK-8136556 
> 
> 
> The change involves:
> 
> 1. Producing “.a” archives for each native libraries.
> 2. Ensuring that all symbols across the JDK native libraries are unique.
> 3. Changing the JNI_OnLoad and JNI_OnUnload (and the Agent equivalents) to 
> have the each library name appended per
>   the JNI specification.
> 4. Modifications to the launcher and launcher Makefiles to allow them to be 
> linked with the java.base and jdk.jdwp.agent libraries
>   and function.
> 
> http://cr.openjdk.java.net/~bobv/8136556/webrev.00/ 
> 
> http://cr.openjdk.java.net/~bobv/8136556/hotspot/webrev.00/ 
> 
> http://cr.openjdk.java.net/~bobv/8136556/jdk/webrev.00/ 
> 
> 
> Note: This change does not link every possible static library with the 
> launchers.  It is currently limited to
> the java.base and jdk.jdwp.agent libraries in order to allow for the TCK 
> validation of the base module only.
> 
> 
> Bob.



Re: RFR: JDK-8139657: Incremental build of jdk.vm.ci-gensrc creates repeated entries in services file

2015-10-15 Thread Christian Thalinger
Looks good.

Since you are a JDK 9 Reviewer, will you push this fix?

> On Oct 15, 2015, at 2:39 AM, Erik Joelsson  wrote:
> 
> Hello,
> 
> Sorry for not noticing this earlier. Here is a fix for the problem with 
> repeating lines in the services file.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8139657
> Patch:
> diff -r 9ab5571ccea8 make/gensrc/Gensrc-jdk.vm.ci.gmk
> --- a/make/gensrc/Gensrc-jdk.vm.ci.gmk
> +++ b/make/gensrc/Gensrc-jdk.vm.ci.gmk
> @@ -108,7 +108,11 @@
> ($(CD) $(GENSRC_DIR)/META-INF/jvmci.providers && \
> for i in $$($(LS)); do \
>   c=$$($(CAT) $$i | $(TR) -d '\n\r'); \
> -  $(ECHO) $$i >> $(GENSRC_DIR)/META-INF/services/$$c; \
> +  $(ECHO) $$i >> $(GENSRC_DIR)/META-INF/services/$$c.tmp; \
> +done)
> +($(CD) $(GENSRC_DIR)/META-INF/services && \
> +for i in $$($(LS) *.tmp); do \
> +  $(MV) $$i $${i%.tmp}; \
> done)
> $(TOUCH) $@
> 
> /Erik
> 
> On 2015-10-08 04:42, Christian Thalinger wrote:
>>> On Oct 5, 2015, at 2:47 AM, Magnus Ihse Bursie 
>>>  wrote:
>>> 
>>> On 2015-09-29 03:12, Christian Thalinger wrote:
> On Sep 27, 2015, at 11:25 PM, Magnus Ihse Bursie 
>  wrote:
> 
> On 2015-09-25 22:00, Christian Thalinger wrote:
>> Btw. we found a bug in creating the OptionDescriptors files; we get 
>> duplicate entries:
>> 
>> $ cat 
>> build/macosx-x86_64-normal-server-release/jdk/modules/java.base/META-INF/services/jdk.internal.jvmci.options.OptionDescriptors
>> jdk.internal.jvmci.compiler.Compiler_OptionDescriptors
>> jdk.internal.jvmci.hotspot.HotSpotConstantReflectionProvider_OptionDescriptors
>> jdk.internal.jvmci.hotspot.HotSpotResolvedJavaFieldImpl_OptionDescriptors
>> jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethodImpl_OptionDescriptors
>> jdk.internal.jvmci.compiler.Compiler_OptionDescriptors
>> jdk.internal.jvmci.hotspot.HotSpotConstantReflectionProvider_OptionDescriptors
>> jdk.internal.jvmci.hotspot.HotSpotResolvedJavaFieldImpl_OptionDescriptors
>> jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethodImpl_OptionDescriptors
>> …
>> 
>> Would this be the right fix?
>> 
>> diff -r db1a815d2f6c make/gensrc/Gensrc-java.base.gmk
>> --- a/make/gensrc/Gensrc-java.base.gmkThu Sep 24 15:35:49 2015 -1000
>> +++ b/make/gensrc/Gensrc-java.base.gmkFri Sep 25 18:18:35 2015 +0200
>> @@ -94,6 +94,7 @@
>>$(GENSRC_DIR)/_gensrc_proc_done
>> $(MKDIR) -p $(@D)
>> ($(CD) $(GENSRC_DIR)/META-INF/jvmci.options && \
>> +$(RM) -f $@; \
>>for i in $$(ls); do \
>>  echo $${i}_OptionDescriptors >> $@; \
>>done)
>> 
> That seems like a reasonable fix, yes.
 Thanks, but… (see below)
 
>> And I see the same behavior for HotSpotJVMCIBackendFactory:
>> 
>> $ cat 
>> build/macosx-x86_64-normal-server-release/jdk/modules/java.base/META-INF/services/jdk.internal.jvmci.hotspot.HotSpotJVMCIBackendFactory
>> jdk.internal.jvmci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory
>> jdk.internal.jvmci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory
>> jdk.internal.jvmci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory
>> jdk.internal.jvmci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory
>> …
>> 
>> So I think a similar fix needs to be applied there.
 …I’ve look at the code that creates this file and it isn’t obvious to me 
 how to fix it.  Any good ideas?
>>> Try this:
>>> ($(CD) $(GENSRC_DIR)/META-INF/jvmci.providers && \
>>> for i in $$($(LS)); do \
>>>   c=$$($(CAT) $$i | $(TR) -d '\n\r'); \
>>> +  $(RM) $(GENSRC_DIR)/META-INF/services/$$c; \
>>>   $(ECHO) $$i >> $(GENSRC_DIR)/META-INF/services/$$c; \
>>> done)
>>> $(TOUCH) $@
>>> 
>>> I have not tested it but it should work.
>> No, this won’t work.  Both implementations of HotSpotJVMCIBackendFactory 
>> (AMD64HotSpotJVMCIBackendFactory and SPARCHotSpotJVMCIBackendFactory) 
>> contain the same service file name:
>> 
>> jdk.internal.jvmci.hotspot.HotSpotJVMCIBackendFactory
>> 
>> since we need to collect all available factories in one service.
>> 
>>> /Magnus
>