Merge branch '2023-04-04-update-to-clang-16'

- Update our CI to use clang-16 for tests. This also changes slightly
  how we do linker lists so that we don't rely on undefined behavior
  that lead to clang-15 and later failing to work (and in some cases
  seemingly, earlier versions of clang would sometimes fail).
This commit is contained in:
Tom Rini 2023-04-04 14:36:43 -04:00
commit 698c2bd364
6 changed files with 35 additions and 15 deletions

View file

@ -2,7 +2,7 @@ variables:
windows_vm: windows-2019
ubuntu_vm: ubuntu-22.04
macos_vm: macOS-12
ci_runner_image: trini/u-boot-gitlab-ci-runner:jammy-20230308-21Mar2023
ci_runner_image: trini/u-boot-gitlab-ci-runner:jammy-20230308-04Apr2023
# Add '-u 0' options for Azure pipelines, otherwise we get "permission
# denied" error when it tries to "useradd -m -u 1001 vsts_azpcontainer",
# since our $(ci_runner_image) user is not root.
@ -254,7 +254,7 @@ stages:
TEST_PY_BD: "sandbox"
sandbox_clang:
TEST_PY_BD: "sandbox"
OVERRIDE: "-O clang-14"
OVERRIDE: "-O clang-16"
sandbox_nolto:
TEST_PY_BD: "sandbox"
BUILD_ENV: "NO_LTO=1"
@ -509,7 +509,7 @@ stages:
OVERRIDE: "-a ASAN"
sandbox_clang_asan:
BUILDMAN: "sandbox"
OVERRIDE: "-O clang-14 -a ASAN"
OVERRIDE: "-O clang-16 -a ASAN"
samsung_socfpga:
BUILDMAN: "samsung socfpga"
sun4i:

View file

@ -10,7 +10,7 @@ default:
# Grab our configured image. The source for this is found
# in the u-boot tree at tools/docker/Dockerfile
image: ${MIRROR_DOCKER}/trini/u-boot-gitlab-ci-runner:jammy-20230308-21Mar2023
image: ${MIRROR_DOCKER}/trini/u-boot-gitlab-ci-runner:jammy-20230308-04Apr2023
# We run some tests in different order, to catch some failures quicker.
stages:
@ -277,7 +277,7 @@ sandbox test.py:
sandbox with clang test.py:
variables:
TEST_PY_BD: "sandbox"
OVERRIDE: "-O clang-14"
OVERRIDE: "-O clang-16"
<<: *buildman_and_testpy_dfn
sandbox without LTO test.py:

View file

@ -24,6 +24,7 @@ CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
CONFIG_SPL=y
CONFIG_ENV_OFFSET_REDUND=0x180000
CONFIG_SYS_LOAD_ADDR=0x22000000
CONFIG_LTO=y
CONFIG_FIT=y
CONFIG_NAND_BOOT=y
CONFIG_BOOTDELAY=3

View file

@ -127,7 +127,9 @@
static char start[0] __aligned(CONFIG_LINKER_LIST_ALIGN) \
__attribute__((unused)) \
__section("__u_boot_list_2_"#_list"_1"); \
(_type *)&start; \
_type * tmp = (_type *)&start; \
asm("":"+r"(tmp)); \
tmp; \
})
/**
@ -153,7 +155,9 @@
({ \
static char end[0] __aligned(4) __attribute__((unused)) \
__section("__u_boot_list_2_"#_list"_3"); \
(_type *)&end; \
_type * tmp = (_type *)&end; \
asm("":"+r"(tmp)); \
tmp; \
})
/**
* ll_entry_count() - Return the number of elements in linker-generated array
@ -247,7 +251,9 @@
({ \
static char start[0] __aligned(4) __attribute__((unused)) \
__section("__u_boot_list_1"); \
(_type *)&start; \
_type * tmp = (_type *)&start; \
asm("":"+r"(tmp)); \
tmp; \
})
/**
@ -270,7 +276,9 @@
({ \
static char end[0] __aligned(4) __attribute__((unused)) \
__section("__u_boot_list_3"); \
(_type *)&end; \
_type * tmp = (_type *)&end; \
asm("":"+r"(tmp)); \
tmp; \
})
#endif /* __ASSEMBLY__ */

View file

@ -8,21 +8,21 @@ fixtures==3.0.0
importlib-metadata==0.23
linecache2==1.0.0
more-itertools==7.2.0
packaging==19.2
packaging==21.3
pbr==5.4.3
pluggy==0.13.0
py==1.10.0
pycryptodomex==3.9.8
pyelftools==0.27
pygit2==1.9.2
pyparsing==2.4.2
pyparsing==3.0.7
pytest==6.2.5
pytest-xdist==2.5.0
python-mimeparse==1.6.0
python-subunit==1.3.0
requests==2.25.1
requests==2.27.1
setuptools==58.3.0
six==1.12.0
six==1.16.0
testtools==2.3.0
traceback2==1.4.0
unittest2==1.1.0

View file

@ -12,7 +12,7 @@ ENV DEBIAN_FRONTEND=noninteractive
# Add LLVM repository
RUN apt-get update && apt-get install -y gnupg2 wget xz-utils && rm -rf /var/lib/apt/lists/*
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main | tee /etc/apt/sources.list.d/llvm.list
RUN echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main | tee /etc/apt/sources.list.d/llvm.list
# Manually install the kernel.org "Crosstool" based toolchains for gcc-12.2.0
RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12.2.0/x86_64-gcc-12.2.0-nolibc-aarch64-linux.tar.xz | tar -C /opt -xJ
@ -39,7 +39,7 @@ RUN apt-get update && apt-get install -y \
binutils-dev \
bison \
build-essential \
clang-14 \
clang-16 \
coreutils \
cpio \
cppcheck \
@ -265,6 +265,17 @@ RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot
RUN useradd -m -U uboot
USER uboot:uboot
# Populate the cache for pip to use. Get these via wget as the
# COPY / ADD directives don't work as we need them to.
RUN wget -O /tmp/pytest-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/test/py/requirements.txt
RUN wget -O /tmp/sphinx-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/doc/sphinx/requirements.txt
RUN virtualenv -p /usr/bin/python3 /tmp/venv && \
. /tmp/venv/bin/activate && \
pip install -r /tmp/pytest-requirements.txt \
-r /tmp/sphinx-requirements.txt && \
deactivate && \
rm -rf /tmp/venv /tmp/pytest-requirements.txt /tmp/sphinx-requirements.txt
# Create the buildman config file
RUN /bin/echo -e "[toolchain]\nroot = /usr" > ~/.buildman
RUN /bin/echo -e "kernelorg = /opt/gcc-12.2.0-nolibc/*" >> ~/.buildman