Bug 371061 - memcheck/tests/demangle has undefined references with clang
Summary: memcheck/tests/demangle has undefined references with clang
Status: RESOLVED NOT A BUG
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.12 SVN
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-18 06:45 UTC by Austin English
Modified: 2016-10-19 05:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Austin English 2016-10-18 06:45:46 UTC
clang -Winline -Wall -Wshadow -Wno-long-long -g -fno-stack-protector -Wno-unused-private-field     -m64    -o demangle demangle.o  
demangle.o: In function `main':
/home/austin/src/valgrind/memcheck/tests/demangle.cpp:25: undefined reference to `operator new(unsigned long)'
/home/austin/src/valgrind/memcheck/tests/demangle.cpp:27: undefined reference to `operator new(unsigned long)'
demangle.o: In function `magic<int>::xyzzy(int*)':
/home/austin/src/valgrind/memcheck/tests/demangle.cpp:19: undefined reference to `operator new(unsigned long)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:1917: recipe for target 'demangle' failed
make[5]: *** [demangle] Error 1
make[5]: Leaving directory '/tmp/valgrind-clang/memcheck/tests'

works with:
austin@debian-laptop:/tmp/valgrind-clang$ gcc --version
gcc (Debian 6.2.0-6) 6.2.0 20161010
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

fails with:
austin@debian-laptop:/tmp/valgrind-clang$ clang --version
clang version 3.8.1-12 (tags/RELEASE_381/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

r16070, debian sid.

Reproducible: Always

Steps to Reproduce:
1. ./configure CC=clang CXX=clang
2. make -j8
3. make check
Comment 1 Austin English 2016-10-19 05:40:07 UTC
User error, I had CC=clang / CXX=clang, when it should've been CC=clang CXX=clang++

So unless we want to add a sanity check to configure, this is invalid.