-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Labels
lld:MachOquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
Hi, I was trying to link an iOS app using ReactiveObjC with ld64.lld
, and it fails with saying that there is undefined symbol begins with ___dtrace
. I tried to explore more using a C++ demo project, and it seems that ld64.lld does not support dtrace probed programs like ld64 does.
Here is my example:
FooProvider.d
provider Foo{
probe added(int);
};
main.cpp
#include "FooProvider.h"
class Foo{
public:
int test(){
if (FOO_ADDED_ENABLED()) {
FOO_ADDED(1);
};
}
};
int main() {
Foo foo = Foo();
int res = foo.test();
return 0;
}
How to compile:
dtrace -h -s FooProvider.d -o FooProvider.h
clang main.cpp FooProvider.h -fuse-ld=/Users/bytedance/github/llvm-project/build/bin/ld64.lld
And ld64.lld
gives the following error:
ld64.lld: error: undefined symbol: ___dtrace_probe$Foo$added$v1$696e74
>>> referenced by /var/folders/mc/j3dq2z114_l_cpcpjvnlywnr0000gp/T/main-4c3d7d.o
ld64.lld: error: undefined symbol: ___dtrace_isenabled$Foo$added$v1
>>> referenced by /var/folders/mc/j3dq2z114_l_cpcpjvnlywnr0000gp/T/main-4c3d7d.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
byohay
Metadata
Metadata
Assignees
Labels
lld:MachOquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!