On Fri, 22 May 2026 06:47:54 GMT, Yasumasa Suenaga <[email protected]> wrote:

>> make/devkit/Tools.gmk line 268:
>> 
>>> 266: ifeq ($(ARCH),x86_64)
>>> 267:   # Enable mixed mode.
>>> 268:   RPM_ARCHS += i386 i686
>> 
>> Does this needed after the 32bit x86 has been removed.
>
> Following error happened in GCC build log when I removed them:
> 
> 
> /usr/src/jdk/build/devkit/result/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/bin/ld:
>  error: cannot find libc.so.6
> /usr/src/jdk/build/devkit/result/x86_64-linux-gnu-to-x86_64-linux-gnu/x86_64-linux-gnu/bin/ld:
>  error: cannot find ld-linux-x86-64.so.2
> collect2: error: ld returned 1 exit status
> make[5]: *** [Makefile:1005: libgcc_s.so] Error 1
> 
> 
> In Tools.gmk, rewrite to relative path in linker script of libc and 
> libpthread to ensure to use libs in sysroot. I'm not sure, but it might 
> attempts to load `/usr/lib` rather than `/usr/lib64`. I think it is incorrect 
> because `--with-sysroot` would be passed when configure scripts for GCC is 
> run. Thus it is not necessary.
> We should apply following patch if we want to remove them. It works on my PC 
> and JDK binaries which were built with devkit seem to be linked glibc in 
> sysroot correctly. I think it implies this patch is correct. However I wonder 
> I can merge it to this PR because it does not seem to be another problem.
> 
> 
> diff --git a/make/devkit/Tools.gmk b/make/devkit/Tools.gmk
> index 1eb0a702747..ffed8ffcb99 100644
> --- a/make/devkit/Tools.gmk
> +++ b/make/devkit/Tools.gmk
> @@ -202,9 +202,6 @@ SRCDIR := $(OUTPUT_ROOT)/src
>  # Marker file for unpacking rpms
>  RPMS := $(SYSROOT)/rpms_unpacked
> 
> -# Need to patch libs that are linker scripts to use non-absolute paths
> -LIBS := $(SYSROOT)/libs_patched
> -
>  
> ################################################################################
>  # Download RPMs
>  download-rpms:
> @@ -263,12 +260,7 @@ $(foreach dep,$(DEPENDENCIES),$(eval $(call 
> DownloadVerify,$(dep))))
>  # Unpack RPMS
> 
>  RPM_ARCHS := $(ARCH) noarch
> -ifeq ($(ARCH),x86_64)
> -  # Enable mixed mode.
> -  RPM_ARCHS += i386 i686
> -else ifeq ($(ARCH),i686)
> -  RPM_ARCHS += i386
> -else ifeq ($(ARCH), armhfp)
> +ifeq ($(ARCH), armhfp)
>    RPM_ARCHS += armv7hl
>  endif
> 
> @@ -298,26 +290,6 @@ endef
> 
>  $(foreach p,$(RPM_FILE_LIST),$(eval $(call unrpm,$(p))))
> 
> -################################################################################
> -
> -# Note: MUST create a <sysroot>/usr/lib even if not really needed.
> -# gcc will use a path relative to it to resolve lib64. (x86_64).
> -# we're creating multi-lib compiler with 32bit libc as well, so we should
> -# have it anyway, but just to make sure...
> -# Patch libc.so and libpthread.so to force linking against libraries in 
> sysroot
> -# and not the ones installed on the build machine.
> -$(LIBS) : $(RPMS)
> -       @echo Patching libc and pthreads
> -  ...

Removed in new commit with a patch in above.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31227#discussion_r3327951512

Reply via email to