From 719301693d3c176a7f1c86317bad8baa449a57ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 18 Aug 2020 10:28:51 +0200 Subject: [PATCH 1/3] Add arm-linux-gnueabi-gcc build to all.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently it can't be mandatory, since we can't install the required toolchain on Jenkins right away. Also, while at it, remove `SHELL='sh -x'` from the other arm5vte component; it was a leftover from debugging. Signed-off-by: Manuel Pégourié-Gonnard --- tests/scripts/all.sh | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 388bdf8fe..dcf25c4a1 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -161,6 +161,7 @@ pre_initialize_variables () { : ${ARMC5_BIN_DIR:=/usr/bin} : ${ARMC6_BIN_DIR:=/usr/bin} : ${ARM_NONE_EABI_GCC_PREFIX:=arm-none-eabi-} + : ${ARM_LINUX_GNUEABI_GCC_PREFIX:=arm-linux-gnueabi-} # if MAKEFLAGS is not set add the -j option to speed up invocations of make if [ -z "${MAKEFLAGS+set}" ]; then @@ -230,6 +231,9 @@ General options: --arm-none-eabi-gcc-prefix= Prefix for a cross-compiler for arm-none-eabi (default: "${ARM_NONE_EABI_GCC_PREFIX}") + --arm-linux-gnueabi-gcc-prefix= + Prefix for a cross-compiler for arm-linux-gnueabi + (default: "${ARM_LINUX_GNUEABI_GCC_PREFIX}") --armcc Run ARM Compiler builds (on by default). --except Exclude the COMPONENTs listed on the command line, instead of running only those. @@ -377,6 +381,7 @@ pre_parse_command_line () { case "$1" in --append-outcome) append_outcome=1;; --arm-none-eabi-gcc-prefix) shift; ARM_NONE_EABI_GCC_PREFIX="$1";; + --arm-linux-gnueabi-gcc-prefix) shift; ARM_LINUX_GNUEABI_GCC_PREFIX="$1";; --armcc) no_armcc=;; --armc5-bin-dir) shift; ARMC5_BIN_DIR="$1";; --armc6-bin-dir) shift; ARMC6_BIN_DIR="$1";; @@ -2532,14 +2537,29 @@ component_build_arm_none_eabi_gcc () { ${ARM_NONE_EABI_GCC_PREFIX}size library/*.o } -component_build_arm_none_eabi_gcc_arm5vte () { - msg "build: ${ARM_NONE_EABI_GCC_PREFIX}gcc -march=arm5vte" # ~ 10s +component_build_arm_linux_gnueabi_gcc_arm5vte () { + msg "build: ${ARM_LINUX_GNUEABI_GCC_PREFIX}gcc -march=arm5vte" # ~ 10s scripts/config.py baremetal # Build for a target platform that's close to what Debian uses # for its "armel" distribution (https://wiki.debian.org/ArmEabiPort). # See https://github.com/ARMmbed/mbedtls/pull/2169 and comments. - # It would be better to build with arm-linux-gnueabi-gcc but - # we don't have that on our CI at this time. + # Build everything including programs, see for example + # https://github.com/ARMmbed/mbedtls/pull/3449#issuecomment-675313720 + make CC="${ARM_LINUX_GNUEABI_GCC_PREFIX}gcc" AR="${ARM_LINUX_GNUEABI_GCC_PREFIX}ar" CFLAGS='-Werror -Wall -Wextra -march=armv5te -O1' LDFLAGS='-march=armv5te' + + msg "size: ${ARM_LINUX_GNUEABI_GCC_PREFIX}gcc -march=armv5te -O1" + ${ARM_LINUX_GNUEABI_GCC_PREFIX}size library/*.o +} +support_build_arm_linux_gnueabi_gcc_arm5vte () { + type ${ARM_LINUX_GNUEABI_GCC_PREFIX}gcc >/dev/null 2>&1 +} + +component_build_arm_none_eabi_gcc_arm5vte () { + msg "build: ${ARM_NONE_EABI_GCC_PREFIX}gcc -march=arm5vte" # ~ 10s + scripts/config.py baremetal + # This is an imperfect substitute for + # component_build_arm_linux_gnueabi_gcc_arm5vte + # in case the gcc-arm-linux-gnueabihf toolchain is not available make CC="${ARM_NONE_EABI_GCC_PREFIX}gcc" AR="${ARM_NONE_EABI_GCC_PREFIX}ar" CFLAGS='-std=c99 -Werror -Wall -Wextra -march=armv5te -O1' LDFLAGS='-march=armv5te' SHELL='sh -x' lib msg "size: ${ARM_NONE_EABI_GCC_PREFIX}gcc -march=armv5te -O1" From cbb365ce3b3f4aef1908ce486a6a0e7c1a5cdba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 18 Aug 2020 10:31:36 +0200 Subject: [PATCH 2/3] Enable arm-linux-gnueabi-gcc build on Travis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Pégourié-Gonnard --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e859cbba3..f1824165d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ jobs: - graphviz - gcc-arm-none-eabi - libnewlib-arm-none-eabi + - gcc-arm-linux-gnueabi language: python # Needed to get pip for Python 3 python: 3.5 # version from Ubuntu 16.04 install: @@ -21,8 +22,8 @@ jobs: script: - tests/scripts/all.sh -k 'check_*' - tests/scripts/all.sh -k test_default_out_of_box - - tests/scripts/test-ref-configs.pl - - tests/scripts/all.sh -k build_arm_none_eabi_gcc_arm5vte build_arm_none_eabi_gcc_m0plus + - tests/scripts/all.sh -k test_ref_configs + - tests/scripts/all.sh -k build_arm_linux_gnueabi_gcc_arm5vte build_arm_none_eabi_gcc_m0plus - name: full configuration script: From 9a260a628a85d0dc971f7812ba341c1248a0e467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 6 Jul 2021 09:44:59 +0200 Subject: [PATCH 3/3] Fix missing dependency on Travis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was getting errors like: In file included from /usr/include/limits.h:25:0, from /usr/lib/gcc-cross/arm-linux-gnueabi/5/include-fixed/limits.h:168, from /usr/lib/gcc-cross/arm-linux-gnueabi/5/include-fixed/syslimits.h:7, from /usr/lib/gcc-cross/arm-linux-gnueabi/5/include-fixed/limits.h:34, from ../include/mbedtls/check_config.h:30, from ../include/mbedtls/build_info.h:81, from common.h:26, from asn1write.c:20: /usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory There are two packages to choose from: armhf or armel. Since the comment in all.sh says we're trying to be close to Debian's "armel" architecture, choose that, and fix a comment that was mentioning gnueabihf for no apparent reason. Signed-off-by: Manuel Pégourié-Gonnard --- .travis.yml | 1 + tests/scripts/all.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f1824165d..56e145649 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ jobs: - gcc-arm-none-eabi - libnewlib-arm-none-eabi - gcc-arm-linux-gnueabi + - libc6-dev-armel-cross language: python # Needed to get pip for Python 3 python: 3.5 # version from Ubuntu 16.04 install: diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index dcf25c4a1..126ebc5cf 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -2559,7 +2559,7 @@ component_build_arm_none_eabi_gcc_arm5vte () { scripts/config.py baremetal # This is an imperfect substitute for # component_build_arm_linux_gnueabi_gcc_arm5vte - # in case the gcc-arm-linux-gnueabihf toolchain is not available + # in case the gcc-arm-linux-gnueabi toolchain is not available make CC="${ARM_NONE_EABI_GCC_PREFIX}gcc" AR="${ARM_NONE_EABI_GCC_PREFIX}ar" CFLAGS='-std=c99 -Werror -Wall -Wextra -march=armv5te -O1' LDFLAGS='-march=armv5te' SHELL='sh -x' lib msg "size: ${ARM_NONE_EABI_GCC_PREFIX}gcc -march=armv5te -O1"