OP-TEE / build

Makefiles to use OP-TEE on various platforms
106 stars 209 forks source link

Downgrade buildroot-built GCC toolchain from 12.x to 11.x #753

Closed jforissier closed 1 month ago

jforissier commented 1 month ago

GCC 12.x does not work with OP-TEE C++ TAs, causing a link error (excerpt from the build log on an arm64 host):

 /usr/bin/ccache /optee/build/../toolchains/aarch64/bin/aarch64-linux-ld.bfd -e__ta_entry -pie -T out/ta/os_test/ta.lds -Map=out/ta/os_test/5b9e0e40-2636-11e1-ad9e-0002a5d5c51b.map --sort-section=alignment -z max-page-size=4096  --as-needed   --dynamic-list out/ta/os_test/dyn_list --eh-frame-hdr out/ta/os_test/init.o out/ta/os_test/os_test.o out/ta/os_test/ta_entry.o out/ta/os_test/test_float_subj.o out/ta/os_test/cxx_tests.o out/ta/os_test/cxx_tests_c.o out/ta/os_test/attestation.o out/ta/os_test/user_ta_header.o -L/optee/out-br/build/optee_test_ext-1.0/ta/os_test_lib/out/ta/os_test_lib -los_test -ldl -L/optee/optee_os/out/arm/export-ta_arm64/lib --start-group -lutils -lutee -lmbedtls -ldl /optee/toolchains/aarch64/bin/../lib/gcc/aarch64-buildroot-linux-gnu/12.3.0/../../../../aarch64-buildroot-linux-gnu/lib/../lib64/libstdc++.a /optee/toolchains/aarch64/bin/../lib/gcc/aarch64-buildroot-linux-gnu/12.3.0/libgcc_eh.a --end-group /optee/toolchains/aarch64/bin/../lib/gcc/aarch64-buildroot-linux-gnu/12.3.0/libgcc.a -lutils -o out/ta/os_test/5b9e0e40-2636-11e1-ad9e-0002a5d5c51b.elf
 /optee/build/../toolchains/aarch64/bin/aarch64-linux-ld.bfd: /optee/toolchains/aarch64/bin/../lib/gcc/aarch64-buildroot-linux-gnu/12.3.0/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `_Unwind_Find_FDE':
 /optee/out-aarch64-sdk/build/host-gcc-final-12.3.0/build/aarch64-buildroot-linux-gnu/libgcc/../../../libgcc/unwind-dw2-fde-dip.c:512: undefined reference to `_dl_find_object'
 make[4]: *** [/optee/optee_os/out/arm/export-ta_arm64/mk/link.mk:123: out/ta/os_test/5b9e0e40-2636-11e1-ad9e-0002a5d5c51b.elf] Error 1
 make[3]: *** [/optee/out-br/build/optee_test_ext-1.0/ta/Makefile.gmake:61: ta-os_test] Error 2
 make[2]: *** [package/pkg-generic.mk:284: /optee/out-br/build/optee_test_ext-1.0/.stamp_built] Error 2
 make[1]: *** [Makefile:23: _all] Error 2
 make[1]: Leaving directory '/optee/out-br'
 make: *** [common.mk:341: buildroot] Error 2
 The command '/bin/sh -c make V=1 RUST_ENABLE=n' returned a non-zero code: 2

While this may be mitigated with "make WITH_CXX_TESTS=n", we'd better select GCC 11.x which is know to work well and is consistent with what "make toolchains" would download on an x86_64 host (11.3.1).

msgilligan commented 1 month ago

After rebuilding toolchains I get the following:

make RUST_ENABLE=n check
make -C /home/sean.linux/optee/build/../optee_os O=out/arm CFG_USER_TA_TARGETS=ta_arm64 CFG_ARM64_core=y PLATFORM=vexpress-qemu_armv8a CROSS_COMPILE="/usr/bin/ccache /home/sean.linux/optee/build/../toolchains/aarch64/bin/aarch64-linux-" CROSS_COMPILE_core="/usr/bin/ccache /home/sean.linux/optee/build/../toolchains/aarch64/bin/aarch64-linux-" CROSS_COMPILE_ta_arm64="/usr/bin/ccache /home/sean.linux/optee/build/../toolchains/aarch64/bin/aarch64-linux-" CROSS_COMPILE_ta_arm32="/usr/bin/ccache /home/sean.linux/optee/build/../toolchains/aarch32/bin/arm-linux-gnueabihf-" CFG_TEE_CORE_LOG_LEVEL=3 DEBUG=0 CFG_IN_TREE_EARLY_TAS="trusted_keys/f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c" DEBUG=0 CFG_ARM_GICV3=y 
make[1]: Entering directory '/home/sean.linux/optee/optee_os'
  CHK     out/arm/conf.mk
  CHK     out/arm/include/generated/conf.h
make[1]: *** No rule to make target '/home/sean.linux/optee/toolchains/aarch64/lib/gcc/aarch64-buildroot-linux-gnu/12.3.0/include/stdbool.h', needed by 'out/arm/core/include/generated/.asm-defines.s'.  Stop.
make[1]: Leaving directory '/home/sean.linux/optee/optee_os'
make: *** [common.mk:551: optee-os-common] Error 2

So this patch seems to help, but it looks like there is still a reference to a 12.3.0 path in the build somewhere?

Update: I ran make clean and am trying a new build. 🤞

jforissier commented 1 month ago

@msgilligan make clean should fix the issue indeed. In fact rm -rf optee_os/out would suffice. I had the same error myself ;)

msgilligan commented 1 month ago

After a make clean, I'm getting:

>>> toolchain-external-custom  Configuring
mkdir -p /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/host /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/target /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/host/aarch64-buildroot-linux-gnu/sysroot /home/sean.linux/optee/out-br/images
mkdir -p /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/host
rsync -a --hard-links  --link-dest=/home/sean.linux/optee/out-br/per-package/host-ccache/host/ /home/sean.linux/optee/out-br/per-package/host-ccache/host/ /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/host
rsync -a --hard-links  --link-dest=/home/sean.linux/optee/out-br/per-package/host-skeleton/host/ /home/sean.linux/optee/out-br/per-package/host-skeleton/host/ /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/host
rsync -a --hard-links  --link-dest=/home/sean.linux/optee/out-br/per-package/skeleton/host/ /home/sean.linux/optee/out-br/per-package/skeleton/host/ /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/host
mkdir -p /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/target
rsync -a --hard-links  --link-dest=/home/sean.linux/optee/out-br/per-package/host-ccache/target/ /home/sean.linux/optee/out-br/per-package/host-ccache/target/ /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/target
rsync -a --hard-links  --link-dest=/home/sean.linux/optee/out-br/per-package/host-skeleton/target/ /home/sean.linux/optee/out-br/per-package/host-skeleton/target/ /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/target
rsync -a --hard-links  --link-dest=/home/sean.linux/optee/out-br/per-package/skeleton/target/ /home/sean.linux/optee/out-br/per-package/skeleton/target/ /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/target
grep --binary-files=without-match -lrZ '/home/sean.linux/optee/out-br/per-package/[^/]\+/' /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/host |while read -d '' f; do file -b --mime-type "${f}" | grep -q '^text/' || continue; printf '%s\0' "${f}"; done |xargs -0 --no-run-if-empty /usr/bin/sed -i -e 's:/home/sean.linux/optee/out-br/per-package/[^/]\+/:/home/sean.linux/optee/out-br/per-package/toolchain-external-custom/:g'
find /home/sean.linux/optee/out-br/per-package/toolchain-external-custom/host \(    -path '/home/sean.linux/optee/out-br/per-package/toolchain-external-custom/host/lib/python*' -o -path '/home/sean.linux/optee/out-br/per-package/toolchain-external-custom/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/python*' \) \( -name "_sysconfigdata*.pyc" -delete \)
__CROSS_CC=/home/sean.linux/optee/toolchains/aarch64/bin/aarch64-linux-gcc.br_real ; ${__CROSS_CC} -v > /dev/null 2>&1 ; if test $? -ne 0 ; then echo "Cannot execute cross-compiler '${__CROSS_CC}'" ; exit 1 ; fi
__CROSS_CC=/home/sean.linux/optee/toolchains/aarch64/bin/aarch64-linux-gcc.br_real ; __TOOLCHAIN_CFLAGS="-mcpu=cortex-a53 -mabi=lp64 " ; vendor=`${__CROSS_CC} -dumpmachine | cut -f2 -d'-'` ; if test "${vendor}" = "angstrom" ; then echo "Angstrom toolchains are not pure toolchains: they contain" ; echo "many other libraries than just the C library, which makes" ; echo "them unsuitable as external toolchains for build systems" ; echo "such as Buildroot." ; exit 1 ; fi; with_sysroot=`${__CROSS_CC} -v 2>&1 |sed -r -e '/.* --with-sysroot=([^[:space:]]+)[[:space:]].*/!d; s//\1/'`; if test "${with_sysroot}"  = "/" ; then echo "Distribution toolchains are unsuitable for use by Buildroot," ; echo "as they were configured in a way that makes them non-relocatable,"; echo "and contain a lot of pre-built libraries that would conflict with"; echo "the ones Buildroot wants to build."; exit 1; fi; libc_a_path=`${__CROSS_CC} -print-file-name=libc.a` ; if test "${libc_a_path}" = "libc.a" ; then echo "Unable to detect the toolchain sysroot, Buildroot cannot use this toolchain." ; exit 1 ; fi ; libc_a_archsysroot_path=`${__CROSS_CC} ${__TOOLCHAIN_CFLAGS} -print-file-name=libc.a` ; if test "${libc_a_archsysroot_path}" = "libc.a" ; then echo "Unable to detect the toolchain architecture sysroot." ; echo "Please check the Target Architecture Variant selected, the toolchains may not support it." ; echo "Buildroot cannot use this toolchain." ; exit 1 ; fi; sysroot_dir="$(printf $(readlink -f $(LANG=C ${__CROSS_CC} -print-file-name=libc.a)) | sed -r -e 's:/(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a:/:')" ; if test -z "${sysroot_dir}" ; then echo "External toolchain doesn't support --sysroot. Cannot use." ; exit 1 ; fi
SYSROOT_DIR="$(printf $(readlink -f $(LANG=C /home/sean.linux/optee/toolchains/aarch64/bin/aarch64-linux-gcc.br_real -print-file-name=libc.a)) | sed -r -e 's:/(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a:/:')" ; if ! support/scripts/check-kernel-headers.sh  /home/sean.linux/optee/out-br/build  $(printf $(readlink -f $(LANG=C /home/sean.linux/optee/toolchains/aarch64/bin/aarch64-linux-gcc.br_real -print-file-name=libc.a)) | sed -r -e 's:/(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a:/:')  6.1 strict; then exit 1; fi; expected_version="12" ; if [ -z "${expected_version}" ]; then exit 0 ; fi; real_version=`/home/sean.linux/optee/toolchains/aarch64/bin/aarch64-linux-gcc.br_real -dumpversion` ; if [[ ! "${real_version}." =~ ^${expected_version}\. ]] ; then printf "Incorrect selection of gcc version: expected %s.x, got %s\n" "${expected_version}" "${real_version}" ; exit 1 ; fi; if test "" = "y" ; then __CROSS_CC="/home/sean.linux/optee/toolchains/aarch64/bin/aarch64-linux-gcc.br_real -mcpu=cortex-a53 -mabi=lp64 " ; EXT_TOOLCHAIN_TARGET=`LANG=C ${__CROSS_CC} -v 2>&1 | grep ^Target | cut -f2 -d ' '` ; if ! echo ${EXT_TOOLCHAIN_TARGET} | grep -qE 'eabi(hf)?$' ; then echo "External toolchain uses the unsuported OABI" ; exit 1 ; fi ; if ! echo 'int main(void) {}' | ${__CROSS_CC} -x c -o /home/sean.linux/optee/out-br/build/.br-toolchain-test.tmp - ; then rm -f /home/sean.linux/optee/out-br/build/.br-toolchain-test.tmp*; abistr_='EABI'; abistr_='EABIhf'; echo "Incorrect ABI setting: ${abistr_y} selected, but toolchain is incompatible"; exit 1 ; fi ; rm -f /home/sean.linux/optee/out-br/build/.br-toolchain-test.tmp* ; fi ; __CROSS_CXX=/home/sean.linux/optee/toolchains/aarch64/bin/aarch64-linux-g++.br_real ; __HAS_CXX=`${__CROSS_CXX} -v > /dev/null 2>&1 && echo y`; if [ "${__HAS_CXX}" != "y" -a "y" = y ] ; then echo "C++ support is selected but is not available in external toolchain" ; exit 1 ; elif [ "${__HAS_CXX}" = "y" -a "y" != y ] ; then echo "C++ support is not selected but is available in external toolchain" ; exit 1 ; fi  ; __CROSS_GDC=/home/sean.linux/optee/toolchains/aarch64/bin/aarch64-linux-gdc.br_real ; __o=/home/sean.linux/optee/out-br/build/.br-toolchain-test-dlang.tmp ; __HAS_DLANG=`printf 'import std.stdio;\nvoid main() { writeln("Hello World!"); }\n' | ${__CROSS_GDC} -x d -o ${__o} - >/dev/null 2>&1 && echo y`; rm -f ${__o}* ; if [ "${__HAS_DLANG}" != "y" -a "" = y ] ; then echo "D language support is selected but is not available in external toolchain" ; exit 1 ; elif [ "${__HAS_DLANG}" = "y" -a "" != y ] ; then echo "D language support is not selected but is available in external toolchain" ; exit 1 ; fi  ; __CROSS_FC=/home/sean.linux/optee/toolchains/aarch64/bin/aarch64-linux-gfortran.br_real ; __o=/home/sean.linux/optee/out-br/build/.br-toolchain-test-fortran.tmp ; __HAS_FORTRAN=`printf 'program hello\n\tprint *, "Hello Fortran!\\\n"\nend program hello\n' | ${__CROSS_FC} -x f95 -ffree-form -o ${__o} - 2>/dev/null && echo y`; rm -f ${__o}* ; if [ "${__HAS_FORTRAN}" != "y" -a "" = y ] ; then echo "Fortran support is selected but is not available in external toolchain" ; exit 1 ; elif [ "${__HAS_FORTRAN}" = "y" -a "" != y ] ; then echo "Fortran support is not selected but is available in external toolchain" ; exit 1 ; fi  ; __CROSS_CC=/home/sean.linux/optee/toolchains/aarch64/bin/aarch64-linux-gcc.br_real ; __o=/home/sean.linux/optee/out-br/build/.br-toolchain-test-openmp.tmp ; __HAS_OPENMP=`printf '#include <omp.h>\nint main(void) { return omp_get_thread_num(); }' | ${__CROSS_CC} -fopenmp -x c -o ${__o} - >/dev/null 2>&1 && echo y` ; rm -f ${__o}* ; if [ "${__HAS_OPENMP}" != "y" -a "" = y ] ; then echo "OpenMP support is selected but is not available in external toolchain"; exit 1 ; elif [ "${__HAS_OPENMP}" = "y" -a "" != y ] ; then echo "OpenMP support is not selected but is available in external toolchain"; exit 1 ; fi  ; if test "" = "y" ; then SYSROOT_DIR="${SYSROOT_DIR}"; if ! test -f ${SYSROOT_DIR}/usr/include/bits/uClibc_config.h ; then echo "Incorrect selection of the C library"; exit -1; fi; UCLIBC_CONFIG_FILE=${SYSROOT_DIR}/usr/include/bits/uClibc_config.h ; IS_IN_LIBC=`grep -q "#define __ARCH_USE_MMU__ 1" ${UCLIBC_CONFIG_FILE} && echo y` ; if [ -z "BR2_USE_MMU" ] ; then if [ "${IS_IN_LIBC}" != "y" ] ; then echo "MMU support not available in C library, toolchain unsuitable for Buildroot" ; exit 1 ; fi ; else if [ "y" != "y" -a "${IS_IN_LIBC}" = "y" ] ; then echo "MMU support available in C library, please enable BR2_USE_MMU" ; exit 1 ; fi ; if [ "y" = "y" -a "${IS_IN_LIBC}" != "y" ] ; then echo "MMU support not available in C library, please disable BR2_USE_MMU" ; exit 1 ; fi ; fi ; IS_IN_LIBC=`grep -q "#define __UCLIBC_HAS_LFS__ 1" ${UCLIBC_CONFIG_FILE} && echo y` ; if [ -z "" ] ; then if [ "${IS_IN_LIBC}" != "y" ] ; then echo "Large file support not available in C library, toolchain unsuitable for Buildroot" ; exit 1 ; fi ; else if [ "" != "y" -a "${IS_IN_LIBC}" = "y" ] ; then echo "Large file support available in C library, please enable " ; exit 1 ; fi ; if [ "" = "y" -a "${IS_IN_LIBC}" != "y" ] ; then echo "Large file support not available in C library, please disable " ; exit 1 ; fi ; fi ; IS_IN_LIBC=`grep -q "#define __UCLIBC_HAS_IPV6__ 1" ${UCLIBC_CONFIG_FILE} && echo y` ; if [ -z "" ] ; then if [ "${IS_IN_LIBC}" != "y" ] ; then echo "IPv6 support not available in C library, toolchain unsuitable for Buildroot" ; exit 1 ; fi ; else if [ "" != "y" -a "${IS_IN_LIBC}" = "y" ] ; then echo "IPv6 support available in C library, please enable " ; exit 1 ; fi ; if [ "" = "y" -a "${IS_IN_LIBC}" != "y" ] ; then echo "IPv6 support not available in C library, please disable " ; exit 1 ; fi ; fi ; IS_IN_LIBC=`grep -q "#define __UCLIBC_HAS_RPC__ 1" ${UCLIBC_CONFIG_FILE} && echo y` ; if [ -z "BR2_TOOLCHAIN_HAS_NATIVE_RPC" ] ; then if [ "${IS_IN_LIBC}" != "y" ] ; then echo "RPC support not available in C library, toolchain unsuitable for Buildroot" ; exit 1 ; fi ; else if [ "" != "y" -a "${IS_IN_LIBC}" = "y" ] ; then echo "RPC support available in C library, please enable BR2_TOOLCHAIN_HAS_NATIVE_RPC" ; exit 1 ; fi ; if [ "" = "y" -a "${IS_IN_LIBC}" != "y" ] ; then echo "RPC support not available in C library, please disable BR2_TOOLCHAIN_HAS_NATIVE_RPC" ; exit 1 ; fi ; fi ; IS_IN_LIBC=`grep -q "#define __UCLIBC_HAS_XLOCALE__ 1" ${UCLIBC_CONFIG_FILE} && echo y` ; if [ -z "BR2_ENABLE_LOCALE" ] ; then if [ "${IS_IN_LIBC}" != "y" ] ; then echo "Locale support not available in C library, toolchain unsuitable for Buildroot" ; exit 1 ; fi ; else if [ "y" != "y" -a "${IS_IN_LIBC}" = "y" ] ; then echo "Locale support available in C library, please enable BR2_ENABLE_LOCALE" ; exit 1 ; fi ; if [ "y" = "y" -a "${IS_IN_LIBC}" != "y" ] ; then echo "Locale support not available in C library, please disable BR2_ENABLE_LOCALE" ; exit 1 ; fi ; fi ; IS_IN_LIBC=`grep -q "#define __UCLIBC_HAS_WCHAR__ 1" ${UCLIBC_CONFIG_FILE} && echo y` ; if [ -z "BR2_USE_WCHAR" ] ; then if [ "${IS_IN_LIBC}" != "y" ] ; then echo "Wide char support not available in C library, toolchain unsuitable for Buildroot" ; exit 1 ; fi ; else if [ "y" != "y" -a "${IS_IN_LIBC}" = "y" ] ; then echo "Wide char support available in C library, please enable BR2_USE_WCHAR" ; exit 1 ; fi ; if [ "y" = "y" -a "${IS_IN_LIBC}" != "y" ] ; then echo "Wide char support not available in C library, please disable BR2_USE_WCHAR" ; exit 1 ; fi ; fi ; IS_IN_LIBC=`grep -q "#define __UCLIBC_HAS_THREADS__ 1" ${UCLIBC_CONFIG_FILE} && echo y` ; if [ -z "BR2_TOOLCHAIN_HAS_THREADS" ] ; then if [ "${IS_IN_LIBC}" != "y" ] ; then echo "Thread support not available in C library, toolchain unsuitable for Buildroot" ; exit 1 ; fi ; else if [ "y" != "y" -a "${IS_IN_LIBC}" = "y" ] ; then echo "Thread support available in C library, please enable BR2_TOOLCHAIN_HAS_THREADS" ; exit 1 ; fi ; if [ "y" = "y" -a "${IS_IN_LIBC}" != "y" ] ; then echo "Thread support not available in C library, please disable BR2_TOOLCHAIN_HAS_THREADS" ; exit 1 ; fi ; fi ; IS_IN_LIBC=`grep -q "#define __PTHREADS_DEBUG_SUPPORT__ 1" ${UCLIBC_CONFIG_FILE} && echo y` ; if [ -z "BR2_TOOLCHAIN_HAS_THREADS_DEBUG" ] ; then if [ "${IS_IN_LIBC}" != "y" ] ; then echo "Thread debugging support not available in C library, toolchain unsuitable for Buildroot" ; exit 1 ; fi ; else if [ "y" != "y" -a "${IS_IN_LIBC}" = "y" ] ; then echo "Thread debugging support available in C library, please enable BR2_TOOLCHAIN_HAS_THREADS_DEBUG" ; exit 1 ; fi ; if [ "y" = "y" -a "${IS_IN_LIBC}" != "y" ] ; then echo "Thread debugging support not available in C library, please disable BR2_TOOLCHAIN_HAS_THREADS_DEBUG" ; exit 1 ; fi ; fi ; IS_IN_LIBC=`grep -q "#define __UCLIBC_HAS_THREADS_NATIVE__ 1" ${UCLIBC_CONFIG_FILE} && echo y` ; if [ -z "BR2_TOOLCHAIN_HAS_THREADS_NPTL" ] ; then if [ "${IS_IN_LIBC}" != "y" ] ; then echo "NPTL thread support not available in C library, toolchain unsuitable for Buildroot" ; exit 1 ; fi ; else if [ "y" != "y" -a "${IS_IN_LIBC}" = "y" ] ; then echo "NPTL thread support available in C library, please enable BR2_TOOLCHAIN_HAS_THREADS_NPTL" ; exit 1 ; fi ; if [ "y" = "y" -a "${IS_IN_LIBC}" != "y" ] ; then echo "NPTL thread support not available in C library, please disable BR2_TOOLCHAIN_HAS_THREADS_NPTL" ; exit 1 ; fi ; fi ; elif test "" = "y" ; then __CROSS_CC="/home/sean.linux/optee/toolchains/aarch64/bin/aarch64-linux-gcc.br_real -mcpu=cortex-a53 -mabi=lp64 " ; libc_a_path=`${__CROSS_CC} -print-file-name=libc.a` ; if ! strings ${libc_a_path} | grep -q MUSL_LOCPATH ; then echo "Incorrect selection of the C library" ; exit -1; fi ; else SYSROOT_DIR="${SYSROOT_DIR}"; if test `find -L ${SYSROOT_DIR}/ -maxdepth 2 -name 'ld-linux*.so.*' -o -name 'ld.so.*' -o -name 'ld64.so.*' | wc -l` -eq 0 ; then echo "Incorrect selection of the C library"; exit -1; fi; if [ "y" != "y" ] ; then echo "MMU support available in C library, please enable BR2_USE_MMU" ; exit 1 ; fi ; IS_IN_LIBC=`test -f ${SYSROOT_DIR}/usr/include/rpc/rpc.h && echo y` ; if [ "" != "y" -a "${IS_IN_LIBC}" = "y" ] ; then echo "RPC support available in C library, please enable BR2_TOOLCHAIN_EXTERNAL_INET_RPC" ; exit 1 ; fi ; if [ "" = "y" -a "${IS_IN_LIBC}" != "y" ] ; then echo "RPC support not available in C library, please disable BR2_TOOLCHAIN_EXTERNAL_INET_RPC" ; exit 1 ; fi ; fi
Incorrect selection of gcc version: expected 12.x, got 11.4.0
make[2]: *** [package/pkg-generic.mk:273: /home/sean.linux/optee/out-br/build/toolchain-external-custom/.stamp_configured] Error 1
make[1]: *** [Makefile:23: _all] Error 2
make[1]: Leaving directory '/home/sean.linux/optee/out-br'
make: *** [common.mk:341: buildroot] Error 2
jforissier commented 1 month ago

Hmmm it worked for me (make check passed) but I must admit I started with 12.x then did not make clean but only rm -rf optee_os/out.

Could you try adding this:

diff --git a/br-ext/configs/toolchain-aarch32-sdk b/br-ext/configs/toolchain-aarch32-sdk
index 3537196..ae59dd7 100644
--- a/br-ext/configs/toolchain-aarch32-sdk
+++ b/br-ext/configs/toolchain-aarch32-sdk
@@ -2,7 +2,7 @@ BR2_TOOLCHAIN_EXTERNAL=y
 BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
 BR2_TOOLCHAIN_EXTERNAL_PATH="%TOP_DIR%/toolchains/aarch32"
 BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-linux"
-BR2_TOOLCHAIN_EXTERNAL_GCC_12=y
+BR2_TOOLCHAIN_EXTERNAL_GCC_11=y
 BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_1=y
 BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
 BR2_TOOLCHAIN_EXTERNAL_CXX=y
diff --git a/br-ext/configs/toolchain-aarch64-sdk b/br-ext/configs/toolchain-aarch64-sdk
index 342b6a8..19a75f1 100644
--- a/br-ext/configs/toolchain-aarch64-sdk
+++ b/br-ext/configs/toolchain-aarch64-sdk
@@ -2,7 +2,7 @@ BR2_TOOLCHAIN_EXTERNAL=y
 BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
 BR2_TOOLCHAIN_EXTERNAL_PATH="%TOP_DIR%/toolchains/aarch64"
 BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="aarch64-linux"
-BR2_TOOLCHAIN_EXTERNAL_GCC_12=y
+BR2_TOOLCHAIN_EXTERNAL_GCC_11=y
 BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_1=y
 BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
 BR2_TOOLCHAIN_EXTERNAL_CXX=y
msgilligan commented 1 month ago

Could you try adding this:

It works now!

jforissier commented 1 month ago

Could you try adding this:

It works now!

Excellent! Thanks for checking. I will push an update, you may give a Tested-by: Your Name <your@email> if you want.

msgilligan commented 1 month ago

Tested-by: Sean Gilligan sean@msgilligan.com