On Mon, 22 May 2023 19:54:59 GMT, Erik Joelsson <er...@openjdk.org> wrote:

>> Jiangli Zhou has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains 12 commits:
>> 
>>  - Merge branch 'master' into JDK-8307858
>>  - Merge branch 'master' into JDK-8307858
>>  - Clean up.
>>  - In clude $MACHINE_FLAG in partial linking flag.
>>  - Use '-m32' instead of '-m elf_i386'.
>>  - Use '-m elf_i386' for partial linking with gcc for linux 32-bit platform.
>>    
>>    It's based on the post on 
>> https://www.linuxquestions.org/questions/linux-software-2/relocatable-linking-on-x86-64-for-i386-872812/.
>>  - Only do partial linking step with gcc/clang on 64-bit platform.
>>    
>>    There is a linking failure with linux-x86 build:
>>    
>>    /usr/bin/ld: relocatable linking with relocations from format elf32-i386 
>> (/home/runner/work/jdk/jdk/build/linux-x86/hotspot/variant-server/libjvm/libgtest/objs/gmock-all.o)
>>  to format elf64-x86-64 
>> (/home/runner/work/jdk/jdk/build/linux-x86/hotspot/variant-server/libjvm/libgtest/objs/libgtest_relocatable.o)
>>  is not supported
>>  - Need to set $1_AR_OBJ_ARG to $$($1_LD_OBJ_ARG) instead of $1_LD_OBJ_ARG.
>>  - Merge branch 'master' into JDK-8307858
>>  - Revert 
>> src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_CommonUtils.c
>>  change.
>>  - ... and 2 more: https://git.openjdk.org/jdk/compare/8474e693...fb945210
>
> make/common/NativeCompilation.gmk line 1208:
> 
>> 1206:          $$(call ExecuteWithLog, 
>> $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_partial_link, \
>> 1207:             $$($1_LD) $(LDFLAGS_CXX_PARTIAL_LINKING) 
>> $(LD_OUT_OPTION)$$($1_TARGET_RELOCATABLE) \
>> 1208:                  $$($1_LD_OBJ_ARG))
> 
> This makes my build pass.
> Suggestion:
> 
>            $$($1_LD) $(LDFLAGS_CXX_PARTIAL_LINKING) $$($1_SYSROOT_LDFLAGS) \
>                $(LD_OUT_OPTION)$$($1_TARGET_RELOCATABLE) \
>                  $$($1_LD_OBJ_ARG))

Thanks! Tested with a macosx-x86_64 build and also with our prototype on JDK 11 
for linux-x64. They still build okay with the change. Looks like it 
affects/needed for cross build. Committing your fix.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14064#discussion_r1201077691

Reply via email to