sanitizers do not work with gold linker
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-defaults (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.10
Release: 16.10
Codename: yakkety
$ g++ --version
g++ (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
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.
$ ld --version
GNU gold (GNU Binutils for Ubuntu 2.27) 1.12
Copyright (C) 2016 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
$ cat test_tsan_gcc.cc
int main() { return 0; }
$ g++ -fsanitize=thread test_tsan_gcc.cc
/usr/bin/ld: --push-state: unknown option
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
$ g++ -fsanitize=address test_tsan_gcc.cc
/usr/bin/ld: --push-state: unknown option
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
Works fine:
$ g++ -fsanitize=address -fuse-ld=gold test_tsan_gcc.cc
$ g++ -fsanitize=thread -fuse-ld=gold test_tsan_gcc.cc
The same problem as here http://
They say it's fixed in 16.04, but it doesn't fixed in 16.10
fixed in 18.04 LTS and 20.04 LTS.