diff --git a/.github/workflows/c-cpp-clang.yml b/.github/workflows/c-cpp-clang.yml new file mode 100644 index 00000000..29cfb2e9 --- /dev/null +++ b/.github/workflows/c-cpp-clang.yml @@ -0,0 +1,19 @@ +name: C/C++ CI (CLang) + +on: + push: + branches: [ mainline ] + pull_request: + branches: [ mainline ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: make clean + run: make clean + - name: make CC=clang all + run: make CC=clang all diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp-gcc.yml similarity index 73% rename from .github/workflows/c-cpp.yml rename to .github/workflows/c-cpp-gcc.yml index ade9d4c0..58b38fe6 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp-gcc.yml @@ -1,4 +1,4 @@ -name: C/C++ CI +name: C/C++ CI (GCC) on: push: @@ -15,5 +15,5 @@ jobs: - uses: actions/checkout@v2 - name: make clean run: make clean - - name: make all - run: make all + - name: make CC=gcc all + run: make CC=gcc all diff --git a/.github/workflows/docker-ci.yml b/.github/workflows/docker-ci.yml index e20f6d2e..e8e169c8 100644 --- a/.github/workflows/docker-ci.yml +++ b/.github/workflows/docker-ci.yml @@ -15,9 +15,13 @@ jobs: DEBIAN_FRONTEND: noninteractive run: | sudo apt-get update - sudo apt-get install -y build-essential qemu qemu-user + sudo apt-get install -y build-essential clang qemu qemu-user - uses: actions/checkout@v2 - - name: Build the Docker image - run: ./tools/ci/build-docker.sh - - name: Run the Docker image - run: ./tools/ci/launch-test.sh + - name: Build the Docker image (GCC) + run: ./tools/ci/build-docker.sh gcc + - name: Run the Docker image (GCC) + run: ./tools/ci/launch-test.sh gcc + - name: Build the Docker image (CLang) + run: ./tools/ci/build-docker.sh clang + - name: Run the Docker image (CLang) + run: ./tools/ci/launch-test.sh clang diff --git a/drivers/acpi/acpica/acktf.h b/drivers/acpi/acpica/acktf.h index 1f267105..1dc14b79 100644 --- a/drivers/acpi/acpica/acktf.h +++ b/drivers/acpi/acpica/acktf.h @@ -68,6 +68,10 @@ #define ACPI_INIT_FUNCTION #define ACPI_CACHE_T ACPI_MEMORY_LIST +#define ACPI_UINTPTR_T uintptr_t +#define ACPI_TO_INTEGER(p) ((uintptr_t)(p)) +#define ACPI_OFFSET(d, f) offsetof(d, f) + /* Host-dependent types and defines for in-kernel ACPICA */ #define ACPI_EXPORT_SYMBOL(symbol) diff --git a/tools/ci/build-docker.sh b/tools/ci/build-docker.sh index 3ff5ffc0..c73ebb83 100755 --- a/tools/ci/build-docker.sh +++ b/tools/ci/build-docker.sh @@ -5,6 +5,8 @@ # This script builds the project's boot.iso file in the docker environment set -e +COMPILER=$1 + # Execute relative to this script SCRIPTDIR="$( cd "$(dirname "$0")" ; pwd -P )" declare -r SCRIPTDIR @@ -14,4 +16,4 @@ cd "$SCRIPTDIR"/../.. # Build project in docker make clean V=1 -make docker:boot.iso V=1 +make docker:boot.iso V=1 CC=$COMPILER diff --git a/tools/ci/launch-test.sh b/tools/ci/launch-test.sh index 37dd8d17..55993cf3 100755 --- a/tools/ci/launch-test.sh +++ b/tools/ci/launch-test.sh @@ -6,6 +6,8 @@ # next launches a test and checks for a successful timeout. set -e +COMPILER=$1 + # Execute relative to this script SCRIPTDIR="$( cd "$(dirname "$0")" ; pwd -P )" declare -r SCRIPTDIR @@ -16,12 +18,12 @@ cd "$SCRIPTDIR"/../.. # Build project in docker echo "Building project from scratch" make clean V=1 -make UNITTEST=1 docker:boot.iso V=1 +make UNITTEST=1 docker:boot.iso V=1 CC=$COMPILER # Use QEMU to launch the guest echo "Launching KTF" declare -i STATUS=0 -timeout 10 make UNITTEST=1 docker:boot V=1 || STATUS=$? +timeout 10 make UNITTEST=1 docker:boot V=1 CC=$COMPILER || STATUS=$? # Check if the expected exit code happened (124 for timeout) if [ "$STATUS" -ne 0 ] && [ "$STATUS" -ne 124 ] diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index ca8a73cf..650b7d9a 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:latest # build dependencies RUN apt-get update -y -RUN apt-get install -y build-essential make xorriso qemu-utils qemu qemu-system-x86 patch +RUN apt-get install -y build-essential clang make xorriso qemu-utils qemu qemu-system-x86 patch # grub is a bit special in containers RUN DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install grub2 kmod python3