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

GNU: use -Wl,-rpath,<dir> instead of -Wl,-R<dir> #214

Merged
merged 4 commits into from
Feb 13, 2024

Conversation

haampie
Copy link
Contributor

@haampie haampie commented Sep 26, 2023

The latter is supported in binutils for backwards compatibility, but in
general -R<path> is equivalent to --just-symbols=<path> when path
is a file; only when it's a directory, it's treated as -rpath=<path>.

Better avoid that ambiguity and use -rpath.

Also split -Wl,--enable-new-dtags and -Wl,-rpath,... into two
separate arguments, which is more common, and more likely to be parsed
correctly by compiler wrappers.

This commit does not attempt to add --enable-new-dtags to other
linkers than binutils ld/gold that support the flag.

The latter is supported in binutils for backwards compatibility, but in
general `-R<path>` is equivalent to `--just-symbols=<path>` when `path`
is a file; only when it's a directory, it's treated as `-rpath=<path>`.

Better avoid that ambiguity and use `-rpath`.

Also split `-Wl,--enable-new-dtags` and `-Wl,-rpath,...` into two
separate arguments, which is more common, and more likely to be parsed
correctly by compiler wrappers.

This commit does not attempt to add `--enable-new-dtags` to other
linkers than binutils ld/gold that support the flag.
@jaraco jaraco force-pushed the main branch 3 times, most recently from 12769e5 to d23e28a Compare November 5, 2023 15:55
@jaraco jaraco closed this Feb 12, 2024
@jaraco jaraco reopened this Feb 12, 2024
@jaraco jaraco closed this Feb 13, 2024
@jaraco jaraco reopened this Feb 13, 2024
@jaraco
Copy link
Member

jaraco commented Feb 13, 2024

After fixing the linter failures, there's still a test failure at distutils/tests/test_unixccompiler.py:156:

>       assert self.cc.rpath_foo() == '-Wl,--enable-new-dtags,-R/foo'
E       AssertionError: assert ['-Wl,--enable-new-dtags', '-Wl,-rpath,/foo'] == '-Wl,--enable-new-dtags,-R/foo'
E        +  where ['-Wl,--enable-new-dtags', '-Wl,-rpath,/foo'] = <bound method compiler_wrapper.<locals>.CompilerWrapper.rpath_foo of <distutils.tests.test_unixccompiler.compiler_wrapper.<locals>.CompilerWrapper object at 0x11a03b920>>()
E        +    where <bound method compiler_wrapper.<locals>.CompilerWrapper.rpath_foo of <distutils.tests.test_unixccompiler.compiler_wrapper.<locals>.CompilerWrapper object at 0x11a03b920>> = <distutils.tests.test_unixccompiler.compiler_wrapper.<locals>.CompilerWrapper object at 0x11a03b920>.rpath_foo
E        +      where <distutils.tests.test_unixccompiler.compiler_wrapper.<locals>.CompilerWrapper object at 0x11a03b920> = <distutils.tests.test_unixccompiler.TestUnixCCompiler object at 0x118158c80>.cc

@jaraco jaraco closed this Feb 13, 2024
@jaraco jaraco reopened this Feb 13, 2024
@jaraco jaraco merged commit 4504c68 into pypa:main Feb 13, 2024
22 of 36 checks passed
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.

2 participants