On Fri, Nov 14, 2014 at 12:31 PM, Uros Bizjak wrote: >> Here is one more merge of libsanitizer (last one was in Sept). >> >> Tested on x86_64 Ubuntu 14.04 like this: >> rm -rf */{*/,}libsanitizer && make -j 50 >> make -j 40 -C gcc check-g{cc,++} >> RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} asan.exp' && \ >> make -j 40 -C gcc check-g{cc,++} >> RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} tsan.exp' && \ >> make -j 40 -C gcc check >> RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} ubsan.exp' && \ >> echo PASS >> >> Expected ChangeLog entry: >> >> 2014-11-12 Kostya Serebryany >> >> * All source files: Merge from upstream r221802. >> * sanitizer_common/sanitizer_symbolizer_libbacktrace.cc >> (LibbacktraceSymbolizer::SymbolizeData): replace 'address' >> with 'start' to follow the new interface. >> * asan/Makefile.am (AM_CXXFLAGS): added -std=c++11. >> * interception/Makefile.am (AM_CXXFLAGS): added -std=c++11. >> * libbacktrace/Makefile.am (AM_CXXFLAGS): added -std=c++11. >> * lsan/Makefile.am (AM_CXXFLAGS): added -std=c++11. >> * sanitizer_common/Makefile.am (sanitizer_common_files): Added new >> files. >> (AM_CXXFLAGS): added -std=c++11. >> * tsan/Makefile.am (AM_CXXFLAGS): added -std=c++11. >> * ubsan/Makefile.am (AM_CXXFLAGS): added -std=c++11. >> * asan/Makefile.in: Regenerate. >> * interception/Makefile.in: Regenerate. >> * libbacktrace/Makefile.in: Regenerate. >> * lsan/Makefile.in: Regenerate. >> * sanitizer_common/Makefile.in: Regenerate. >> * tsan/Makefile.in: Regenerate. >> * ubsan/Makefile.in: Regenerate. > > This patch breaks CENTOS5 build with: > > In file included from /usr/include/asm-x86_64/byteorder.h:30:0, > from /usr/include/asm/byteorder.h:5, > from /usr/include/linux/aio_abi.h:30, > from > /home/uros/gcc-svn/trunk/libsanitizer/include/system/linux/aio_abi.h:2, > from > ../../../../gcc-svn/trunk/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc:49: > /usr/include/linux/byteorder/little_endian.h:43:19: error: ‘__le64’ > does not name a type > static __inline__ __le64 __cpu_to_le64p(const __u64 *p) > ^ > /usr/include/linux/byteorder/little_endian.h:47:46: error: ‘__le64’ > does not name a type > static __inline__ __u64 __le64_to_cpup(const __le64 *p) > ^ > /usr/include/linux/byteorder/little_endian.h:67:19: error: ‘__be64’ > does not name a type > static __inline__ __be64 __cpu_to_be64p(const __u64 *p) > ^ > /usr/include/linux/byteorder/little_endian.h:71:46: error: ‘__be64’ > does not name a type > static __inline__ __u64 __be64_to_cpup(const __be64 *p) > ^ > gmake[4]: *** [sanitizer_platform_limits_linux.lo] Error 1 > gmake[4]: Leaving directory > `/home/uros/gcc-build/x86_64-unknown-linux-gnu/libsanitizer/sanitizer_common' > gmake[3]: *** [all-recursive] Error 1 > gmake[3]: Leaving directory > `/home/uros/gcc-build/x86_64-unknown-linux-gnu/libsanitizer' > gmake[2]: *** [all] Error 2 > gmake[2]: Leaving directory > `/home/uros/gcc-build/x86_64-unknown-linux-gnu/libsanitizer' > gmake[1]: *** [all-target-libsanitizer] Error 2 The missing definition in system's /usr/include/linux/types.h is protected with: typedef __u16 __bitwise __le16; typedef __u16 __bitwise __be16; typedef __u32 __bitwise __le32; typedef __u32 __bitwise __be32; #if defined(__GNUC__) && !defined(__STRICT_ANSI__) typedef __u64 __bitwise __le64; typedef __u64 __bitwise __be64; #endif which doesn't work with -std=c++11, but works without problems with -std=gnu++11. As proposed by Jakub at [1], -std=gnu++11 fixes the problem with old kernels. Attached patch implements this proposal. 2014-11-14 Uros Bizjak * sanitizer_common/Makefile.am (AM_CXXFLAGS): Use -std=gnu++11. * asan/Makefile.am (AM_CXXFLAGS): Ditto. * lsan/Makefile.am (AM_CXXFLAGS): Ditto. * interception/Makefile.am (AM_CXXFLAGS): Ditto. * tsan/Makefile.am (AM_CXXFLAGS): Ditto. * libbacktrace/Makefile.am (AM_CXXFLAGS): Ditto. * ubsan/Makefile.am (AM_CXXFLAGS): Ditto. * sanitizer_common/Makefile.in: Regenerate. * asan/Makefile.in: Ditto. * lsan/Makefile.in: Ditto. * interception/Makefile.in: Ditto. * tsan/Makefile.in: Ditto. * libbacktrace/Makefile.in: Ditto. * ubsan/Makefile.in: Ditto. Bootstrapped and regtested on CENTOS 5 x86_64-linux-gnu. [1] https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01420.html Uros.