suggesting fix: cross-compilation is requiring write permissions to bootstrap jdk

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Tue May 26 15:09:07 UTC 2020


On 2020-05-26 17:00, Magnus Ihse Bursie wrote:
> On 2020-05-26 15:32, David Holmes wrote:
>> Re-directing to the build-dev list.
>>
>> David
>>
>> On 26/05/2020 11:14 pm, Fedor wrote:
>>> Hello all!
>>>
>>> I've tried to crossbuild jdk using current 
>>> http://hg.openjdk.java.net/jdk/jdk/ sources and noticed that build 
>>> requires write permissions to bootstrap jdk.
> Say what?!
>
>>> The problem is it tries to write/rewrite class list into bootstrap 
>>> jdk directory.
>
> No, it should write to the INTERIM_IMAGE_DIR.
>
> However, I now see that we replace INTERIM_IMAGE_DIR with BUILD_JDK in 
> GenerateLinkOptData.gmk if we have an external build-jdk. I assume 
> that is how you have configured. I also assume you are not 
> cross-compiling.
... and I could not even read the freakin' subject, nor what you are 
writing in the body. :-( I apologize.

Ok, so you are cross-compiling, and have an external build-jdk. And we 
want to generate link opt data Claes, is this really OK for 
cross-compilation? I did not think so, but we have the following 
explicitly in Main.gmk:
       # If an external buildjdk has been provided, we skip generating an
       # interim-image and just use the external buildjdk for generating
       # classlist.

/Magnus
>
> I'm not entirely sure about the thinking here. I can't say for certain 
> that we really should run HelloClasslist if we have an external 
> build-jdk. I think I need Erik or Claes to chime in.
>
> /Magnus
>
>
>>> I would like to suggest the fix below to solve this problem:
>>>
>>>
>>> diff --git a/make/GenerateLinkOptData.gmk 
>>> b/make/GenerateLinkOptData.gmk
>>> --- a/make/GenerateLinkOptData.gmk
>>> +++ b/make/GenerateLinkOptData.gmk
>>> @@ -69,10 +69,10 @@
>>>              -Duser.language=en -Duser.country=US \
>>>              -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
>>>              build.tools.classlist.HelloClasslist $(LOG_DEBUG)
>>> -       $(GREP) -v HelloClasslist $@.raw > 
>>> $(INTERIM_IMAGE_DIR)/lib/classlist
>>> -       $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -Xshare:dump \
>>> +       $(GREP) -v HelloClasslist $@.raw > $@.classlist
>>> +       $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -Xshare:dump 
>>> -XX:SharedClassListFile=$@.classlist -XX:SharedArchiveFile=$@.jsa \
>>>              -Xmx128M -Xms128M $(LOG_INFO)
>>> -       $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java 
>>> -XX:DumpLoadedClassList=$@.raw \
>>> +       $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java 
>>> -XX:DumpLoadedClassList=$@.raw -XX:SharedClassListFile=$@.classlist 
>>> -XX:SharedArchiveFile=$@.jsa \
>>> -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
>>>              -Duser.language=en -Duser.country=US \
>>>              --module-path $(SUPPORT_OUTPUTDIR)/classlist.jar \
>>>
>>> Please correct me in case if it is wrong alias, or I need to file 
>>> bug first, or something else.
>>>
>>> Best Regards,
>>> Fedor
>>>
>




More information about the build-dev mailing list