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)
commitdccede3a61e8a099e1b2a6fa668c44b13a93b353
tree54088834befd7c7ea9a05fe6b2c016f3f84c0de5
parent4997ec2d166dbc2d88b8ebba662ea62dc57ff84a
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 <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