Summary: | libglapi build failure with gcc -fsanitize=address | ||
---|---|---|---|
Product: | Mesa | Reporter: | Fabio Pedretti <pedretti.fabio> |
Component: | Other | Assignee: | mesa-dev |
Status: | RESOLVED NOTOURBUG | QA Contact: | |
Severity: | enhancement | ||
Priority: | lowest | ||
Version: | git | ||
Hardware: | All | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Fabio Pedretti
2014-02-21 11:12:44 UTC
Still failing: https://launchpadlibrarian.net/176111981/buildlog_ubuntu-trusty-amd64.mesa_10.3~git1405221557.5dd927~gd~t_FAILEDTOBUILD.txt.gz Same problem now with gcc 4.9.1: https://launchpadlibrarian.net/183028664/buildlog_ubuntu-utopic-i386.mesa_10.4~git1408232026.c2867f%2Bgallium-nine~gd~u_FAILEDTOBUILD.txt.gz It's probably an issue for libglapi only, since, for example, libmesautil links properly. I'm willing to blame the compiler for that one, but just in case can you run a verbose build in one of the failing directories - cd .... ; make V=1 Here is a log with a verbose build: https://launchpadlibrarian.net/183055341/buildlog_ubuntu-utopic-i386.mesa_10.4~git1408240813.8d8a5e%2Bgallium-nine~gd~u_FAILEDTOBUILD.txt.gz Note I get the same error with both i386 and amd64 builds. http://clang.llvm.org/docs/AddressSanitizer.html#usage > -Wl,-z,defs may cause link errors (don’t use it with AddressSanitizer). mesa links libglapi with -Wl,--no-undefined, which is the same thing as -Wl,-z,defs, and thus incompatible with asan, apparently? Probably, however according to this: http://llvm.org/bugs/show_bug.cgi?id=19162 it's an issue for clang only, while I a building with gcc. (In reply to comment #6) > Probably, however according to this: > http://llvm.org/bugs/show_bug.cgi?id=19162 > it's an issue for clang only, while I a building with gcc. Have you tried adding "-fsanitize=address" to the linker flags as mentioned here [1] ? [1] http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ I added it to LDFLAGS (see the LDFLAGS while calling configure), but libglapi still links without it: https://launchpadlibrarian.net/183064138/buildlog_ubuntu-utopic-i386.mesa_10.4~git1408241158.8d8a5e%2Bgallium-nine~gd~u_FAILEDTOBUILD.txt.gz (In reply to comment #8) > I added it to LDFLAGS (see the LDFLAGS while calling configure), but > libglapi still links without it: > https://launchpadlibrarian.net/183064138/buildlog_ubuntu-utopic-i386.mesa_10. > 4~git1408241158.8d8a5e%2Bgallium-nine~gd~u_FAILEDTOBUILD.txt.gz It should to be prefixed by "-Wl," otherwise libtool strips it out. LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-fsanitize=address" It is LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-fsanitize=address" But it doesn't work: checking for gcc... gcc checking whether the C compiler works... no configure: error: in `/build/buildd/mesa-10.4~git1408241235.8d8a5e+gallium/build/dri': configure: error: C compiler cannot create executables https://launchpadlibrarian.net/183065372/buildlog_ubuntu-utopic-amd64.mesa_10.4~git1408241235.8d8a5e%2Bgallium-nine~gd~u_FAILEDTOBUILD.txt.gz Indeed it does - it seems that it should be fed to gcc in link mode rather than the actual linker :\ I see a few of routes 1. append " -fsanitize=address" to your CC/CXX variable prior to executing configure, or 2. add a configure option and handle this internally in mesa (oh god not another configure switch) by adding "-Wc,-fsanitize=address" in all Makefiles, or 3. raise a bug with the libtool people so that they do not strip the it - i.e. extend the following switch statement. -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*|-flto*|-fwhopr*|-fuse-linker-plugin I would recommend #3, and use #1 as a workaround until it's resolved :) Marking this as NOTOURBUG for now as it seems to be a libtool issue. [1] http://www.gnu.org/software/libtool/manual/libtool.html#Stripped-link-flags I tried the workaround in 1., adding " -fsanitize=address" to CC and CXX, now it links with it, however for some reason it still fails with the same error: https://launchpadlibrarian.net/183204096/buildlog_ubuntu-utopic-i386.mesa_10.4~git1408261422.018875%2Bgallium-nine~gd~u_FAILEDTOBUILD.txt.gz (In reply to comment #12) > I tried the workaround in 1., adding " -fsanitize=address" to CC and CXX, > now it links with it, however for some reason it still fails with the same > error: > https://launchpadlibrarian.net/183204096/buildlog_ubuntu-utopic-i386.mesa_10. > 4~git1408261422.018875%2Bgallium-nine~gd~u_FAILEDTOBUILD.txt.gz Strange... from the above three suggestions 1 and 2 work like a charm on my Archlinux. If I have to speculate I would call it a gcc bug, yet it seem that we both have the same version - 4.9.1. Can you track it down if it's not a gcc/distro specific ? |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.