Skip to content

8385123: Devkit for Linux x86_64 couldn't be built#31227

Open
YaSuenag wants to merge 3 commits into
openjdk:masterfrom
YaSuenag:devkit-x64
Open

8385123: Devkit for Linux x86_64 couldn't be built#31227
YaSuenag wants to merge 3 commits into
openjdk:masterfrom
YaSuenag:devkit-x64

Conversation

@YaSuenag
Copy link
Copy Markdown
Member

@YaSuenag YaSuenag commented May 21, 2026

I tried to build devkit for Linux x86_64, but I couldn't with following message:

configure: error: I suspect your system does not have 32-bit development libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.

Similar issue has been reported in JDK-8373624. We can remove 32 bit support based on JEP 503: Remove the 32-bit x86 Port, it means "disabling multilib" in configure error.



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8385123: Devkit for Linux x86_64 couldn't be built (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31227/head:pull/31227
$ git checkout pull/31227

Update a local copy of the PR:
$ git checkout pull/31227
$ git pull https://git.openjdk.org/jdk.git pull/31227/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31227

View PR using the GUI difftool:
$ git pr show -t 31227

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31227.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 21, 2026

👋 Welcome back ysuenaga! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 21, 2026

@YaSuenag This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8385123: Devkit for Linux x86_64 couldn't be built

Reviewed-by: mbaesken

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 97 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk Bot added the build build-dev@openjdk.org label May 21, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 21, 2026

@YaSuenag The following label will be automatically applied to this pull request:

  • build

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label May 21, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 21, 2026

Webrevs

Comment thread make/devkit/Tools.gmk
LINKER_CONFIG := --enable-gold=default
endif

# --enable-multilib would be specified to other than x86_64
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, do we really need it on Linux ppc64le ? @TheRealMDoerr , @ArnoZeller do you know ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not. I wonder which platforms really need it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not. I wonder which platforms really need it.

Maybe 32/64 bit ARM ? Not sure about this.

Copy link
Copy Markdown
Member Author

@YaSuenag YaSuenag May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could make devkit without --enable-multilib on AArch64, and it could be used with building JDK of course.
I'm not sure, but I guess we can remove it for all platforms (but I want to test on all platforms if we do, and I do not have all of them of course...)

@MBaesken
Copy link
Copy Markdown
Member

I think this makes sense; just one question - after JEP503 , do we want to still be able to create devkits that are used for older OpenJDK releases? Or is this out of scope?

@YaSuenag
Copy link
Copy Markdown
Member Author

do we want to still be able to create devkits that are used for older OpenJDK releases?

I think it is out of scope because we can use devkit in its repository (e.g. make/devkit in jdk11u-dev)

Comment thread make/devkit/Tools.gmk Outdated
Copy link
Copy Markdown
Member

@sendaoYan sendaoYan May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this needed after the 32bit x86 has been removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
-       @(for f in `find $(SYSROOT) -name libc.so -o -name libpthread.so`; do \
-         (cat $$f | sed -e 's|/usr/lib64/||g' \
-             -e 's|/usr/lib/||g' \
-             -e 's|/lib64/||g' \
-             -e 's|/lib/||g' ) > $$f.tmp ; \
-         mv $$f.tmp $$f ; \
-       done)
-       @mkdir -p $(SYSROOT)/usr/lib
-       @touch $@
-
 ################################################################################
 # Create links for ffi header files so that they become visible by default when using the
 # devkit.
@@ -702,8 +673,7 @@ MISSING_LINKS += $(PREFIX)/lib/bfd-plugins/liblto_plugin.so
 bfdlib : $(BFDLIB)
 binutils : $(BINUTILS)
 rpms : $(RPMS)
-libs : $(LIBS)
-sysroot : rpms libs
+sysroot : rpms
 gcc : sysroot $(GCC) $(GCC_PATCHED)
 gdb : $(GDB)
 all : binutils gcc bfdlib $(PREFIX)/devkit.info $(MISSING_LINKS) $(SYSROOT_LINKS) \
@@ -712,4 +682,4 @@ all : binutils gcc bfdlib $(PREFIX)/devkit.info $(MISSING_LINKS) $(SYSROOT_LINKS
 # this is only built for host. so separate.
 ccache : $(CCACHE)

-.PHONY : gcc all binutils bfdlib link_libs rpms libs sysroot
+.PHONY : gcc all binutils bfdlib link_libs rpms sysroot

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in new commit with a patch in above.

Comment thread make/devkit/Tools.gmk

# Create a TARGET bfd + libiberty only.
# Configure one or two times depending on mulitlib arch.
# If multilib, the second should be 32-bit, and we resolve
Copy link
Copy Markdown
Member

@sendaoYan sendaoYan May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this comment needed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether we can remove it so far.

I know you mentioned for the comment for BFD, but configure options for GCC, following architectures do not need to support 32 bit, in other words, other archs (e.g. aarch64) multilib might be enabled.

ifneq ($(filter riscv64 ppc64le s390x x86_64, $(ARCH)), )
  # We only support 64-bit on these platforms anyway
  CONFIG += --disable-multilib
endif

Comment thread make/devkit/Tools.gmk Outdated
@openjdk openjdk Bot changed the title 8385123: devkit for Linux x86_64 couldn't be built 8385123: Devkit for Linux x86_64 couldn't be built May 21, 2026
@erikj79
Copy link
Copy Markdown
Member

erikj79 commented May 21, 2026

do we want to still be able to create devkits that are used for older OpenJDK releases?

I think it is out of scope because we can use devkit in its repository (e.g. make/devkit in jdk11u-dev)

While I agree with this reasoning in principle, in practice it has been rather convenient for us to be able to just use devkits from mainline in update releases without the need to produce new ones, and consequently also not needed to maintain the devkit generator scripts in update release repositories. I don't have a clear opinion on this right now, I will need to discuss internally and get back.

@erikj79
Copy link
Copy Markdown
Member

erikj79 commented May 29, 2026

do we want to still be able to create devkits that are used for older OpenJDK releases?

I think it is out of scope because we can use devkit in its repository (e.g. make/devkit in jdk11u-dev)

While I agree with this reasoning in principle, in practice it has been rather convenient for us to be able to just use devkits from mainline in update releases without the need to produce new ones, and consequently also not needed to maintain the devkit generator scripts in update release repositories. I don't have a clear opinion on this right now, I will need to discuss internally and get back.

We agreed that dropping 32bit support in the devkit is the right way forward.

@YaSuenag
Copy link
Copy Markdown
Member Author

We agreed that dropping 32bit support in the devkit is the right way forward.

Ok, so I keep this PR.
I dropped 32 bit (IA32) support in new commit.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label May 31, 2026
@YaSuenag
Copy link
Copy Markdown
Member Author

YaSuenag commented Jun 1, 2026

@MBaesken Thanks for your review!

@erikj79 Can I integrate this now? This PR conflicts with #31303, and also I'm not sure we should push this to JDK 28 after RDP 1.

@erikj79
Copy link
Copy Markdown
Member

erikj79 commented Jun 1, 2026

Can I integrate this now? This PR conflicts with #31303, and also I'm not sure we should push this to JDK 28 after RDP 1.

I would prefer #31303 going in first and spend some more time getting this one right. There is no hurry or need for this to reach a particular JDK version, it just needs to end up in mainline eventually.

@erikj79
Copy link
Copy Markdown
Member

erikj79 commented Jun 1, 2026

I think the bug title needs to be updated to describe the actual action here, removing 32bit support for Linux devkits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build build-dev@openjdk.org ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

5 participants