[PATCH] D17607: [ELF] - Create _DYNAMIC symbol for dynamic output
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 26 03:37:02 PST 2016
grimar added a comment.
In http://reviews.llvm.org/D17607#361776, @emaste wrote:
> I'm seeing strange test failures in my self-hosted lld testrun with this patch applied.
Hello Ed,
I just checked twice that able to self host with this patch. I am using the latest source code available for llvm,clang and lld.
**Stage 1** (output to /home/umb/LLVM/build):
At first I configured the build using:
-DCMAKE_BUILD_TYPE=Release -DLLVM_PARALLEL_COMPILE_JOBS=8 -DLLVM_ENABLE_THREADS=true
It shows:
- The C compiler identification is GNU 4.9.2
- The CXX compiler identification is GNU 4.9.2
...
ninja lld, ninja check-lld works fine here.
**Stage 2** (output to /home/umb/LLVM/selfhost):
Then I am configuring it for self-hosting using the binaries from stage 1:
-DCMAKE_CXX_FLAGS="-std=c++11 -fuse-ld=lld -Wl,--gc-sections" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-fuse-ld=lld -DCMAKE_C_COMPILER=/home/umb/LLVM/build/bin/clang -DLLVM_PARALLEL_COMPILE_JOBS=8 -DLLVM_ENABLE_THREADS=true -DCMAKE_CXX_COMPILER=/home/umb/LLVM/build/bin/clang++
It shows:
- The C compiler identification is Clang 3.9.0
- The CXX compiler identification is Clang 3.9.0
and uses lld from stage 1 for linkage.
...
I have no troubles with ninja check-lld at this stage either:
umb at ubuntu:~/LLVM/selfhost$ ninja check-lld
[1/1] Running lld test suite
-- Testing: 1105 tests, 8 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 4.64s
Expected Passes : 1094
Expected Failures : 1
Unsupported Tests : 10
umb at ubuntu:~/LLVM/selfhost$
I looked at differences of bfd/gold/lld output and found the next:
gold output:
Num: Value Size Type Bind Vis Ndx Name
1: 00000000000011e0 176 OBJECT LOCAL HIDDEN 5 _DYNAMIC
bfd output:
6: 00000000002001a8 0 OBJECT LOCAL DEFAULT 5 _DYNAMIC
lld output:
1: 0000000000001000 0 NOTYPE LOCAL HIDDEN 5 _DYNAMIC
It seems nobody remembers why _DYNAMIC was made as object in binutils:
https://sourceware.org/ml/binutils/2002-03/msg00360.html
I am not sure if we should make it STT_OBJECT as there are seems to be no
real reasons for that.
Also there is no reason to make it hidden as bfd does not do that. Making
it default simplies the code a bit.
About why it is no able to selfhost for you - I have no ideas now, any suggestions are welcome.
http://reviews.llvm.org/D17607
More information about the llvm-commits
mailing list