Address sanitizer is not needed and it may causes build fails for gcc. I'd like propose --disable-libsanitizer with USE sanitizer Reproducible: Always
We don't generally add USE flags for features that don't require additional dependencies unless there's a real reason for it. What kind of build failures are you talking about?
it does not build with musl and probably also others (uclibc etc.). also code quality is much lower than rest of gcc (words of musl-libc developers) musl-libc is full-featured alternative to glibc, which is strictly POSIX compilant.
Okay, that sounds reasonable.
I wonder if it wouldn't be better to add a target triplet for musl to libsanitizer/configure.tgt marking it unsupported. That could at least go upstream.
I think MIPS target does not implement sanitizer. GCC 4.8 changelog lists IA-32/x86-64/x32/PowerPC/PowerPC64, GCC 4.9 adds ARM. Because sanitizer is enabled by default, I got a failure when cross-building cross-mips64el-unknown-linux-gnu/gcc-4.8.3: /var/tmp/portage/cross-mips64el-unknown-linux-gnu/gcc-4.8.3/work/gcc-4.8.3/libsanitizer/sanitizer_common/sanitizer_linux.cc: In function ‘void* __sanitizer::internal_ mmap(void*, __sanitizer::uptr, int, int, int, __sanitizer::u64)’: /var/tmp/portage/cross-mips64el-unknown-linux-gnu/gcc-4.8.3/work/gcc-4.8.3/libsanitizer/sanitizer_common/sanitizer_linux.cc:57:26: error: ‘__NR_mmap2’ was not declare d in this scope return (void *)syscall(__NR_mmap2, addr, length, prot, flags, fd, offset);
*** Bug 525174 has been marked as a duplicate of this bug. ***
/var/tmp/portage/cross-hppa2.0-unknown-linux-gnu/gcc-4.8.3/work/gcc-4.8.3/libsanitizer/asan/asan_linux.cc:90:3: error: #error "Unsupported arch"
Also broken with cross-mingw32: /tmp/portage/cross-mingw32/gcc-4.8.3/work/gcc-4.8.3/libsanitizer/interception/interception_win.cc: In function 'void __interception::WriteJumpInstruction(char*, char*)': /tmp/portage/cross-mingw32/gcc-4.8.3/work/gcc-4.8.3/libsanitizer/interception/interception_win.cc:52:3: error: 'ptrdiff_t' was not declared in this scope /tmp/portage/cross-mingw32/gcc-4.8.3/work/gcc-4.8.3/libsanitizer/interception/interception_win.cc:52:13: error: expected ';' before 'offset' /tmp/portage/cross-mingw32/gcc-4.8.3/work/gcc-4.8.3/libsanitizer/interception/interception_win.cc:54:15: error: expected primary-expression before ')' token /tmp/portage/cross-mingw32/gcc-4.8.3/work/gcc-4.8.3/libsanitizer/interception/interception_win.cc:54:33: error: 'offset' was not declared in this scope
(In reply to Andrew Church from comment #8) > Also broken with cross-mingw32: That would be bug #525910.
*** Bug 526142 has been marked as a duplicate of this bug. ***
*** Bug 511712 has been marked as a duplicate of this bug. ***
i've masked it for everyone: http://sources.gentoo.org/profiles/base/package.use.mask?r1=1.617&r2=1.618 and then unmasked it for the few targets that support it: http://sources.gentoo.org/profiles/default/linux/amd64/package.use.mask?rev=1.3 http://sources.gentoo.org/profiles/default/linux/arm/package.use.mask?rev=1.1 http://sources.gentoo.org/profiles/default/linux/powerpc/package.use.mask?rev=1.7 http://sources.gentoo.org/profiles/default/linux/sparc/package.use.mask?rev=1.3 http://sources.gentoo.org/profiles/default/linux/x86/package.use.mask?rev=1.1
How about the hardened targets that support it?
(In reply to Emil Medve from comment #13) i don't know what you mean
(In reply to SpanKY from comment #14) > (In reply to Emil Medve from comment #13) > > i don't know what you mean The hardened/ profiles now have USE=sanitize masked.
(In reply to Jeroen Roovers from comment #15) > (In reply to SpanKY from comment #14) > > (In reply to Emil Medve from comment #13) > > > > i don't know what you mean > > The hardened/ profiles now have USE=sanitize masked. FYI, asan is broken on a PaX hardened kernel, see bug #458706, so if we have a flag turning it on, we need it masked on hardened.
(In reply to Ryan Hill from comment #4) > I wonder if it wouldn't be better to add a target triplet for musl to > libsanitizer/configure.tgt marking it unsupported. That could at least go > upstream. That's a good idea. For now I've just package.use.mask-ed it on the musl profiles.
(In reply to Anthony Basile from comment #16) > (In reply to Jeroen Roovers from comment #15) > > (In reply to SpanKY from comment #14) > > > (In reply to Emil Medve from comment #13) > > > > > > i don't know what you mean > > > > The hardened/ profiles now have USE=sanitize masked. > > FYI, asan is broken on a PaX hardened kernel, see bug #458706, so if we have > a flag turning it on, we need it masked on hardened. If I understand this well, using a PaX kernel is somewhat orthogonal on the various configuration bits a hardened profile pulls in
(In reply to Emil Medve from comment #18) > (In reply to Anthony Basile from comment #16) > > (In reply to Jeroen Roovers from comment #15) > > > (In reply to SpanKY from comment #14) > > > > (In reply to Emil Medve from comment #13) > > > > > > > > i don't know what you mean > > > > > > The hardened/ profiles now have USE=sanitize masked. > > > > FYI, asan is broken on a PaX hardened kernel, see bug #458706, so if we have > > a flag turning it on, we need it masked on hardened. > > If I understand this well, using a PaX kernel is somewhat orthogonal on the > various configuration bits a hardened profile pulls in There's tool chain hardening and kernel hardening. The profiles have both and you cannot easily disentangle the two. Thus hardened profiles implies hardened toolchain and kernel.
(In reply to Anthony Basile from comment #19) > (In reply to Emil Medve from comment #18) > > (In reply to Anthony Basile from comment #16) > > > (In reply to Jeroen Roovers from comment #15) > > > > (In reply to SpanKY from comment #14) > > > > > (In reply to Emil Medve from comment #13) > > > > > > > > > > i don't know what you mean > > > > > > > > The hardened/ profiles now have USE=sanitize masked. > > > > > > FYI, asan is broken on a PaX hardened kernel, see bug #458706, so if we have > > > a flag turning it on, we need it masked on hardened. > > > > If I understand this well, using a PaX kernel is somewhat orthogonal on the > > various configuration bits a hardened profile pulls in > > There's tool chain hardening and kernel hardening. The profiles have both > and you cannot easily disentangle the two. Thus hardened profiles implies > hardened toolchain and kernel. There is a pax_kernel use flag, which is used in other cases to distinguish between building with a hardened tool chain and running a PaX kernel. Not saying that this flag should be used here, just throwing it in as an option.
libtool: compile: /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/./gcc/xgcc -shared-libgcc -B/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/./gcc -nostdinc++ -L/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/mips-linux-uclibc/libstdc++-v3/src -L/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/mips-linux-uclibc/libstdc++-v3/src/.libs -B/usr/mips-linux-uclibc/bin/ -B/usr/mips-linux-uclibc/lib/ -isystem /usr/mips-linux-uclibc/include -isystem /usr/mips-linux-uclibc/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DASAN_HAS_EXCEPTIONS=1 -DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 -DASAN_NEEDS_SEGV=1 -I. -I/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/asan -I /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/include -I /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/mips-linux-uclibc -I/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/../libstdc++-v3/libsupc++ -D_GNU_SOURCE -minterlink-mips16 -MT asan_linux.lo -MD -MP -MF .deps/asan_linux.Tpo -c /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/asan/asan_linux.cc -fPIC -DPIC -o .libs/asan_linux.o mv -f .deps/asan_posix.Tpo .deps/asan_posix.Plo /bin/sh ../libtool --tag=CXX --mode=compile /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/./gcc/xgcc -shared-libgcc -B/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/./gcc -nostdinc++ -L/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/mips-linux-uclibc/libstdc++-v3/src -L/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/mips-linux-uclibc/libstdc++-v3/src/.libs -B/usr/mips-linux-uclibc/bin/ -B/usr/mips-linux-uclibc/lib/ -isystem /usr/mips-linux-uclibc/include -isystem /usr/mips-linux-uclibc/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DASAN_HAS_EXCEPTIONS=1 -DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 -DASAN_NEEDS_SEGV=1 -I. -I/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/asan -I /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/include -I /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/mips-linux-uclibc -I/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/../libstdc++-v3/libsupc++ -D_GNU_SOURCE -minterlink-mips16 -MT asan_malloc_win.lo -MD -MP -MF .deps/asan_malloc_win.Tpo -c -o asan_malloc_win.lo /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/asan/asan_malloc_win.cc /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/asan/asan_linux.cc:90:3: error: #error "Unsupported arch" # error "Unsupported arch" ^ .... libtool: compile: /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/./gcc/xgcc -shared-libgcc -B/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/./gcc -nostdinc++ -L/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/mips-linux-uclibc/libstdc++-v3/src -L/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/mips-linux-uclibc/libstdc++-v3/src/.libs -B/usr/mips-linux-uclibc/bin/ -B/usr/mips-linux-uclibc/lib/ -isystem /usr/mips-linux-uclibc/include -isystem /usr/mips-linux-uclibc/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DASAN_HAS_EXCEPTIONS=1 -DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 -DASAN_NEEDS_SEGV=1 -I. -I/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/asan -I /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/include -I /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/mips-linux-uclibc -I/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/../libstdc++-v3/libsupc++ -D_GNU_SOURCE -minterlink-mips16 -MT asan_fake_stack.lo -MD -MP -MF .deps/asan_fake_stack.Tpo -c /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/asan/asan_fake_stack.cc -o asan_fake_stack.o >/dev/null 2>&1 Makefile:441: recipe for target 'asan_linux.lo' failed libtool: compile: /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/./gcc/xgcc -shared-libgcc -B/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/./gcc -nostdinc++ -L/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/mips-linux-uclibc/libstdc++-v3/src -L/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/build/mips-linux-uclibc/libstdc++-v3/src/.libs -B/usr/mips-linux-uclibc/bin/ -B/usr/mips-linux-uclibc/lib/ -isystem /usr/mips-linux-uclibc/include -isystem /usr/mips-linux-uclibc/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DASAN_HAS_EXCEPTIONS=1 -DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 -DASAN_NEEDS_SEGV=1 -I. -I/var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/asan -I /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer/include -I /var/tmp/portage/cross-mips-linux-uclibc/gcc-4.8.4/work/gcc-4.8.4/libsanitizer -Wall -W -Wno-unused-parameter -Wwrite-strings -pedmake[3]: *** [asan_linux.lo] Error 1
(In reply to thunder367 from comment #21) i don't know what you're trying to show here, but this isn't the bug for it. if you're having a problem, open a new one with proper logs please.
Since PaX is no longer an option, can i have my sanitizer on hardened, please?
(In reply to Sergey 'L29Ah' Alirzaev from comment #23) > Since PaX is no longer an option, can i have my sanitizer on hardened, > please? I suggest filing a new bug against hardened@ team to revise current masks.
If a new bug is filed, please provide a reference to it here as well. Thanks!