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

lld/mach-o with -exported_symbol emits "cannot export hidden symbol __llvm_profile_raw_version" after D135340 #58265

Closed
zmodem opened this issue Oct 10, 2022 · 2 comments
Labels
lld:MachO question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Comments

@zmodem
Copy link
Collaborator

zmodem commented Oct 10, 2022

In https://reviews.llvm.org/D135340 the __llvm_profile_raw_version and __llvm_profile_filename symbols which clang emits with -fprofile-generate were made hidden.

This caused lld/mach-o to start warning when building dylibs with -exported_symbols_list (or just -exported_symbol).

Here is a reproducer at 4ea1a64:

$ cat /tmp/a.cc
extern "C" int foo() { return 42; }

$ build/bin/clang -shared -fuse-ld=lld --target=x86_64-apple-macos -fprofile-generate -mmacos-version-min=10.13 -Wl,-exported_symbol,_foo -o /tmp/a.dylib /tmp/a.cc
ld64.lld: warning: cannot export hidden symbol __llvm_profile_raw_version
>>> defined in /tmp/a-edce60.o

ld64.lld: warning: cannot export hidden symbol __llvm_profile_filename
>>> defined in /tmp/a-edce60.o

Summoning some lld/mach-o folks: @speednoisemovement @gkmhub @int3

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 10, 2022

@llvm/issue-subscribers-lld-macho

@zmodem
Copy link
Collaborator Author

zmodem commented Oct 10, 2022

Alex figured it out in https://bugs.chromium.org/p/chromium/issues/detail?id=1373030#c8
The clang driver is explicitly asking for these to be exported when -Wl,-exported_symbols_list etc. are on the command line.

@zmodem zmodem closed this as completed Oct 10, 2022
@EugeneZelenko EugeneZelenko added the question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! label Oct 10, 2022
abrachet added a commit that referenced this issue Oct 13, 2022
This was reverted because it was breaking when targeting Darwin which
tried to export these symbols which are now hidden. It should be safe
to just stop attempting to export these symbols in the clang driver,
though Apple folks will need to change their TAPI allow list described
in the commit where these symbols were originally exported
f538018

Bug: #58265

Differential Revision: https://reviews.llvm.org/D135340
abrachet added a commit that referenced this issue Oct 24, 2022
This was reverted because it was breaking when targeting Darwin which
tried to export these symbols which are now hidden. It should be safe
to just stop attempting to export these symbols in the clang driver,
though Apple folks will need to change their TAPI allow list described
in the commit where these symbols were originally exported
f538018

Bug: #58265

Differential Revision: https://reviews.llvm.org/D135340
sid8123 pushed a commit to sid8123/llvm-project that referenced this issue Oct 25, 2022
This was reverted because it was breaking when targeting Darwin which
tried to export these symbols which are now hidden. It should be safe
to just stop attempting to export these symbols in the clang driver,
though Apple folks will need to change their TAPI allow list described
in the commit where these symbols were originally exported
llvm@f538018

Bug: llvm#58265

Differential Revision: https://reviews.llvm.org/D135340
abrachet added a commit that referenced this issue Oct 26, 2022
This was reverted because it was breaking when targeting Darwin which
tried to export these symbols which are now hidden. It should be safe
to just stop attempting to export these symbols in the clang driver,
though Apple folks will need to change their TAPI allow list described
in the commit where these symbols were originally exported
f538018

Then reverted again because it broke tests on MacOS, they should be
fixed now.

Bug: #58265

Differential Revision: https://reviews.llvm.org/D135340
virnarula pushed a commit to virnarula/llvm-project that referenced this issue Nov 2, 2022
This was reverted because it was breaking when targeting Darwin which
tried to export these symbols which are now hidden. It should be safe
to just stop attempting to export these symbols in the clang driver,
though Apple folks will need to change their TAPI allow list described
in the commit where these symbols were originally exported
llvm@f538018

Bug: llvm#58265

Differential Revision: https://reviews.llvm.org/D135340
virnarula pushed a commit to virnarula/llvm-project that referenced this issue Nov 2, 2022
This was reverted because it was breaking when targeting Darwin which
tried to export these symbols which are now hidden. It should be safe
to just stop attempting to export these symbols in the clang driver,
though Apple folks will need to change their TAPI allow list described
in the commit where these symbols were originally exported
llvm@f538018

Then reverted again because it broke tests on MacOS, they should be
fixed now.

Bug: llvm#58265

Differential Revision: https://reviews.llvm.org/D135340
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue May 28, 2024
This was reverted because it was breaking when targeting Darwin which
tried to export these symbols which are now hidden. It should be safe
to just stop attempting to export these symbols in the clang driver,
though Apple folks will need to change their TAPI allow list described
in the commit where these symbols were originally exported
llvm/llvm-project@f538018

Bug: llvm/llvm-project#58265

Differential Revision: https://reviews.llvm.org/D135340
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lld:MachO question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Projects
None yet
Development

No branches or pull requests

3 participants