From dccede3a61e8a099e1b2a6fa668c44b13a93b353 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 4 Apr 2020 02:54:31 -0700 Subject: [PATCH] util: In build_cross_gcc, set LIMITS_H_TEST=true. This forces a test in the gcc Makefile to pick the right answer, where its own check will not. Without this fix, installing libsanitizer fails to build while installing the c++ headers because it can't find a definition for PATH_MAX. Disabling building libsanitizer seems to work around the problem, but other problems crop up later when using the cross compiler, specifically when trying to build the googletest library. The chrome authors apparently ran into a similar problem when building the native client tool chain as described in this bug: https://bugs.chromium.org/p/nativeclient/issues/detail?id=3190 The CL which fixed the issue is here: https://codereview.chromium.org/11462002/patch/1/2. With a similar fix applied to build_cross_gcc.py, the cross compilers build without issue, and are then able to build the googletest library without issue. Change-Id: Ia6869d3dc523cb0d964e82bb300f8b092693739b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27489 Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com> Tested-by: kokoro Reviewed-by: Ciro Santilli Maintainer: Bobby R. Bruce --- util/build_cross_gcc/build_cross_gcc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/build_cross_gcc/build_cross_gcc.py b/util/build_cross_gcc/build_cross_gcc.py index e8497c36c..51f7fccc3 100755 --- a/util/build_cross_gcc/build_cross_gcc.py +++ b/util/build_cross_gcc/build_cross_gcc.py @@ -572,7 +572,7 @@ class Compilers(Step): '--enable-languages=c,c++ --disable-multilib'.format( configure=os.path.join(source_dir, 'configure'), prefix=prefix, target=target), - 'make -j{j} all-gcc'.format(j=j), + 'make -j{j} all-gcc LIMITS_H_TEST=true'.format(j=j), 'make install-gcc' ) -- 2.30.2