Mesa fails to build with gcc address sanitizer (-fsanitize=address -lasan)
Submitted by Vedran Miletić
Assigned to mes..@..op.org
Link to original bug (#100120)
Description
$ git clone ...
$ ./autogen.sh CFLAGS="-fsanitize=address" CXXFLAGS="-fsanitize=address" LIBS="-lasan"
$ make -j
(...)
make[4]: Entering directory '/home/vedranm/workspace/mesa/src/glx'
CCLD libGL.la
./.libs/libglx.a(dri_common.o): In function driOpenDriver': dri_common.c:(.text+0x528): undefined reference to
dlerror'
./.libs/libglx.a(dri_common.o): In function driGetDriverExtensions': dri_common.c:(.text+0x6b8): undefined reference to
dlsym'
dri_common.c:(.text+0x6dc): undefined reference to dlerror' dri_common.c:(.text+0x71e): undefined reference to
dlsym'
dri_common.c:(.text+0x72e): undefined reference to dlerror' ./.libs/libglx.a(dri_glx.o): In function
glXGetDriverConfig':
dri_glx.c:(.text+0x76f): undefined reference to dlsym' ./.libs/libglx.a(dri_glx.o): In function
driCreateScreen':
dri_glx.c:(.text+0x3977): undefined reference to dlsym' dri_glx.c:(.text+0x398d): undefined reference to
dlerror'
collect2: error: ld returned 1 exit status
Makefile:808: recipe for target 'libGL.la' failed
make[4]: *** [libGL.la] Error 1
make[4]: Leaving directory '/home/vedranm/workspace/mesa/src/glx'
Makefile:902: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/vedranm/workspace/mesa/src/glx'
Makefile:856: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/vedranm/workspace/mesa/src'
Makefile:647: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/vedranm/workspace/mesa/src'
Makefile:644: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
Version: git