File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed
Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ WITH_ABI ?= @WITH_ABI@
3535WITH_TUNE ?= @WITH_TUNE@
3636WITH_ISA_SPEC ?= @WITH_ISA_SPEC@
3737SYSROOT := $(INSTALL_DIR ) /sysroot
38+ ENABLE_LIBSANITIZER ?= @enable_libsanitizer@
3839
3940SHELL := /bin/sh
4041AWK := @GAWK@
@@ -410,9 +411,6 @@ stamps/build-gcc-linux-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) $(addprefix stamps/b
410411 stamps/build-glibc-linux-headers
411412 rm -rf $@ $(notdir $@)
412413 mkdir $(notdir $@)
413- # libsanitizer not supported rv32,
414- # but it will break the rv64 multi-lib build, so we disable that
415- # temporally untill rv32 supported.
416414 cd $(notdir $@) && $</configure \
417415 --target=$(LINUX_TUPLE) \
418416 $(CONFIGURE_HOST) \
@@ -426,7 +424,7 @@ stamps/build-gcc-linux-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) $(addprefix stamps/b
426424 --disable-libmudflap \
427425 --disable-libssp \
428426 --disable-libquadmath \
429- --disable-libsanitizer \
427+ $(ENABLE_LIBSANITIZER) \
430428 --disable-nls \
431429 --disable-bootstrap \
432430 --src=$(gccsrcdir) \
Original file line number Diff line number Diff line change @@ -585,6 +585,7 @@ PACKAGE_URL=''
585585ac_subst_vars=' LTLIBOBJS
586586LIBOBJS
587587with_linux_headers_src
588+ enable_libsanitizer
588589with_qemu_src
589590with_gdb_src
590591with_musl_src
@@ -692,6 +693,7 @@ with_musl_src
692693with_gdb_src
693694with_qemu_src
694695with_linux_headers_src
696+ enable_libsanitizer
695697'
696698 ac_precious_vars=' build_alias
697699host_alias
@@ -1329,6 +1331,7 @@ Optional Features:
13291331 slow, only enable it when developing gcc
13301332 [--disable-gcc-checking]
13311333 --disable-gdb Don't build GDB, as it's not upstream
1334+ --enable-libsanitizer Build libsanitizer, which only supports rv64
13321335
13331336Optional Packages:
13341337 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -3675,6 +3678,23 @@ else
36753678fi
36763679
36773680
3681+ # Check whether --enable-libsanitizer was given.
3682+ if test " ${enable_libsanitizer+set} " = set ; then :
3683+ enableval=$enable_libsanitizer ;
3684+ else
3685+ enable_libsanitizer=no
3686+
3687+ fi
3688+
3689+
3690+ if test " x$enable_libsanitizer " ! = xno; then :
3691+ enable_libsanitizer=--enable-libsanitizer
3692+
3693+ else
3694+ enable_libsanitizer=--disable-libsanitizer
3695+
3696+ fi
3697+
36783698if test " x$with_linux_headers_src " ! = xdefault; then :
36793699 with_linux_headers_src=$with_linux_headers_src
36803700
Original file line number Diff line number Diff line change @@ -242,6 +242,17 @@ AC_ARG_WITH(linux-headers-src,
242242 [ with_linux_headers_src=default]
243243 )
244244
245+ AC_ARG_ENABLE ( libsanitizer ,
246+ [ AS_HELP_STRING ( [ --enable-libsanitizer] ,
247+ [ Build libsanitizer, which only supports rv64] ) ] ,
248+ [ ] ,
249+ [ enable_libsanitizer=no]
250+ )
251+
252+ AS_IF ( [ test "x$enable_libsanitizer" != xno] ,
253+ [ AC_SUBST ( enable_libsanitizer , -- enable-libsanitizer ) ] ,
254+ [ AC_SUBST ( enable_libsanitizer , -- disable-libsanitizer ) ] )
255+
245256AS_IF ( [ test "x$with_linux_headers_src" != xdefault] ,
246257 [ AC_SUBST ( with_linux_headers_src ,$with_linux_headers_src ) ] ,
247258 [ AC_SUBST ( with_linux_headers_src ,"\$ ( srcdir ) / linux-headers/include" ) ] )
You can’t perform that action at this time.
0 commit comments