lancethepants / tomatoware

Tomatoware is a set of scripts to create a native development environment for tomato firmware supported routers.
Other
71 stars 22 forks source link

Error building bzip2 for ARM (missing arm-linux-gcc) #50

Closed HunterZ closed 3 years ago

HunterZ commented 3 years ago

Getting an error about arm-linux-gcc not being in PATH when it's trying to build bzip2:

$ make
./scripts/host-tools.sh
+++ pwd
++ BASE=/mnt/quad/projects/tomatoware
++ SRC=/mnt/quad/projects/tomatoware/src
++ PATCHES=/mnt/quad/projects/tomatoware/patches
++ RPATH=/mnt/lib
++ DEST=/mnt/quad/projects/tomatoware/mnt
++ LDFLAGS='-L/mnt/quad/projects/tomatoware/mnt/lib -s -Wl,--dynamic-linker=/mnt/lib/ld-uClibc.so.1 -Wl,-rpath,/mnt/lib -Wl,-rpath-link,/mnt/quad/projects/tomatoware/mnt/lib'
++ CPPFLAGS=-I/mnt/quad/projects/tomatoware/mnt/include
++ CFLAGS='-O2 -pipe -march=armv7-a -mtune=cortex-a9'
++ CXXFLAGS='-O2 -pipe -march=armv7-a -mtune=cortex-a9'
++ CONFIGURE='./configure --prefix=/mnt --host=arm-linux'
+++ nproc
++ MAKE='make -j4'
++ ORIGINALPATH=/opt/tomatoware/arm-soft-mnt/bin/:/opt/tomatoware/mipsel-soft-mnt/bin/:/home/ben/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin
++ export PATH=/mnt/quad/projects/tomatoware/native/bin:/opt/tomatoware/arm-soft-mnt/bin/:/opt/tomatoware/mipsel-soft-mnt/bin/:/home/ben/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin
++ PATH=/mnt/quad/projects/tomatoware/native/bin:/opt/tomatoware/arm-soft-mnt/bin/:/opt/tomatoware/mipsel-soft-mnt/bin/:/home/ben/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin
++ export CCACHE_DIR=/home/ben/.ccache
++ CCACHE_DIR=/home/ben/.ccache
++ PERL_VERSION=5.32.1
++ BINUTILS_VERSION=2.36.1
++ GCC_VERSION=10.2.0
++ NINJA_VERSION=1.10.2
++ CMAKE_VERSION=3.19.6
++ CCACHE_VERSION=4.2
++ '[' arm = arm ']'
++ GNUEABI=gnueabi
++ '[' 1 == 1 ']'
++ MIPSEL=mipsel-tomatoware-linux-uclibc
++ '[' 1 == 1 ']'
++ '[' arm == arm ']'
++ GCCforClang=5.1.0
+++ sort -V
+++ head -n1
++++ g++ -dumpversion
+++ printf '%s\n' 5.1.0 8
++ '[' '!' 5.1.0 = 5.1.0 ']'
+ Status host-ccache
+ echo -e '\033]2;compiling' 'host-ccache\007'

+ cd /mnt/quad/projects/tomatoware/src/ccache
+ '[' '!' -f .extracted-native ']'
+ cd ccache-4.2-native
+ '[' '!' -f .built-native ']'
+ '[' '!' -f .symlinked-native ']'
+ Status host-ninja
+ echo -e '\033]2;compiling' 'host-ninja\007'

+ cd /mnt/quad/projects/tomatoware/src/ninja
+ '[' '!' -f .extracted-native ']'
+ cd ninja-v1.10.2-native
+ '[' '!' -f .built-native ']'
+ Status host-cmake
+ echo -e '\033]2;compiling' 'host-cmake\007'

+ cd /mnt/quad/projects/tomatoware/src/cmake
+ '[' '!' -f .extracted-native ']'
+ cd cmake-3.19.6-native
+ '[' '!' -f .built-native ']'
+ Status host-gcc
+ echo -e '\033]2;compiling' 'host-gcc\007'

+ '[' '' == 1 ']'
./scripts/base.sh
+++ pwd
++ BASE=/mnt/quad/projects/tomatoware
++ SRC=/mnt/quad/projects/tomatoware/src
++ PATCHES=/mnt/quad/projects/tomatoware/patches
++ RPATH=/mnt/lib
++ DEST=/mnt/quad/projects/tomatoware/mnt
++ LDFLAGS='-L/mnt/quad/projects/tomatoware/mnt/lib -s -Wl,--dynamic-linker=/mnt/lib/ld-uClibc.so.1 -Wl,-rpath,/mnt/lib -Wl,-rpath-link,/mnt/quad/projects/tomatoware/mnt/lib'
++ CPPFLAGS=-I/mnt/quad/projects/tomatoware/mnt/include
++ CFLAGS='-O2 -pipe -march=armv7-a -mtune=cortex-a9'
++ CXXFLAGS='-O2 -pipe -march=armv7-a -mtune=cortex-a9'
++ CONFIGURE='./configure --prefix=/mnt --host=arm-linux'
+++ nproc
++ MAKE='make -j4'
++ ORIGINALPATH=/opt/tomatoware/arm-soft-mnt/bin/:/opt/tomatoware/mipsel-soft-mnt/bin/:/home/ben/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin
++ export PATH=/mnt/quad/projects/tomatoware/native/bin:/opt/tomatoware/arm-soft-mnt/bin/:/opt/tomatoware/mipsel-soft-mnt/bin/:/home/ben/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin
++ PATH=/mnt/quad/projects/tomatoware/native/bin:/opt/tomatoware/arm-soft-mnt/bin/:/opt/tomatoware/mipsel-soft-mnt/bin/:/home/ben/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin
++ export CCACHE_DIR=/home/ben/.ccache
++ CCACHE_DIR=/home/ben/.ccache
++ PERL_VERSION=5.32.1
++ BINUTILS_VERSION=2.36.1
++ GCC_VERSION=10.2.0
++ NINJA_VERSION=1.10.2
++ CMAKE_VERSION=3.19.6
++ CCACHE_VERSION=4.2
++ '[' arm = arm ']'
++ GNUEABI=gnueabi
++ '[' 1 == 1 ']'
++ MIPSEL=mipsel-tomatoware-linux-uclibc
++ '[' 1 == 1 ']'
++ '[' arm == arm ']'
++ GCCforClang=5.1.0
+++ sort -V
+++ head -n1
++++ g++ -dumpversion
+++ printf '%s\n' 5.1.0 8
++ '[' '!' 5.1.0 = 5.1.0 ']'
+ Status bzip2
+ echo -e '\033]2;compiling' 'bzip2\007'

+ BZIP2_VERSION=1.0.8
+ cd /mnt/quad/projects/tomatoware/src/bzip2
+ '[' '!' -f .extracted ']'
+ cd bzip2-1.0.8
+ '[' '!' -f .patched ']'
+ '[' '!' -f .built ']'
+ make -j4
make[1]: Entering directory '/mnt/quad/projects/tomatoware/src/bzip2/bzip2-1.0.8'
arm-linux-gcc -O2 -pipe -march=armv7-a -mtune=cortex-a9 -fPIC -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -c huffman.c

If compilation produces errors, or a large number of warnings,
please read README.COMPILATION.PROBLEMS -- you might be able to
adjust the flags in this Makefile to improve matters.

Also in README.COMPILATION.PROBLEMS are some hints that may help
if your build produces an executable which is unable to correctly
handle so-called 'large files' -- files of size 2GB or more.

arm-linux-gcc -O2 -pipe -march=armv7-a -mtune=cortex-a9 -fPIC -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -c blocksort.c
arm-linux-gcc -O2 -pipe -march=armv7-a -mtune=cortex-a9 -fPIC -Wall -O2 -g -D_FILE_OFFSET_BITS=64 -c crctable.c
ccache: error: Could not find compiler "arm-linux-gcc" in PATH
make[1]: *** [Makefile:123: huffman.o] Error 1
make[1]: *** Waiting for unfinished jobs....
ccache: error: Could not find compiler "arm-linux-gcc" in PATH
make[1]: *** [Makefile:125: crctable.o] Error 1
ccache: error: Could not find compiler "arm-linux-gcc" in PATH
make[1]: *** [Makefile:121: blocksort.o] Error 1
make[1]: Leaving directory '/mnt/quad/projects/tomatoware/src/bzip2/bzip2-1.0.8'
make: *** [Makefile:5: tomatoware] Error 2
lancethepants commented 3 years ago

It seems maybe the arm toolchain wasn't successfully built or was interrupted . You can look in /opt/tomatoware/arm-soft-mnt/bin/ and see if arm-linux-gcc is present along with all the other toolchain tools.

If not you should run the following.

make toolchain-clean
make toolchain
make
HunterZ commented 3 years ago

Thanks, but that's not helping... Maybe I'm doing it wrong? I'm editing config.mk to enable mips mode, then running make toolchain-clean followed by make toolchain, then editing config.mk again to switch to ARM mode, then running make.

Going to clean out my git workspace and then try your info from bug #48 and see if that works out better. If not, then it's probably some weirdness from trying to build from an NFS mount, in which case I'll just give up. I'll let you know how it turns out either way.

HunterZ commented 3 years ago

Update: Build process completed successfully, so I'm closing this issue. Thanks for the help!