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

Pass --enable-new-dtags to GNU ld #30394

Merged
merged 1 commit into from
Dec 19, 2015
Merged

Pass --enable-new-dtags to GNU ld #30394

merged 1 commit into from
Dec 19, 2015

Conversation

geofft
Copy link
Contributor

@geofft geofft commented Dec 15, 2015

This causes the linker to emit DT_RUNPATH instead of DT_RPATH, which fixes #30378. See that bug for rationale.

@rust-highfive
Copy link
Collaborator

r? @Aatch

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

@geofft
Copy link
Contributor Author

geofft commented Dec 15, 2015

r? @alexcrichton probably.

@rust-highfive rust-highfive assigned alexcrichton and unassigned Aatch Dec 15, 2015
@alexcrichton
Copy link
Member

I'm not currently too savvy on the difference between these two options, so before I dive too much into it do you know the answers to these questions?

  • It looks like linker_is_gnu is turned on for many BSD platforms as well, do you know if this typically works over there?
  • Is this a new-enough option that a rustc-generated binary would no longer run on a super-ancient system? (e.g. the Rust compiler we're shipping, would it not run on systems like CentOS 5.5?)
  • Do you know when this option was added to the linker?

Thanks for the patch regardless! Seems like a good thing to tighten up

@Aatch
Copy link
Contributor

Aatch commented Dec 16, 2015

@alexcrichton looking at linked issue, it's fairly old. It says that glibc has supported it since 1999, so the flag is likely similarly old.

This causes the linker to emit DT_RUNPATH instead of DT_RPATH, which
fixes rust-lang#30378.
@geofft
Copy link
Contributor Author

geofft commented Dec 16, 2015

It looks like linker_is_gnu is turned on for many BSD platforms as well, do you know if this typically works over there?

Not authoritatively, but the interwebs are showing me man pages for GNU ld when I look for NetBSD, OpenBSD, or Dragonfly ld manpages, and all those manpages mention --enable-new-dtags. I'm less easily finding info on bitrig (they're using clang, I think, but probably not lld?). The only other linker_is_gnu target is le32-unknown-nacl, which I believe is also a GNU toolchain.

Is this a new-enough option that a rustc-generated binary would no longer run on a super-ancient system? (e.g. the Rust compiler we're shipping, would it not run on systems like CentOS 5.5?)

As @Aatch mentioned, yeah, the flag was added to glibc in 1999. So it's fine for every CentOS ever. Also, even if the dynamic linker doesn't support it, the effect is that rpaths don't work but the binary is otherwise fine; it doesn't create an un-runnable binary. (That said, GNU ld used to emit both DT_RPATH and DT_RUNPATH for compatibility until 2.24, which is recent enough to be in Ubuntu 14.04. In turn, ld.so ignores DT_RPATH if DT_RUNPATH is around.)

Do you know when this option was added to the linker?

July 2000, probably binutils 2.11 if I'm guessing right.

The trouble with naming a feature "new" is that it's going to continue to be named "new" for decades. :)

@alexcrichton
Copy link
Member

OK cool, that all sounds good to me! I agree that 2000 is pretty ancient at this point :)

@bors: r+ cec2d14

@bors
Copy link
Contributor

bors commented Dec 19, 2015

⌛ Testing commit cec2d14 with merge ef9a4df...

@bors
Copy link
Contributor

bors commented Dec 19, 2015

💔 Test failed - auto-mac-64-opt

@alexcrichton
Copy link
Member

@bors: retry

On Fri, Dec 18, 2015 at 10:14 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-mac-64-opt
http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/7448


Reply to this email directly or view it on GitHub
#30394 (comment).

@bors
Copy link
Contributor

bors commented Dec 19, 2015

⌛ Testing commit cec2d14 with merge 712ecce...

bors added a commit that referenced this pull request Dec 19, 2015
This causes the linker to emit DT_RUNPATH instead of DT_RPATH, which fixes #30378. See that bug for rationale.
@bors bors merged commit cec2d14 into rust-lang:master Dec 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use DT_RUNPATH instead of DT_RPATH for -C rpath
5 participants