Skip to content

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

@zmodem

Description

@zmodem

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    lld:MachOquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions