sanitizers do not work with gold linker

Bug #1650186 reported by Eugene
6
This bug affects 1 person
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://stackoverflow.com/questions/37603238/fsanitize-not-using-gold-linker-in-gcc-6-1
They say it's fixed in 16.04, but it doesn't fixed in 16.10

Revision history for this message
Matthias Klose (doko) wrote :

fixed in 18.04 LTS and 20.04 LTS.

Changed in gcc-defaults (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.