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 # @file GCC 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 <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)