Bug#928254: gcc-8: -static-libasan does not work with GNU MPFR

2019-05-02 Thread Vincent Lefevre
Control: reassign -1 libtool 2.4.6-10
Control: retitle -1 libtool: "Flags to be passed through unchanged" should 
include -static-libasan
Control: severity -1 normal

On 2019-05-02 10:10:33 +0200, Vincent Lefevre wrote:
> On 2019-05-01 20:54:05 +0200, Matthias Klose wrote:
> > the linker never sees your CFLAGS. At least -static-libasan needs to
> > be added to LDFLAGS.
> 
> Indeed, I can see -static-libasan in the "libtool --mode=link" line,
> but libtool drops this option in the gcc call:
> 
> /bin/sh ../libtool  --tag=CC   --mode=link gcc  -O0 -march=native 
> -fsanitize=address -static-libasan   -version-info 6:0:0 
> -Wl,--disable-new-dtags -o libmpfr.la -rpath /usr/local/lib [.lo files]  -lgmp
> libtool: link: gcc -shared  -fPIC -DPIC  [.o files]  -lgmp  -O0 -march=native 
> -fsanitize=address -Wl,--disable-new-dtags   -Wl,-soname -Wl,libmpfr.so.6 -o 
> .libs/libmpfr.so.6.0.0
> 
> Why does libtool do that, while it preserves
> "-O0 -march=native -fsanitize=address"?

I can see that the libtool script contains:

  # Flags to be passed through unchanged, with rationale:
  # -64, -mips[0-9]  enable 64-bit mode for the SGI compiler
  # -r[0-9][0-9]*specify processor for the SGI compiler
  # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
  # +DA*, +DD*   enable 64-bit mode for the HP compiler
  # -q*  compiler args for the IBM compiler
  # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
  # -F/path  path to uninstalled frameworks, gcc on darwin
  # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
  # -fstack-protector*   stack protector flags for GCC
  # @fileGCC response files
  # -tp=*Portland pgcc target processor selection
  # --sysroot=*  for sysroot support
  # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time 
optimization
  # -specs=* GCC specs files
  # -stdlib=*select c++ std lib with clang
  # -fsanitize=* Clang/GCC memory and address sanitizer
  # -fuse-ld=*   Linker select flags for GCC
  -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| 
\
  -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| 
\
  -specs=*|-fsanitize=*|-fuse-ld=*)
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
func_append compile_command " $arg"
func_append finalize_command " $arg"
func_append compiler_flags " $arg"
continue
;;

i.e. it misses the -static-libasan flag.

Reassigning to libtool.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Processed: Re: Bug#928254: gcc-8: -static-libasan does not work with GNU MPFR

2019-05-02 Thread Debian Bug Tracking System
Processing control commands:

> reassign -1 libtool 2.4.6-10
Bug #928254 [gcc-8] gcc-8: -static-libasan does not work with GNU MPFR
Bug reassigned from package 'gcc-8' to 'libtool'.
No longer marked as found in versions gcc-8/8.3.0-7.
Ignoring request to alter fixed versions of bug #928254 to the same values 
previously set
Bug #928254 [libtool] gcc-8: -static-libasan does not work with GNU MPFR
Marked as found in versions libtool/2.4.6-10.
> retitle -1 libtool: "Flags to be passed through unchanged" should include 
> -static-libasan
Bug #928254 [libtool] gcc-8: -static-libasan does not work with GNU MPFR
Changed Bug title to 'libtool: "Flags to be passed through unchanged" should 
include -static-libasan' from 'gcc-8: -static-libasan does not work with GNU 
MPFR'.
> severity -1 normal
Bug #928254 [libtool] libtool: "Flags to be passed through unchanged" should 
include -static-libasan
Severity set to 'normal' from 'minor'

-- 
928254: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=928254
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#928254: gcc-8: -static-libasan does not work with GNU MPFR

2019-05-02 Thread Vincent Lefevre
On 2019-05-01 20:54:05 +0200, Matthias Klose wrote:
> the linker never sees your CFLAGS. At least -static-libasan needs to
> be added to LDFLAGS.

Indeed, I can see -static-libasan in the "libtool --mode=link" line,
but libtool drops this option in the gcc call:

/bin/sh ../libtool  --tag=CC   --mode=link gcc  -O0 -march=native 
-fsanitize=address -static-libasan   -version-info 6:0:0 
-Wl,--disable-new-dtags -o libmpfr.la -rpath /usr/local/lib [.lo files]  -lgmp
libtool: link: gcc -shared  -fPIC -DPIC  [.o files]  -lgmp  -O0 -march=native 
-fsanitize=address -Wl,--disable-new-dtags   -Wl,-soname -Wl,libmpfr.so.6 -o 
.libs/libmpfr.so.6.0.0

Why does libtool do that, while it preserves
"-O0 -march=native -fsanitize=address"?

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#928254: gcc-8: -static-libasan does not work with GNU MPFR

2019-05-01 Thread Matthias Klose
On 30.04.19 19:05, Vincent Lefevre wrote:
> Package: gcc-8
> Version: 8.3.0-7
> Severity: minor
> 
> When I build and check GNU MPFR with:
> 
>   ./configure CFLAGS="-fsanitize=address -static-libasan"
>   make
>   make check
> 
> I get lots of failure with the error:
> 
>   Your application is linked against incompatible ASan runtimes.
> 
> Though -static-libasan has been used, there is still a dynamic libasan,
> as shown by ldd on a test program:
> 
> libasan.so.5 => /usr/lib/x86_64-linux-gnu/libasan.so.5 
> (0x7fdcf052d000)
> 
> This may be the cause of the issue.
> 
> If there is a limitation (due to the use of other shared libraries?),
> this should be mentioned in the gcc man page and manual.

the linker never sees your CFLAGS. At least -static-libasan needs to be added to
LDFLAGS.



Bug#928254: gcc-8: -static-libasan does not work with GNU MPFR

2019-04-30 Thread Vincent Lefevre
Package: gcc-8
Version: 8.3.0-7
Severity: minor

When I build and check GNU MPFR with:

  ./configure CFLAGS="-fsanitize=address -static-libasan"
  make
  make check

I get lots of failure with the error:

  Your application is linked against incompatible ASan runtimes.

Though -static-libasan has been used, there is still a dynamic libasan,
as shown by ldd on a test program:

libasan.so.5 => /usr/lib/x86_64-linux-gnu/libasan.so.5 
(0x7fdcf052d000)

This may be the cause of the issue.

If there is a limitation (due to the use of other shared libraries?),
this should be mentioned in the gcc man page and manual.

-- System Information:
Debian Release: 10.0
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 
'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-4-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=POSIX 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gcc-8 depends on:
ii  binutils  2.31.1-16
ii  cpp-8 8.3.0-7
ii  gcc-8-base8.3.0-7
ii  libc6 2.28-9
ii  libcc1-0  8.3.0-7
ii  libgcc-8-dev  8.3.0-7
ii  libgcc1   1:8.3.0-7
ii  libgmp10  2:6.1.2+dfsg-4
ii  libisl19  0.20-2
ii  libmpc3   1.1.0-1
ii  libmpfr6  4.0.2-1
ii  libstdc++68.3.0-7
ii  zlib1g1:1.2.11.dfsg-1

Versions of packages gcc-8 recommends:
ii  libc6-dev  2.28-9

Versions of packages gcc-8 suggests:
pn  gcc-8-doc 
ii  gcc-8-locales 8.3.0-7
ii  gcc-8-multilib8.3.0-7
pn  libasan5-dbg  
pn  libatomic1-dbg
pn  libgcc1-dbg   
pn  libgomp1-dbg  
pn  libitm1-dbg   
pn  liblsan0-dbg  
pn  libmpx2-dbg   
pn  libquadmath0-dbg  
pn  libtsan0-dbg  
pn  libubsan1-dbg 

-- no debconf information