Bug 1451104 - part 1 - ensure compatible binutils for GCC; r=glandium

GCC will pick up whatever `as` is first in PATH when trying to assemble
files.  It expects this `as` to have at least as many features as the
`as` detected at configure time when GCC was originally built.  We
should ensure that GCC is always picking up an appropriate `as` by
adding its base directory to the search path; otherwise, we get peculiar
assembler errors.
This commit is contained in:
Nathan Froyd 2018-06-28 09:04:41 -04:00
Родитель ecc23dbcc5
Коммит aedd49a358
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -517,6 +517,18 @@ if __name__ == "__main__":
extra_asmflags = [] extra_asmflags = []
extra_ldflags = [] extra_ldflags = []
# We want to ensure that the GCC we use for stage 1 always picks up the
# binutils it is packaged with, rather than the system binutils, which
# might be a much different version and therefore lacking in support for
# features GCC expects.
binutils_flags = ['-B', os.path.dirname(cc)]
if cc.endswith('gcc'):
extra_cflags += binutils_flags
if cxx.endswith('g++'):
extra_cxxflags += binutils_flags
if asm.endswith('gcc'):
extra_asmflags += binutils_flags
if 'LD_LIBRARY_PATH' in os.environ: if 'LD_LIBRARY_PATH' in os.environ:
os.environ['LD_LIBRARY_PATH'] = ('%s/lib64/:%s' % os.environ['LD_LIBRARY_PATH'] = ('%s/lib64/:%s' %
(gcc_dir, os.environ['LD_LIBRARY_PATH'])) (gcc_dir, os.environ['LD_LIBRARY_PATH']))

Просмотреть файл

@ -56,6 +56,9 @@ cmake \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD=X86 \ -DLLVM_TARGETS_TO_BUILD=X86 \
-DCMAKE_C_COMPILER=$HOME_DIR/src/gcc/bin/gcc \ -DCMAKE_C_COMPILER=$HOME_DIR/src/gcc/bin/gcc \
-DCMAKE_CXX_COMPILER=$HOME_DIR/src/gcc/bin/g++ \
-DCMAKE_C_FLAGS="-B $HOME_DIR/src/gcc/bin" \
-DCMAKE_CXX_FLAGS="-B $HOME_DIR/src/gcc/bin" \
.. ..
export LD_LIBRARY_PATH=$HOME_DIR/src/gcc/lib64 export LD_LIBRARY_PATH=$HOME_DIR/src/gcc/lib64