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

When suffixed with a version, llvm-strip is no longer recognized as llvm-strip #44616

Closed
nathanchance opened this issue Mar 22, 2020 · 10 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla tools:llvm-objcopy/strip

Comments

@nathanchance
Copy link
Member

Bugzilla Link 45271
Resolution FIXED
Resolved on Apr 13, 2020 13:24
Version 10.0
OS Windows NT
Blocks #44654
CC @alexshap,@zmodem,@MaskRay,@jh7370,@rupprecht
Fixed by commit(s) f2f96eb 50d7e5d

Extended Description

Debian's apt.llvm.org symlinks all of the LLVM binaries from /usr/lib/llvm-/bin to /usr/bin/<tool_name>- (e.g. /usr/lib/llvm-11/bin/clang -> /usr/bin/clang-11) so that multiple versions of clang can be installed and used at one time without stepping over each other.

After commit c54959c ("Introduce llvm-install-name-tool"), llvm-strip fails to work in this configuration (as initially reported at ClangBuiltLinux/linux#940):

llvm-strip-11: error: unknown argument '-o'

This is because 'strip' is required to be the ending to the binary after this change, whereas before the binary merely needed to contain 'strip'. I am not familiar enough with LLVM data structures to try and fix this myself, hence this report (maybe moving back to using sys::path::stem(...).contains(...)?).

Should you need to reproduce:

$ ln -s llvm-strip llvm-strip-11
$ echo | ./clang -c -x c - -o test.o
$ ./llvm-strip-11 -o test-stripped.o test.o
@nathanchance
Copy link
Member Author

assigned to @MaskRay

@jh7370
Copy link
Collaborator

jh7370 commented Mar 23, 2020

I've bumped the importance of this. Almost certainly this could silently break behaviour for one or more people out there, since it changes the default behaviour of the tool to work like llvm-objcopy.

https://reviews.llvm.org/D76562 addresses this.

@nathanchance
Copy link
Member Author

Should it be updated to block 44555 as well?

@jh7370
Copy link
Collaborator

jh7370 commented Mar 23, 2020

Should it be updated to block 44555 as well?

Makes sense. I've done so, although it might be too late to add another blocker to the LLVM 10 release (we've already had 5 RCs!).

@zmodem
Copy link
Collaborator

zmodem commented Mar 23, 2020

Should it be updated to block 44555 as well?

Makes sense. I've done so, although it might be too late to add another
blocker to the LLVM 10 release (we've already had 5 RCs!).

Yes, given that this has come up so late in the process, I think it will have to wait for 10.0.1.

@nathanchance
Copy link
Member Author

This has been fixed with f2f96eb, please cherry-pick it for 10.0.1.

@zmodem
Copy link
Collaborator

zmodem commented Mar 26, 2020

Re-opening to track this for 10.0.1.

@MaskRay
Copy link
Member

MaskRay commented Apr 12, 2020

Cherry-picked "[llvm-objcopy] Improve tool selection logic to recognize llvm-strip-$major as strip"
to release/10.x as commit f2f96eb

@tstellar
Copy link
Collaborator

Merged: 50d7e5d

@tstellar
Copy link
Collaborator

mentioned in issue #44654

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla tools:llvm-objcopy/strip
Projects
None yet
Development

No branches or pull requests

5 participants