[Bug 1650186] Re: sanitizers do not work with gold linker

Matthias Klose 1650186 at bugs.launchpad.net
Tue Mar 9 13:58:22 UTC 2021


fixed in 18.04 LTS and 20.04 LTS.

** Changed in: gcc-defaults (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/1650186

Title:
  sanitizers do not work with gold linker

Status in gcc-defaults package in Ubuntu:
  Fix Released

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1650186/+subscriptions



More information about the foundations-bugs mailing list