diff --git a/.github/actions/setup_build/action.yml b/.github/actions/setup_build/action.yml index aa78e4f7b..f19628efb 100644 --- a/.github/actions/setup_build/action.yml +++ b/.github/actions/setup_build/action.yml @@ -58,13 +58,13 @@ runs: sudo apt-get install --yes gcc-multilib g++-multilib libc6-dev:i386 lib32tinfo-dev; \ fi if [ "${{ inputs.cross_arch }}" = "arm" ]; then \ - sudo apt-get install --yes gcc-11-arm-linux-gnueabihf g++-11-arm-linux-gnueabihf; \ + sudo apt-get install --yes gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf; \ fi if [ "${{ inputs.cross_arch }}" = "aarch64" ]; then \ - sudo apt-get install --yes gcc-11-aarch64-linux-gnu g++-11-aarch64-linux-gnu; \ + sudo apt-get install --yes gcc-aarch64-linux-gnu g++-aarch64-linux-gnu; \ fi if [ "${{ inputs.cross_arch }}" = "riscv64" ]; then \ - sudo apt-get install --yes gcc-11-riscv64-linux-gnu g++-11-riscv64-linux-gnu; \ + sudo apt-get install --yes gcc-riscv64-linux-gnu g++-riscv64-linux-gnu; \ fi if [ "${{ inputs.cross_arch }}" != "none" ] && [ "${{ inputs.cross_arch }}" != "x86" ]; then \ # Install QEMU for testing cross compilation. diff --git a/CMakeLists.txt b/CMakeLists.txt index 3947a0468..853a12baf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,9 +50,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL MSVC AND endif() if(MSVC AND (CMAKE_SIZEOF_VOID_P EQUAL 4) AND - (CMAKE_SYSTEM_PROCESSOR STREQUAL x86 OR - CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR - CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64)) + (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i[3-6]86|x86(_64)?|AMD64)$")) message(FATAL_ERROR "Windows 32 bit is no longer supported by oneAPI Construction Kit") endif() diff --git a/cmake/AddCA.cmake b/cmake/AddCA.cmake index 5cd0dfd73..086557dc6 100644 --- a/cmake/AddCA.cmake +++ b/cmake/AddCA.cmake @@ -60,9 +60,7 @@ if (CA_ENABLE_TESTS) endif() if(NOT MSVC AND (CA_BUILD_32_BITS OR CMAKE_SIZEOF_VOID_P EQUAL 4) AND - (CMAKE_SYSTEM_PROCESSOR STREQUAL x86 OR - CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR - CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64)) + (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i[3-6]86|x86(_64)?|AMD64)$")) # Enable 32 bit builds when requested or detected and enable sse3 # instructions. set(BUILD_32_BIT_FLAG "-m32 -msse3 -mfpmath=sse") diff --git a/modules/compiler/targets/host/CMakeLists.txt b/modules/compiler/targets/host/CMakeLists.txt index ac18a0d74..584f30b07 100644 --- a/modules/compiler/targets/host/CMakeLists.txt +++ b/modules/compiler/targets/host/CMakeLists.txt @@ -152,9 +152,7 @@ if(CA_HOST_CROSS_COMPILERS) # Get the current architecture. string(TOUPPER "${CMAKE_SYSTEM_PROCESSOR}" CMAKE_SYSTEM_PROCESSOR_TOUPPER) - if(CMAKE_SYSTEM_PROCESSOR_TOUPPER STREQUAL X86 OR - CMAKE_SYSTEM_PROCESSOR_TOUPPER STREQUAL X86_64 OR - CMAKE_SYSTEM_PROCESSOR_TOUPPER STREQUAL AMD64) + if(CMAKE_SYSTEM_PROCESSOR_TOUPPER MATCHES "^(I[3-6]86|X86(_64)?|AMD64)$") if(CA_BUILD_32_BITS OR CMAKE_SIZEOF_VOID_P EQUAL 4) set(HostArchitecture x86) else() diff --git a/modules/mux/targets/CMakeLists.txt b/modules/mux/targets/CMakeLists.txt index bcc8edf3a..4fca45774 100644 --- a/modules/mux/targets/CMakeLists.txt +++ b/modules/mux/targets/CMakeLists.txt @@ -85,7 +85,7 @@ function(get_ca_host_arch parent_variable_name) set(${parent_variable_name} "Arm" PARENT_SCOPE) elseif(ARCH STREQUAL "ARM64" OR ARCH STREQUAL "AARCH64") set(${parent_variable_name} "AArch64" PARENT_SCOPE) - elseif(ARCH STREQUAL "X86") + elseif(ARCH MATCHES "^(I[3-6]86|X86)$") set(${parent_variable_name} "x86" PARENT_SCOPE) elseif(ARCH STREQUAL "X86_64" OR ARCH STREQUAL "AMD64") if(CA_BUILD_32_BITS OR ${CMAKE_SIZEOF_VOID_P} EQUAL 4) diff --git a/platform/x86-linux/x86-toolchain.cmake b/platform/x86-linux/x86-toolchain.cmake new file mode 100644 index 000000000..26d9e13b1 --- /dev/null +++ b/platform/x86-linux/x86-toolchain.cmake @@ -0,0 +1,28 @@ +# Copyright (C) Codeplay Software Limited +# +# Licensed under the Apache License, Version 2.0 (the "License") with LLVM +# Exceptions; you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://github.com/codeplaysoftware/oneapi-construction-kit/blob/main/LICENSE.txt +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR i686) + +set(TOOLCHAIN_TRIPLE "i686-linux-gnu") +set(CMAKE_C_FLAGS -m32) +set(CMAKE_CXX_FLAGS -m32) +set(PKG_CONFIG_EXECUTABLE "${TOOLCHAIN_TRIPLE}-pkg-config") + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)