Bug 274106 - java/openjdk8: fix build with lld 17
Summary: java/openjdk8: fix build with lld 17
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-java (Nobody)
URL:
Keywords:
Depends on:
Blocks: 273753
  Show dependency treegraph
 
Reported: 2023-09-26 12:57 UTC by Dimitry Andric
Modified: 2023-10-06 17:56 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (java)


Attachments
java/openjdk8: fix build with lld 17 (680 bytes, patch)
2023-09-26 12:58 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2023-09-26 12:57:46 UTC
Building java/openjdk8 with lld 17 results in the following link error:

Making SA debugger back-end...
ld: error: version script assignment of 'SUNWprivate_1.1' to symbol 'ps_getpid' failed: symbol not defined
ld: error: version script assignment of 'SUNWprivate_1.1' to symbol 'ps_lcontinue' failed: symbol not defined
ld: error: version script assignment of 'SUNWprivate_1.1' to symbol 'ps_lgetxmmregs' failed: symbol not defined
ld: error: version script assignment of 'SUNWprivate_1.1' to symbol 'ps_lsetxmmregs' failed: symbol not defined
cc: error: linker command failed with exit code 1 (use -v to see invocation)

This is because lld 17 defaults to errors when undefined symbols are referenced in linker version scripts. Since there are many of these in openjdk 8, suppress the errors by adding -Wl,--undefined-version to the --with-extra-ldflags configure option.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-09-26 12:58:11 UTC
Created attachment 245252 [details]
java/openjdk8: fix build with lld 17
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-10-06 17:52:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a2f61c3e68e228e7d4186d18672da9d39218e289

commit a2f61c3e68e228e7d4186d18672da9d39218e289
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-09-26 08:45:29 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-10-06 17:48:54 +0000

    java/openjdk8: fix build with lld 17

    Building java/openjdk8 with lld 17 results in the following link error:

      Making SA debugger back-end...
      ld: error: version script assignment of 'SUNWprivate_1.1' to symbol 'ps_getpid' failed: symbol not defined
      ld: error: version script assignment of 'SUNWprivate_1.1' to symbol 'ps_lcontinue' failed: symbol not defined
      ld: error: version script assignment of 'SUNWprivate_1.1' to symbol 'ps_lgetxmmregs' failed: symbol not defined
      ld: error: version script assignment of 'SUNWprivate_1.1' to symbol 'ps_lsetxmmregs' failed: symbol not defined
      cc: error: linker command failed with exit code 1 (use -v to see invocation)

    This is because lld 17 defaults to errors when undefined symbols are
    referenced in linker version scripts. Since there are many of these in
    openjdk 8, suppress the errors by adding -Wl,--undefined-version to the
    --with-extra-ldflags configure option.

    PR:             274106
    Approved by:    maintainer timeout (10 days)
    MFH:            2023Q4

 java/openjdk8/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)