util: In build_cross_gcc, set LIMITS_H_TEST=true.
authorGabe Black <gabeblack@google.com>
Sat, 4 Apr 2020 09:54:31 +0000 (02:54 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 15 Apr 2020 00:08:22 +0000 (00:08 +0000)
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 <noreply+kokoro@google.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

util/build_cross_gcc/build_cross_gcc.py

index e8497c36c9a64d4d903b74ca63ada5319cea2488..51f7fccc3fab2e47cbc66a041f025e1bc047a261 100755 (executable)
@@ -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'
                 )