Open Quuxplusone opened 6 years ago
Bugzilla Link | PR38894 |
Status | CONFIRMED |
Importance | P normal |
Reported by | Mike Coyle (michael.coyle@newwavedv.com) |
Reported on | 2018-09-10 10:50:23 -0700 |
Last modified on | 2018-10-24 22:25:07 -0700 |
Version | unspecified |
Hardware | Other Linux |
CC | llvm-bugs@lists.llvm.org, phosek@chromium.org, tstellar@redhat.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
I used
cmake -G Ninja
to create this failure.
Am now rebuilding without Ninja, just to see if using *nix makefiles has the
same failure mode.
Same failure under make as under ninja:
[100%] Generating Fuzzer-x86_64-Test
/mnt/raid5_a/llvm/build-makefiles/projects/compiler-
rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++.a(stdexcept.cpp.o): In function
`std::logic_error::logic_error(char const*)':
stdexcept.cpp:(.text+0x620): multiple definition of
`std::logic_error::logic_error(char const*)'
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-
linux/7/libstdc++_nonshared.a(cow-
stdexcept.o):(.text._ZNSt11logic_errorC2EPKc+0x0): first defined here
/mnt/raid5_a/llvm/build-makefiles/projects/compiler-
rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++.a(stdexcept.cpp.o): In function
`std::logic_error::logic_error(char const*)':
stdexcept.cpp:(.text+0x620): multiple definition of
`std::logic_error::logic_error(char const*)'
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-
linux/7/libstdc++_nonshared.a(cow-
stdexcept.o):(.text._ZNSt11logic_errorC2EPKc+0x0): first defined here
/mnt/raid5_a/llvm/build-makefiles/projects/compiler-
rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++.a(stdexcept.cpp.o): In function
`std::logic_error::logic_error(std::logic_error const&)':
stdexcept.cpp:(.text+0x680): multiple definition of
`std::logic_error::logic_error(std::logic_error const&)'
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-
linux/7/libstdc++_nonshared.a(cow-
stdexcept.o):(.text._ZNSt11logic_errorC2ERKS_+0x0): first defined here
/mnt/raid5_a/llvm/build-makefiles/projects/compiler-
rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++.a(stdexcept.cpp.o): In function
`std::logic_error::logic_error(std::logic_error const&)':
stdexcept.cpp:(.text+0x680): multiple definition of
`std::logic_error::logic_error(std::logic_error const&)'
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-
linux/7/libstdc++_nonshared.a(cow-
stdexcept.o):(.text._ZNSt11logic_errorC2ERKS_+0x0): first defined here
/mnt/raid5_a/llvm/build-makefiles/projects/compiler-
rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++.a(stdexcept.cpp.o): In function
`std::logic_error::operator=(std::logic_error const&)':
stdexcept.cpp:(.text+0x6a0): multiple definition of
`std::logic_error::operator=(std::logic_error const&)'
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-
linux/7/libstdc++_nonshared.a(cow-
stdexcept.o):(.text._ZNSt11logic_erroraSERKS_+0x0): first defined here
/mnt/raid5_a/llvm/build-makefiles/projects/compiler-
rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++.a(stdexcept.cpp.o): In function
`std::runtime_error::runtime_error(char const*)':
stdexcept.cpp:(.text+0x750): multiple definition of
`std::runtime_error::runtime_error(char const*)'
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-
linux/7/libstdc++_nonshared.a(cow-
stdexcept.o):(.text._ZNSt13runtime_errorC2EPKc+0x0): first defined here
/mnt/raid5_a/llvm/build-makefiles/projects/compiler-
rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++.a(stdexcept.cpp.o): In function
`std::runtime_error::runtime_error(char const*)':
stdexcept.cpp:(.text+0x750): multiple definition of
`std::runtime_error::runtime_error(char const*)'
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-
linux/7/libstdc++_nonshared.a(cow-
stdexcept.o):(.text._ZNSt13runtime_errorC2EPKc+0x0): first defined here
/mnt/raid5_a/llvm/build-makefiles/projects/compiler-
rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++.a(stdexcept.cpp.o): In function
`std::runtime_error::runtime_error(std::runtime_error const&)':
stdexcept.cpp:(.text+0x7b0): multiple definition of
`std::runtime_error::runtime_error(std::runtime_error const&)'
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-
linux/7/libstdc++_nonshared.a(cow-
stdexcept.o):(.text._ZNSt13runtime_errorC2ERKS_+0x0): first defined here
/mnt/raid5_a/llvm/build-makefiles/projects/compiler-
rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++.a(stdexcept.cpp.o): In function
`std::runtime_error::runtime_error(std::runtime_error const&)':
stdexcept.cpp:(.text+0x7b0): multiple definition of
`std::runtime_error::runtime_error(std::runtime_error const&)'
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-
linux/7/libstdc++_nonshared.a(cow-
stdexcept.o):(.text._ZNSt13runtime_errorC2ERKS_+0x0): first defined here
/mnt/raid5_a/llvm/build-makefiles/projects/compiler-
rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++.a(stdexcept.cpp.o): In function
`std::runtime_error::operator=(std::runtime_error const&)':
stdexcept.cpp:(.text+0x7d0): multiple definition of
`std::runtime_error::operator=(std::runtime_error const&)'
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-
linux/7/libstdc++_nonshared.a(cow-
stdexcept.o):(.text._ZNSt13runtime_erroraSERKS_+0x0): first defined here
clang-8: error: linker command failed with exit code 1 (use -v to see
invocation)
make[3]: *** [projects/compiler-rt/lib/fuzzer/tests/CMakeFiles/TFuzzer-x86_64-
Test.dir/build.make:64: projects/compiler-rt/lib/fuzzer/tests/Fuzzer-x86_64-
Test] Error 1
make[2]: *** [CMakeFiles/Makefile2:31715: projects/compiler-
rt/lib/fuzzer/tests/CMakeFiles/TFuzzer-x86_64-Test.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
What arguments did you pass to cmake when configuring compiler-rt and also llvm if you built that yourself?
It looks like the problem is that it is linking against libstdc++ and libc++, but I'll still need the cmake arguments to try to reproduce.
All build from scratch following https://llvm.org/docs/GettingStarted.html#git-
mirror scripted as follows:
[mcoyle@dut llvm]$ more clone.sh
git clone https://git.llvm.org/git/llvm.git/
cd llvm/tools
git clone https://git.llvm.org/git/clang.git/
cd ../projects
git clone https://git.llvm.org/git/compiler-rt.git/
git clone https://git.llvm.org/git/libcxx.git/
git clone https://git.llvm.org/git/libcxxabi.git/
git clone https://git.llvm.org/git/test-suite.git/
[mcoyle@dut llvm]$ more build-ninja.sh
rm -rf build
mkdir build
cd build
cmake ../llvm -G Ninja
ninja-build
ninja-build check-all
Are you building on RHEL or CentOS?
On RHEL 7.5
(In reply to Mike Coyle from comment #7)
> On RHEL 7.5
Not sure if this helps you at all, but llvm and clang packages are available
for RHEL[1]. libfuzzer is shipped as part of the llvm-toolset-7-compiler-rt
package.
I will still look into your issues building with trunk.
[1] https://developers.redhat.com/blog/2018/07/07/yum-install-gcc7-clang/
Petr, It looks like you added libc++ support to the fuzzer in r322604. The problem here is that the unit tests are trying to link against both libstdc++ and libc++. Note that with the devtoolset toolchain on RHEL, libstdc++ is split into 2 libraries, a shared library that is ABI compatible with libstdc++ from gcc 4.8.5 and a static library which contains all the new features added to the library between 4.8.5 and gcc 7.3.1.
Do you have any suggestions for how to fix this?
Mike, is there any particular reason why you are trying to build libc++? Is there some reason why libstdc++ won't work for the codebase you are planning to build with clang?