Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 504200 - sys-devel/gcc:4.8 - add USE=sanitizer
Summary: sys-devel/gcc:4.8 - add USE=sanitizer
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 525174 (view as bug list)
Depends on: 525910
Blocks: musl-porting
  Show dependency tree
 
Reported: 2014-03-11 12:41 UTC by David Heidelberg (okias)
Modified: 2018-09-27 09:25 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Heidelberg (okias) 2014-03-11 12:41:45 UTC
Address sanitizer is not needed and it may causes build fails for gcc.

I'd like propose --disable-libsanitizer with USE sanitizer

Reproducible: Always
Comment 1 Ryan Hill (RETIRED) gentoo-dev 2014-03-13 05:59:25 UTC
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?
Comment 2 David Heidelberg (okias) 2014-03-13 14:01:36 UTC
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.
Comment 3 Ryan Hill (RETIRED) gentoo-dev 2014-03-14 02:52:55 UTC
Okay, that sounds reasonable.
Comment 4 Ryan Hill (RETIRED) gentoo-dev 2014-05-23 06:20:37 UTC
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.
Comment 5 Petr Pisar 2014-10-19 08:40:06 UTC
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);
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-19 20:48:00 UTC
*** Bug 525174 has been marked as a duplicate of this bug. ***
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-19 20:48:29 UTC
/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"
Comment 8 Andrew Church 2014-10-20 05:13:03 UTC
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
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-20 08:47:17 UTC
(In reply to Andrew Church from comment #8)
> Also broken with cross-mingw32:

That would be bug #525910.
Comment 10 SpanKY gentoo-dev 2014-10-20 20:36:33 UTC
*** Bug 526142 has been marked as a duplicate of this bug. ***
Comment 11 SpanKY gentoo-dev 2014-10-20 20:36:58 UTC
*** Bug 511712 has been marked as a duplicate of this bug. ***
Comment 13 Emil Medve 2014-10-23 05:00:49 UTC
How about the hardened targets that support it?
Comment 14 SpanKY gentoo-dev 2014-10-23 05:30:59 UTC
(In reply to Emil Medve from comment #13)

i don't know what you mean
Comment 15 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-23 09:42:51 UTC
(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.
Comment 16 Anthony Basile gentoo-dev 2014-10-23 11:10:47 UTC
(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.
Comment 17 Anthony Basile gentoo-dev 2014-10-23 11:17:11 UTC
(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.
Comment 18 Emil Medve 2014-10-23 15:07:43 UTC
(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
Comment 19 Anthony Basile gentoo-dev 2014-10-23 16:37:42 UTC
(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.
Comment 20 tka 2014-10-31 14:51:04 UTC
(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.
Comment 21 thunder367 2015-01-17 20:25:29 UTC
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
Comment 22 SpanKY gentoo-dev 2015-02-15 05:15:07 UTC
(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.
Comment 23 Sergey 'L29Ah' Alirzaev 2018-09-26 19:47:24 UTC
Since PaX is no longer an option, can i have my sanitizer on hardened, please?
Comment 24 Sergei Trofimovich (RETIRED) gentoo-dev 2018-09-27 07:27:48 UTC
(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.
Comment 25 Jaak Ristioja 2018-09-27 09:25:41 UTC
If a new bug is filed, please provide a reference to it here as well. Thanks!