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

disable LLD build for cross compiled hosts #71457

Closed
wants to merge 1 commit into from

Conversation

jclulow
Copy link
Contributor

@jclulow jclulow commented Apr 23, 2020

At present, the LLD build requested by the --enable-lld configure option
appears to make direct use of the "llvm-config" binary built as part of
the LLVM build. For cross built LLVM, the "llvm-config" binary produced
is intended to run on the target system, so it seems like this cannot
work as intended today. Disable the LLD build for cross compiled hosts,
while continuing to allow --enable-lld to build a native LLD for use by
targets like Fuchsia that expect to use it for linking.

At present, the LLD build requested by the --enable-lld configure option
appears to make direct use of the "llvm-config" binary built as part of
the LLVM build.  For cross built LLVM, the "llvm-config" binary produced
is intended to run on the target system, so it seems like this cannot
work as intended today.  Disable the LLD build for cross compiled hosts,
while continuing to allow --enable-lld to build a native LLD for use by
targets like Fuchsia that expect to use it for linking.
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 23, 2020
@jclulow
Copy link
Contributor Author

jclulow commented Apr 23, 2020

NOTE: This was chiefly motivated by bumping into this issue as part of work on #71272.

@jclulow
Copy link
Contributor Author

jclulow commented Apr 28, 2020

Hi! I'd like to continue moving on #71272. Would somebody be able to take a look at this PR, and tell me if my analysis is incorrect or if there's a better way I could work on fixing this? Thanks.

@mati865
Copy link
Contributor

mati865 commented Apr 28, 2020

#71486 should properly fix the issue. I'll test it and report later today.

@jclulow
Copy link
Contributor Author

jclulow commented Apr 28, 2020

Cool! Thank you!

@mati865
Copy link
Contributor

mati865 commented Apr 29, 2020

#71486 is now merged and the binary looks correct to me:

$ readelf -V obj/build/x86_64-unknown-illumos/lld/bin/lld
...
Version needs section '.gnu.version_r' contains 4 entries:
 Addr: 0x0000000000411308  Offset: 0x011308  Link: 4 (.dynstr)
  000000: Version: 1  File: libdl.so.1  Cnt: 1
  0x0010:   Name: SUNW_0.8  Flags: none  Version: 14
  0x0020: Version: 1  File: librt.so.1  Cnt: 3
  0x0030:   Name: SUNW_1.1  Flags: none  Version: 16
  0x0040:   Name: SUNW_1.2  Flags: none  Version: 13
  0x0050:   Name: SUNW_0.7  Flags: none  Version: 11
  0x0060: Version: 1  File: libm.so.2  Cnt: 2
  0x0070:   Name: SUNW_1.1  Flags: none  Version: 7
  0x0080:   Name: SUNW_1.2  Flags: none  Version: 3
  0x0090: Version: 1  File: libc.so.1  Cnt: 10
  0x00a0:   Name: SUNW_1.23  Flags: none  Version: 17
  0x00b0:   Name: SYSVABI_1.3  Flags: none  Version: 15
  0x00c0:   Name: SUNWprivate_1.1  Flags: none  Version: 12
  0x00d0:   Name: ILLUMOS_0.12  Flags: none  Version: 10
  0x00e0:   Name: SUNW_0.9  Flags: none  Version: 9
  0x00f0:   Name: SUNW_1.22  Flags: none  Version: 8
  0x0100:   Name: SUNW_1.1  Flags: none  Version: 6
  0x0110:   Name: ILLUMOS_0.8  Flags: none  Version: 5
  0x0120:   Name: SUNW_1.18  Flags: none  Version: 4
  0x0130:   Name: SUNW_0.7  Flags: none  Version: 2

@jclulow
Copy link
Contributor Author

jclulow commented May 2, 2020

Thanks @mati865! I have confirmed that #71486 appears to solve the problem for me. After dropping this patch and rebasing on what is now in master, my cross build of the illumos toolchain on a Linux host (for #71272) works as well.

@jclulow jclulow closed this May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants