Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8257913: Add more known library locations to simplify Linux cross-compilation #2833



Copy link

@shipilev shipilev commented Mar 4, 2021

Current cross-compilation configurations require adding the whole lot of configure options to make it find the dependencies: freetype and X11 libs are the only problematic dependencies. We should be able to specify just the --with-sysroot, and get everything else autodetected.

After this patch, doing sh ./configure --openjdk-target=powerpc64le-linux-gnu --with-sysroot=/chroots/ppc64el, where chroot is debootstrap-ed chroot as per our build docs, is enough to get everything configured. See the GH Actions definition to see what options are not needed anymore.

Some explanations:

  • *-gnuabi64 is needed for mips64el
  • *-gnueabihf is needed for armhf
  • $OPENJDK_TARGET_CPU_AUTOCONF-linux-gnu is needed for powerpc*, because OpenJDK build rewrites VAR_CPU to ppc, leading to mismatch.

Additional testing:

  • Configure with target x86_64-linux-gnu
  • Configure with cross-target i686-linux-gnu
  • Configure with cross-target alpha-linux-gnu
  • Configure with cross-target aarch64-linux-gnu
  • Configure with cross-target arm-linux-gnueabihf
  • Configure with cross-target arm-linux-gnueabi
  • Configure with cross-target mipsel-linux-gnu
  • Configure with cross-target mips64el-linux-gnuabi64
  • Configure with cross-target powerpc-linux-gnu
  • Configure with cross-target powerpc64-linux-gnu
  • Configure with cross-target powerpc64le-linux-gnu
  • Configure with cross-target m68k-linux-gnu
  • Configure with cross-target sh4-linux-gnu


  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed


  • JDK-8257913: Add more known library locations to simplify Linux cross-compilation



$ git fetch pull/2833/head:pull/2833
$ git checkout pull/2833

Copy link

@bridgekeeper bridgekeeper bot commented Mar 4, 2021

👋 Welcome back shade! 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.

Copy link

@openjdk openjdk bot commented Mar 4, 2021

@shipilev The following labels will be automatically applied to this pull request:

  • 2d
  • build

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

@openjdk openjdk bot added 2d build labels Mar 4, 2021
Copy link
Contributor Author

@shipilev shipilev commented Mar 4, 2021

/label remove 2d

@openjdk openjdk bot removed the 2d label Mar 4, 2021
Copy link

@openjdk openjdk bot commented Mar 4, 2021

The 2d label was successfully removed.

@shipilev shipilev changed the title 8257913: Enable cross-compilation with only sysroot specified 8257913: Add more known library locations to simplify Linux cross-compilation Mar 4, 2021
@shipilev shipilev marked this pull request as ready for review Mar 4, 2021
@openjdk openjdk bot added the rfr label Mar 4, 2021
Copy link

@mlbridge mlbridge bot commented Mar 4, 2021


make/autoconf/lib-freetype.m4 Outdated Show resolved Hide resolved
erikj79 approved these changes Mar 5, 2021
Copy link

@erikj79 erikj79 left a comment

Looks good now and definitely a nice change to find these libs automatically.

Copy link

@openjdk openjdk bot commented Mar 5, 2021

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

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

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

8257913: Add more known library locations to simplify Linux cross-compilation

Reviewed-by: erikj

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 19 new commits pushed to the master branch:

  • e1cad97: 8262862: Harden tests sun/security/x509/URICertStore/ and krb5/canonicalize/
  • 2c0507e: 8261812: C2 compilation fails with assert(!had_error) failed: bad dominance
  • 9755782: 8157682: @inheritdoc doesn't work with @exception
  • 8c13d26: 8263050: move HtmlDocletWriter.verticalSeparator to IndexWriter
  • 8d3de4b: 8262844: (fs) FileStore.supportsFileAttributeView might return false negative in case of ext3
  • 75fb7cc: 8259228: Zero: rewrite (put|get)field from if-else chains to switches
  • 9730266: 8262973: Verify ParCompactionManager instance in PCAdjustPointerClosure
  • d91550e: 8262998: Vector API intrinsincs should not modify IR when bailing out
  • 80182f9: 8260925: HttpsURLConnection does not work with other JSSE provider.
  • dbef0ec: 6323374: (coll) Optimize Collections.unmodifiable* and synchronized*
  • ... and 9 more:

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 ready label Mar 5, 2021
Copy link
Contributor Author

@shipilev shipilev commented Mar 8, 2021


@openjdk openjdk bot closed this Mar 8, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Mar 8, 2021
Copy link

@openjdk openjdk bot commented Mar 8, 2021

@shipilev Since your change was applied there have been 29 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 61cff4d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@shipilev shipilev deleted the JDK-8257913-cross-only-sysroot branch Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
build integrated
3 participants