Credo di aver capito che utilizzando la tollchain esterna non c'è bisogno di impostare alcuna variabile d'ambiente.
Ho fatto dei passi avanti ma ho ancora errori in fase di compilazione, credo per le diverse librerie utilizzate. Se ho ben capito la toolchain utilizza glibc mentre i pacchetti che tento di compilare utilizzano uclibc, ma forse ho detto una fesseria.
Ora la compilazione mi si ferma così:
make V=s package/feeds/packages/haproxy/compile
make[1]: Entering directory '/home/marvel/DGA4132/chaos_calmer'
make[2]: Entering directory '/home/marvel/DGA4132/chaos_calmer/package/libs/toolchain'
rm -rf /home/marvel/DGA4132/chaos_calmer/staging_dir/target-toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/root-ar71xx/tmp-libc
mkdir -p /home/marvel/DGA4132/chaos_calmer/staging_dir/target-toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/root-ar71xx/stamp /home/marvel/DGA4132/chaos_calmer/staging_dir/target-toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/root-ar71xx/tmp-libc
for file in ./lib/ld{-*.so,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*}; do dir=`dirname $file` ; install -d -m0755 /home/marvel/DGA4132/chaos_calmer/staging_dir/target-toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/root-ar71xx/tmp-libc/$dir ; cp -fpR /home/marvel/DGA4132/toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/$file /home/marvel/DGA4132/chaos_calmer/staging_dir/target-toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/root-ar71xx/tmp-libc/$dir/ ; done ; exit 0
SHELL= /home/marvel/DGA4132/chaos_calmer/staging_dir/host/bin/flock /home/marvel/DGA4132/chaos_calmer/tmp/.root-copy.flock -c 'cp -fpR /home/marvel/DGA4132/chaos_calmer/staging_dir/target-toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/root-ar71xx/tmp-libc/. /home/marvel/DGA4132/chaos_calmer/staging_dir/target-toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/root-ar71xx/'
bash: /home/marvel/DGA4132/chaos_calmer/staging_dir/host/bin/flock: No such file or directory
Makefile:636: recipe for target '/home/marvel/DGA4132/chaos_calmer/staging_dir/target-toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/root-ar71xx/stamp/.libc_installed' failed
make[2]: *** [/home/marvel/DGA4132/chaos_calmer/staging_dir/target-toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/root-ar71xx/stamp/.libc_installed] Error 127
make[2]: Leaving directory '/home/marvel/DGA4132/chaos_calmer/package/libs/toolchain'
package/Makefile:191: recipe for target 'package/libs/toolchain/compile' failed
make[1]: *** [package/libs/toolchain/compile] Error 2
make[1]: Leaving directory '/home/marvel/DGA4132/chaos_calmer'
/home/marvel/DGA4132/chaos_calmer/include/toplevel.mk:181: set di istruzioni per l'obiettivo "package/feeds/packages/haproxy/compile" non riuscito
make: *** [package/feeds/packages/haproxy/compile] Errore 2
Procedo correttamente clonando questo repo:
https://github.com/openwrt/chaos_calmer.git ?
#POSTEDIT
Ci sono quasi, riesco ad eseguire con successo:
./scripts/feeds install haproxy
make package/feeds/packages/haproxy/prepare
make package/feeds/packages/haproxy/compile
ma ho un errore su quello che dovrebbe essere l'ultimo step:
make package/feeds/packages/haproxy/install V=s
time: target/linux/prereq#0.17#0.06#0.38
make[1]: Entering directory '/home/marvel/DGA4132/openwrt'
make[1]: *** No rule to make target 'package/feeds/packages/haproxy/install'. Stop.
make[1]: Leaving directory '/home/marvel/DGA4132/openwrt'
/home/marvel/DGA4132/openwrt/include/toplevel.mk:225: set di istruzioni per l'obiettivo "package/feeds/packages/haproxy/install" non riuscito
make: *** [package/feeds/packages/haproxy/install] Errore 2
#POSTEDIT2
Allora, ho capito come compilare i pacchetti, non mi è possibile compilarli uno alla volta come tentavo prima, devo selezionarli nel menuconfig e lacio il make, in questo modo tutto fila liscio senza errori.
Questo però riesco a farlo senza la toolchain di Ansuel, se utilizzo la toolchain di Ansuel la compilazione fallisce.
Ma non c'è nessuno che ha provato a compilarsi dei pacchetti con questa toolchain e che può darmi qualche indicazione? Ho ovviamente impostato il target corretto, la libreria corretta ed i percorsi corretti, ma niente da fare.
Intanto proprio mentre vi scrivo ho lanciato una nuova compilazione da una buildroot pulita, speriamo bene.
#POSTEDIT3
Niente da fare, è fallita anche questa volta col seguente errore:
make -V=sc
cc1: some warnings being treated as errors
Kbuild:21: recipe for target 'kernel/bounds.s' failed
make[6]: *** [kernel/bounds.s] Error 1
Makefile:1096: recipe for target 'prepare0' failed
make[5]: *** [prepare0] Error 2
make[5]: Leaving directory '/home/marvel/DGA4132/openwrt/build_dir/target-arm-openwrt-linux-gnueabi_glibc/linux-bcm53xx_generic/linux-4.14.169'
Makefile:33: recipe for target '/home/marvel/DGA4132/openwrt/build_dir/target-arm-openwrt-linux-gnueabi_glibc/linux-bcm53xx_generic/linux-4.14.169/.modules' failed
make[4]: *** [/home/marvel/DGA4132/openwrt/build_dir/target-arm-openwrt-linux-gnueabi_glibc/linux-bcm53xx_generic/linux-4.14.169/.modules] Error 2
make[4]: Leaving directory '/home/marvel/DGA4132/openwrt/target/linux/bcm53xx'
Makefile:13: recipe for target 'compile' failed
make[3]: *** [compile] Error 2
make[3]: Leaving directory '/home/marvel/DGA4132/openwrt/target/linux'
time: target/linux/compile#1.04#0.36#1.89
target/Makefile:23: recipe for target 'target/linux/compile' failed
make[2]: *** [target/linux/compile] Error 2
make[2]: Leaving directory '/home/marvel/DGA4132/openwrt'
target/Makefile:18: recipe for target '/home/marvel/DGA4132/openwrt/staging_dir/target-arm-openwrt-linux-gnueabi_glibc/stamp/.target_compile' failed
make[1]: *** [/home/marvel/DGA4132/openwrt/staging_dir/target-arm-openwrt-linux-gnueabi_glibc/stamp/.target_compile] Error 2
make[1]: Leaving directory '/home/marvel/DGA4132/openwrt'
Build failed - please re-run with -j1 to see the real error message
/home/marvel/DGA4132/openwrt/include/toplevel.mk:225: set di istruzioni per l'obiettivo "world" non riuscito
Il .config che sto utilizzando è il seguente:
https://pastebin.com/WAkWXLcn@LuKePicci o
@Ansuel , riuscite a darmi qualche indicazione per favore?
#POSTEDIT4
Me la canto e me la suono da solo, sembra che ora stia andando cambiando nel .config da:
CONFIG_TARGET_NAME="arm-openwrt-linux-gnueabi"
CONFIG_TOOLCHAIN_PREFIX="arm-openwrt-linux-gnueabi-"
a:
CONFIG_TARGET_NAME="arm-openwrt-linux"
CONFIG_TOOLCHAIN_PREFIX="arm-openwrt-linux-"
Dita incrociate.
#POSTEDIT5
Niente da fare, spero in un vostro aiuto.
#POSTEDIT6
Ora sto compilando con un nuovo .config dove ho disabilitato tutto ciò che non è userspace. Speriamo bene.
#POSTEDIT7
Ok ragazzi, come direbbe Tony Stark: "Posso compilare."
Si, riesco a compilare la maggior parte dei pacchetti, anche se non tutti e con la mia solita fortuna non riesco a compilare l'unico pacchetto che mi serviva, ossia haproxy, la cui compilazione fallisce col seguente errore:
make[3]: Entering directory '/home/marvel/DGA4132/openwrt/feeds/packages/net/haproxy'
rm -f /home/marvel/DGA4132/openwrt/build_dir/target-arm-openwrt-linux_glibc/haproxy-ssl/haproxy-2.1.3/.built
touch /home/marvel/DGA4132/openwrt/build_dir/target-arm-openwrt-linux_glibc/haproxy-ssl/haproxy-2.1.3/.built_check
make TARGET=linux-glibc -C /home/marvel/DGA4132/openwrt/build_dir/target-arm-openwrt-linux_glibc/haproxy-ssl/haproxy-2.1.3 DESTDIR="/home/marvel/DGA4132/openwrt/build_dir/target-arm-openwrt-linux_glibc/haproxy-ssl/haproxy-2.1.3/ipkg-install" CC="arm-openwrt-linux-gcc" PCREDIR="/home/marvel/DGA4132/openwrt/staging_dir/target-arm-openwrt-linux_glibc/usr/" USE_LUA=1 LUA_LIB_NAME="lua5.3" LUA_INC="/home/marvel/DGA4132/openwrt/staging_dir/target-arm-openwrt-linux_glibc/usr/include/lua5.3" LUA_LIB="/home/marvel/DGA4132/openwrt/staging_dir/target-arm-openwrt-linux_glibc/usr/lib" SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530" USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_TFO=1 USE_NS=1 USE_ZLIB=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_GETADDRINFO=1 USE_THREAD=1 USE_PTHREAD_PSHARED=1 VERSION="2.1.3" SUBVERS="-1" VERDATE="2020/02/18" IGNOREGIT=1 USE_OPENSSL=1 ADDLIB="-lcrypto -lm " CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -mfloat-abi=soft -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -Wno-format-truncation -Wno-unused-label -Wno-sign-compare -Wno-unused-parameter -Wno-old-style-declaration -Wno-ignored-qualifiers -Wno-clobbered -Wno-missing-field-initializers -Wno-implicit-fallthrough -Wno-stringop-overflow -Wno-cast-function-type -Wtype-limits -Wshift-negative-value -Wshift-overflow=2 -Wduplicated-cond -Wnull-dereference" LD="arm-openwrt-linux-gcc" LDFLAGS="-L/home/marvel/DGA4132/openwrt/staging_dir/target-arm-openwrt-linux_glibc/usr/lib -L/home/marvel/DGA4132/openwrt/staging_dir/target-arm-openwrt-linux_glibc/lib -L/home/marvel/DGA4132/toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/usr/lib -L/home/marvel/DGA4132/toolchain-arm_cortex-a9+neon_gcc-4.8-linaro_glibc_eabi/lib -znow -zrelro -latomic" EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
make[4]: Entering directory '/home/marvel/DGA4132/openwrt/build_dir/target-arm-openwrt-linux_glibc/haproxy-ssl/haproxy-2.1.3'
CC src/ev_poll.o
arm-openwrt-linux-gcc: error: unrecognized command line option '-Wshift-negative-value'
arm-openwrt-linux-gcc: error: unrecognized command line option '-Wshift-overflow=2'
arm-openwrt-linux-gcc: error: unrecognized command line option '-Wduplicated-cond'
arm-openwrt-linux-gcc: error: unrecognized command line option '-Wnull-dereference'
Makefile:875: recipe for target 'src/ev_poll.o' failed
make[4]: *** [src/ev_poll.o] Error 1
make[4]: Leaving directory '/home/marvel/DGA4132/openwrt/build_dir/target-arm-openwrt-linux_glibc/haproxy-ssl/haproxy-2.1.3'
Makefile:163: recipe for target '/home/marvel/DGA4132/openwrt/build_dir/target-arm-openwrt-linux_glibc/haproxy-ssl/haproxy-2.1.3/.built' failed
make[3]: *** [/home/marvel/DGA4132/openwrt/build_dir/target-arm-openwrt-linux_glibc/haproxy-ssl/haproxy-2.1.3/.built] Error 2
make[3]: Leaving directory '/home/marvel/DGA4132/openwrt/feeds/packages/net/haproxy'
time: package/feeds/packages/haproxy/ssl/compile#0.13#0.04#0.56
package/Makefile:111: recipe for target 'package/feeds/packages/haproxy/compile' failed
make[2]: *** [package/feeds/packages/haproxy/compile] Error 2
make[2]: Leaving directory '/home/marvel/DGA4132/openwrt'
package/Makefile:107: recipe for target '/home/marvel/DGA4132/openwrt/staging_dir/target-arm-openwrt-linux_glibc/stamp/.package_compile' failed
make[1]: *** [/home/marvel/DGA4132/openwrt/staging_dir/target-arm-openwrt-linux_glibc/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/marvel/DGA4132/openwrt'
/home/marvel/DGA4132/openwrt/include/toplevel.mk:225: set di istruzioni per l'obiettivo "world" non riuscito
make: *** [world] Errore 2
Comunque se vi serve qualcosa battete un colpo, vedo se riesco a compilarvelo.
#POSTEDIT8
Ragazzi, ce l'ho fatta, mi sono compilato anche haproxy, dopo aver trovato questo problema:
https://github.com/haproxy/haproxy/issues/83ho capito che usavo il repo più recente di openwrt e non andava bene, usando il branch 18.06 sono riuscito a compilare tutto.
Intanto chiedo scusa a tutti coloro che ho disturbato con questo mio "diario" e la soddisfazione di aver fatto tutto da solo è grande.
Un grazie a
@larsen64it per avermi messo sulla giusta strada facendomi capire di dover usare la toolchain come toolchain esterna e non come ero solito fare ed un grazie enorme ad
@Ansuel per aver messo a disposizione di tutti noi la sua toolchain.
Se a qualcuno dovesse servire qualche pacchetto non esitate a chiedere, sono a disposizione.