Added ASMJIT_NO_FOREIGN compile-time option to disable non-host architectures in the future

This commit is contained in:
kobalicek
2020-07-07 10:27:46 +02:00
parent 2de7e74244
commit c130455898
9 changed files with 175 additions and 78 deletions

View File

@@ -19,7 +19,7 @@ matrix:
node_js: node_js:
- node - node
- name: "Linux Clang Default [64-bit] [DBG]" - name: "Linux Clang Default [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=clang-9 && CXX=clang++-9" env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=clang-9 && CXX=clang++-9"
os: linux os: linux
addons: addons:
@@ -28,7 +28,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [clang++-9] packages: [clang++-9]
- name: "Linux Clang Default [64-bit] [REL]" - name: "Linux Clang Default [X64] [REL]"
env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9"
os: linux os: linux
addons: addons:
@@ -37,7 +37,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [clang++-9] packages: [clang++-9]
- name: "Linux Clang Default [64-bit] [REL] [Valgrind]" - name: "Linux Clang Default [X64] [REL] [Valgrind]"
env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" USE_VALGRIND=1 env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" USE_VALGRIND=1
os: linux os: linux
addons: addons:
@@ -46,7 +46,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [clang++-9, valgrind] packages: [clang++-9, valgrind]
- name: "Linux Clang Default [64-bit] [REL] [Sanitize=Address]" - name: "Linux Clang Default [X64] [REL] [Sanitize=Address]"
env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_SANITIZE=address" env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_SANITIZE=address"
os: linux os: linux
addons: addons:
@@ -55,7 +55,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [clang++-9] packages: [clang++-9]
- name: "Linux Clang Default [64-bit] [REL] [Sanitize=Undefined]" - name: "Linux Clang Default [X64] [REL] [Sanitize=Undefined]"
env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_SANITIZE=undefined" env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_SANITIZE=undefined"
os: linux os: linux
addons: addons:
@@ -64,7 +64,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [clang++-9] packages: [clang++-9]
- name: "Linux Clang Default [64-bit] [REL] [NoDeprecated]" - name: "Linux Clang Default [X64] [REL] [NoDeprecated]"
env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_NO_DEPRECATED=1" env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_NO_DEPRECATED=1"
os: linux os: linux
addons: addons:
@@ -73,7 +73,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [clang++-9] packages: [clang++-9]
- name: "Linux Clang Default [64-bit] [REL] [NoIntrinsics]" - name: "Linux Clang Default [X64] [REL] [NoIntrinsics]"
env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_NO_INTRINSICS=1" env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_NO_INTRINSICS=1"
os: linux os: linux
addons: addons:
@@ -82,7 +82,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [clang++-9] packages: [clang++-9]
- name: "Linux Clang Default [64-bit] [REL] [NoLogging]" - name: "Linux Clang Default [X64] [REL] [NoLogging]"
env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_NO_LOGGING=1" env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_NO_LOGGING=1"
os: linux os: linux
addons: addons:
@@ -91,7 +91,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [clang++-9] packages: [clang++-9]
- name: "Linux Clang Default [64-bit] [REL] [NoBuilder]" - name: "Linux Clang Default [X64] [REL] [NoBuilder]"
env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_NO_BUILDER=1" env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_NO_BUILDER=1"
os: linux os: linux
addons: addons:
@@ -100,7 +100,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [clang++-9] packages: [clang++-9]
- name: "Linux Clang Default [64-bit] [REL] [NoCompiler]" - name: "Linux Clang Default [X64] [REL] [NoCompiler]"
env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_NO_COMPILER=1" env: BUILD_MATRIX="BUILD_TYPE=Release && CC=clang-9 && CXX=clang++-9" EXTRA_OPTIONS="-DASMJIT_NO_COMPILER=1"
os: linux os: linux
addons: addons:
@@ -109,77 +109,77 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [clang++-9] packages: [clang++-9]
- name: "Linux GCC 4.8 [32-bit] [DBG]" - name: "Linux GCC 4.8 [X86] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-4.8 && CXX=g++-4.8" CXXFLAGS=-m32 LDFLAGS=-m32 env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-4.8 && CXX=g++-4.8" CXXFLAGS=-m32 LDFLAGS=-m32
os: linux os: linux
addons: addons:
apt: apt:
packages: [g++-4.8, g++-4.8-multilib, "linux-libc-dev:i386"] packages: [g++-4.8, g++-4.8-multilib, "linux-libc-dev:i386"]
- name: "Linux GCC 4.8 [64-bit] [DBG]" - name: "Linux GCC 4.8 [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-4.8 && CXX=g++-4.8" env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-4.8 && CXX=g++-4.8"
os: linux os: linux
addons: addons:
apt: apt:
packages: [g++-4.8] packages: [g++-4.8]
- name: "Linux GCC 5 [32-bit] [DBG]" - name: "Linux GCC 5 [X86] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-5 && CXX=g++-5" CXXFLAGS=-m32 LDFLAGS=-m32 env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-5 && CXX=g++-5" CXXFLAGS=-m32 LDFLAGS=-m32
os: linux os: linux
addons: addons:
apt: apt:
packages: [g++-5, g++-5-multilib, "linux-libc-dev:i386"] packages: [g++-5, g++-5-multilib, "linux-libc-dev:i386"]
- name: "Linux GCC 5 [64-bit] [DBG]" - name: "Linux GCC 5 [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-5 && CXX=g++-5" env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-5 && CXX=g++-5"
os: linux os: linux
addons: addons:
apt: apt:
packages: [g++-5] packages: [g++-5]
- name: "Linux GCC 6 [32-bit] [DBG]" - name: "Linux GCC 6 [X86] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-6 && CXX=g++-6" CXXFLAGS=-m32 LDFLAGS=-m32 env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-6 && CXX=g++-6" CXXFLAGS=-m32 LDFLAGS=-m32
os: linux os: linux
addons: addons:
apt: apt:
packages: [g++-6, g++-6-multilib, "linux-libc-dev:i386"] packages: [g++-6, g++-6-multilib, "linux-libc-dev:i386"]
- name: "Linux GCC 6 [64-bit] [DBG]" - name: "Linux GCC 6 [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-6 && CXX=g++-6" env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-6 && CXX=g++-6"
os: linux os: linux
addons: addons:
apt: apt:
packages: [g++-6] packages: [g++-6]
- name: "Linux GCC 7 [32-bit] [DBG]" - name: "Linux GCC 7 [X86] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-7 && CXX=g++-7" CXXFLAGS=-m32 LDFLAGS=-m32 env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-7 && CXX=g++-7" CXXFLAGS=-m32 LDFLAGS=-m32
os: linux os: linux
addons: addons:
apt: apt:
packages: [g++-7, g++-7-multilib, "linux-libc-dev:i386"] packages: [g++-7, g++-7-multilib, "linux-libc-dev:i386"]
- name: "Linux GCC 7 [64-bit] [DBG]" - name: "Linux GCC 7 [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-7 && CXX=g++-7" env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-7 && CXX=g++-7"
os: linux os: linux
addons: addons:
apt: apt:
packages: [g++-7] packages: [g++-7]
- name: "Linux GCC 8 [32-bit] [DBG]" - name: "Linux GCC 8 [X86] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-8 && CXX=g++-8" CXXFLAGS=-m32 LDFLAGS=-m32 env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-8 && CXX=g++-8" CXXFLAGS=-m32 LDFLAGS=-m32
os: linux os: linux
addons: addons:
apt: apt:
packages: [g++-8, g++-8-multilib, "linux-libc-dev:i386"] packages: [g++-8, g++-8-multilib, "linux-libc-dev:i386"]
- name: "Linux GCC 8 [64-bit] [DBG]" - name: "Linux GCC 8 [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-8 && CXX=g++-8" env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-8 && CXX=g++-8"
os: linux os: linux
addons: addons:
apt: apt:
packages: [g++-8] packages: [g++-8]
- name: "Linux GCC 9 [32-bit] [DBG]" - name: "Linux GCC 9 [X86] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-9 && CXX=g++-9" CXXFLAGS=-m32 LDFLAGS=-m32 env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-9 && CXX=g++-9" CXXFLAGS=-m32 LDFLAGS=-m32
os: linux os: linux
addons: addons:
@@ -188,7 +188,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [g++-9, g++-9-multilib, "linux-libc-dev:i386"] packages: [g++-9, g++-9-multilib, "linux-libc-dev:i386"]
- name: "Linux GCC 9 [64-bit] [DBG]" - name: "Linux GCC 9 [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-9 && CXX=g++-9" env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-9 && CXX=g++-9"
os: linux os: linux
addons: addons:
@@ -197,7 +197,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [g++-9] packages: [g++-9]
- name: "Linux GCC 10 [32-bit] [DBG]" - name: "Linux GCC 10 [X86] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-10 && CXX=g++-10" CXXFLAGS=-m32 LDFLAGS=-m32 env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-10 && CXX=g++-10" CXXFLAGS=-m32 LDFLAGS=-m32
os: linux os: linux
addons: addons:
@@ -206,7 +206,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [g++-10, g++-10-multilib, "linux-libc-dev:i386"] packages: [g++-10, g++-10-multilib, "linux-libc-dev:i386"]
- name: "Linux GCC 10 [32-bit] [REL]" - name: "Linux GCC 10 [X86] [REL]"
env: BUILD_MATRIX="BUILD_TYPE=Release && CC=gcc-10 && CXX=g++-10" CXXFLAGS=-m32 LDFLAGS=-m32 env: BUILD_MATRIX="BUILD_TYPE=Release && CC=gcc-10 && CXX=g++-10" CXXFLAGS=-m32 LDFLAGS=-m32
os: linux os: linux
addons: addons:
@@ -215,7 +215,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [g++-10, g++-10-multilib, "linux-libc-dev:i386"] packages: [g++-10, g++-10-multilib, "linux-libc-dev:i386"]
- name: "Linux GCC 10 [64-bit] [DBG]" - name: "Linux GCC 10 [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-10 && CXX=g++-10" env: BUILD_MATRIX="BUILD_TYPE=Debug && CC=gcc-10 && CXX=g++-10"
os: linux os: linux
addons: addons:
@@ -224,7 +224,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [g++-10] packages: [g++-10]
- name: "Linux GCC 10 [64-bit] [REL]" - name: "Linux GCC 10 [X64] [REL]"
env: BUILD_MATRIX="BUILD_TYPE=Release && CC=gcc-10 && CXX=g++-10" env: BUILD_MATRIX="BUILD_TYPE=Release && CC=gcc-10 && CXX=g++-10"
os: linux os: linux
addons: addons:
@@ -233,59 +233,69 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test" - sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [g++-10] packages: [g++-10]
- name: "OSX Clang XCode 9.4 [32-bit] [DBG]" - name: "Linux GCC Default [ARM64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug"
os: linux
arch: arm64
- name: "Linux GCC Default [ARM64] [REL]"
env: BUILD_MATRIX="BUILD_TYPE=Release"
os: linux
arch: arm64
- name: "OSX Clang XCode 9.4 [X86] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug" CXXFLAGS=-m32 LDFLAGS=-m32 env: BUILD_MATRIX="BUILD_TYPE=Debug" CXXFLAGS=-m32 LDFLAGS=-m32
os: osx os: osx
osx_image: xcode9.4 osx_image: xcode9.4
- name: "OSX Clang XCode 9.4 [32-bit] [REL]" - name: "OSX Clang XCode 9.4 [X86] [REL]"
env: BUILD_MATRIX="BUILD_TYPE=Release" CXXFLAGS=-m32 LDFLAGS=-m32 env: BUILD_MATRIX="BUILD_TYPE=Release" CXXFLAGS=-m32 LDFLAGS=-m32
os: osx os: osx
osx_image: xcode9.4 osx_image: xcode9.4
- name: "OSX Clang XCode 9.4 [64-bit] [DBG]" - name: "OSX Clang XCode 9.4 [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug" env: BUILD_MATRIX="BUILD_TYPE=Debug"
os: osx os: osx
osx_image: xcode9.4 osx_image: xcode9.4
- name: "OSX Clang XCode 9.4 [64-bit] [REL]" - name: "OSX Clang XCode 9.4 [X64] [REL]"
env: BUILD_MATRIX="BUILD_TYPE=Release" env: BUILD_MATRIX="BUILD_TYPE=Release"
os: osx os: osx
osx_image: xcode9.4 osx_image: xcode9.4
- name: "OSX Clang XCode 10.2 [64-bit] [DBG]" - name: "OSX Clang XCode 10.2 [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug" env: BUILD_MATRIX="BUILD_TYPE=Debug"
os: osx os: osx
osx_image: xcode10.2 osx_image: xcode10.2
- name: "OSX Clang XCode 10.2 [64-bit] [REL]" - name: "OSX Clang XCode 10.2 [X64] [REL]"
env: BUILD_MATRIX="BUILD_TYPE=Release" env: BUILD_MATRIX="BUILD_TYPE=Release"
os: osx os: osx
osx_image: xcode10.2 osx_image: xcode10.2
- name: "OSX Clang XCode 11 [64-bit] [DBG]" - name: "OSX Clang XCode 11 [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug" env: BUILD_MATRIX="BUILD_TYPE=Debug"
os: osx os: osx
osx_image: xcode11 osx_image: xcode11
- name: "OSX Clang XCode 11 [64-bit] [REL]" - name: "OSX Clang XCode 11 [X64] [REL]"
env: BUILD_MATRIX="BUILD_TYPE=Release" env: BUILD_MATRIX="BUILD_TYPE=Release"
os: osx os: osx
osx_image: xcode11 osx_image: xcode11
- name: "Windows VS2017 [32-bit] [DBG]" - name: "Windows VS2017 [X86] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug" BUILD_TOOLCHAIN="Visual Studio 15 2017" env: BUILD_MATRIX="BUILD_TYPE=Debug" BUILD_TOOLCHAIN="Visual Studio 15 2017"
os: windows os: windows
- name: "Windows VS2017 [32-bit] [REL]" - name: "Windows VS2017 [X86] [REL]"
env: BUILD_MATRIX="BUILD_TYPE=Release" BUILD_TOOLCHAIN="Visual Studio 15 2017" env: BUILD_MATRIX="BUILD_TYPE=Release" BUILD_TOOLCHAIN="Visual Studio 15 2017"
os: windows os: windows
- name: "Windows VS2017 [64-bit] [DBG]" - name: "Windows VS2017 [X64] [DBG]"
env: BUILD_MATRIX="BUILD_TYPE=Debug" BUILD_TOOLCHAIN="Visual Studio 15 2017 Win64" env: BUILD_MATRIX="BUILD_TYPE=Debug" BUILD_TOOLCHAIN="Visual Studio 15 2017 Win64"
os: windows os: windows
- name: "Windows VS2017 [64-bit] [REL]" - name: "Windows VS2017 [X64] [REL]"
env: BUILD_MATRIX="BUILD_TYPE=Release" BUILD_TOOLCHAIN="Visual Studio 15 2017 Win64" env: BUILD_MATRIX="BUILD_TYPE=Release" BUILD_TOOLCHAIN="Visual Studio 15 2017 Win64"
os: windows os: windows
@@ -308,6 +318,7 @@ before_script:
script: script:
- | - |
if [ -z $SOURCE_CODE_CHECK ]; then if [ -z $SOURCE_CODE_CHECK ]; then
ROOT_DIR=`pwd`
cd build cd build
if [[ "$BUILD_TOOLCHAIN" =~ ^Visual\ Studio ]]; then if [[ "$BUILD_TOOLCHAIN" =~ ^Visual\ Studio ]]; then
cmake --build . --config ${BUILD_TYPE} -- -nologo -v:minimal || exit 1 cmake --build . --config ${BUILD_TYPE} -- -nologo -v:minimal || exit 1
@@ -315,27 +326,7 @@ script:
else else
cmake --build . || exit 1 cmake --build . || exit 1
fi fi
echo "" ${ROOT_DIR}/tools/ci-run.sh . || exit 1
echo "=== Starting Tests ==="
echo ""
if [ "$USE_VALGRIND" = "1" ]; then
RUN_CMD="valgrind --leak-check=full --show-reachable=yes --track-origins=yes"
fi
eval "$RUN_CMD ./asmjit_test_unit --quick" || exit 1
echo ""
eval "$RUN_CMD ./asmjit_test_opcode > /dev/null" || exit 1
echo ""
eval "$RUN_CMD ./asmjit_test_x86_asm" || exit 1
echo ""
eval "$RUN_CMD ./asmjit_test_x86_sections" || exit 1
if [ -f ./asmjit_test_x86_instinfo ]; then
echo ""
eval "$RUN_CMD ./asmjit_test_x86_instinfo" || exit 1
fi
if [ -f ./asmjit_test_x86_cc ]; then
echo ""
eval "$RUN_CMD ./asmjit_test_x86_cc" || exit 1
fi
else else
cd tools cd tools
./enumgen.sh --verify || exit 1 ./enumgen.sh --verify || exit 1

View File

@@ -239,7 +239,7 @@ namespace asmjit {
//! //!
//! - \ref ASMJIT_BUILD_X86 - Always build X86 backend (X86 and X86_64). //! - \ref ASMJIT_BUILD_X86 - Always build X86 backend (X86 and X86_64).
//! - \ref ASMJIT_BUILD_ARM - Always build ARM backend (ARM and AArch64). //! - \ref ASMJIT_BUILD_ARM - Always build ARM backend (ARM and AArch64).
//! - \ref ASMJIT_BUILD_HOST - Always build the host backend, implied by default. //! - \ref ASMJIT_BUILD_HOST - Always build the host backend.
//! //!
//! ### Features Selection //! ### Features Selection
//! //!
@@ -252,6 +252,9 @@ namespace asmjit {
//! attempt to use such API. This includes deprecated classes, namespaces, //! attempt to use such API. This includes deprecated classes, namespaces,
//! enumerations, and functions. //! enumerations, and functions.
//! //!
//! - \ref ASMJIT_NO_FOREIGN - Disables the support for foreign architectures.
//! If defined, it would internally set \ref ASMJIT_BUILD_HOST to true.
//!
//! - \ref ASMJIT_NO_BUILDER - Disables \ref asmjit_builder functionality //! - \ref ASMJIT_NO_BUILDER - Disables \ref asmjit_builder functionality
//! completely. This implies \ref ASMJIT_NO_COMPILER as \ref asmjit_compiler //! completely. This implies \ref ASMJIT_NO_COMPILER as \ref asmjit_compiler
//! cannot be used without \ref asmjit_builder. //! cannot be used without \ref asmjit_builder.

View File

@@ -77,6 +77,9 @@ namespace asmjit {
//! Disables deprecated API at compile time. //! Disables deprecated API at compile time.
#define ASMJIT_NO_DEPRECATED #define ASMJIT_NO_DEPRECATED
//! Disable non-host architectures entirely.
#define ASMJIT_NO_FOREIGN
//! Disables \ref asmjit_builder functionality completely. //! Disables \ref asmjit_builder functionality completely.
#define ASMJIT_NO_BUILDER #define ASMJIT_NO_BUILDER
@@ -188,7 +191,7 @@ namespace asmjit {
#endif #endif
// ============================================================================ // ============================================================================
// [asmjit::Build - Globals - Target Architecture] // [asmjit::Build - Globals - Target Architecture Information]
// ============================================================================ // ============================================================================
#if defined(_M_X64) || defined(__x86_64__) #if defined(_M_X64) || defined(__x86_64__)
@@ -235,20 +238,33 @@ namespace asmjit {
#define ASMJIT_ARCH_BE 0 #define ASMJIT_ARCH_BE 0
#endif #endif
// Build host architecture if no architecture is selected. // ============================================================================
#if !defined(ASMJIT_BUILD_HOST) && \ // [asmjit::Build - Globals - Build Architectures Definitions]
!defined(ASMJIT_BUILD_X86) && \ // ============================================================================
!defined(ASMJIT_BUILD_ARM)
#if !defined(ASMJIT_NO_FOREIGN)
// If 'ASMJIT_NO_FOREIGN' is not defined then all architectures will be built.
#if !defined(ASMJIT_BUILD_X86)
#define ASMJIT_BUILD_X86
#endif
#else
// Detect architectures to build if building only for the host architecture.
#if ASMJIT_ARCH_X86 && !defined(ASMJIT_BUILD_X86)
#define ASMJIT_BUILD_X86
#endif
#if ASMJIT_ARCH_ARM && !defined(ASMJIT_BUILD_ARM)
// #define ASMJIT_BUILD_ARM
#endif
#endif
// Define 'ASMJIT_BUILD_HOST' if we know that host architecture will be built.
#if !defined(ASMJIT_BUILD_HOST) && ASMJIT_ARCH_X86 && defined(ASMJIT_BUILD_X86)
#define ASMJIT_BUILD_HOST #define ASMJIT_BUILD_HOST
#endif #endif
// Detect host architecture if building only for host. #if !defined(ASMJIT_BUILD_HOST) && ASMJIT_ARCH_ARM && defined(ASMJIT_BUILD_ARM)
#if ASMJIT_ARCH_X86 && defined(ASMJIT_BUILD_HOST) && !defined(ASMJIT_BUILD_X86) #define ASMJIT_BUILD_HOST
#define ASMJIT_BUILD_X86
#endif
#if ASMJIT_ARCH_ARM && defined(ASMJIT_BUILD_HOST) && !defined(ASMJIT_BUILD_ARM)
#define ASMJIT_BUILD_ARM
#endif #endif
// ============================================================================ // ============================================================================

View File

@@ -21,7 +21,12 @@
// misrepresented as being the original software. // misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution. // 3. This notice may not be removed or altered from any source distribution.
#include <asmjit/core.h>
#ifdef ASMJIT_BUILD_X86
#include <asmjit/x86.h> #include <asmjit/x86.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View File

@@ -21,7 +21,11 @@
// misrepresented as being the original software. // misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution. // 3. This notice may not be removed or altered from any source distribution.
#include <asmjit/core.h>
#if defined(ASMJIT_BUILD_X86) && ASMJIT_ARCH_X86
#include <asmjit/x86.h> #include <asmjit/x86.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -196,3 +200,9 @@ int main() {
return nFailed ? 1 : 0; return nFailed ? 1 : 0;
} }
#else
int main() {
printf("AsmJit X86 Emitter Test is disabled on non-x86 host\n\n");
return 0;
}
#endif

View File

@@ -21,6 +21,9 @@
// misrepresented as being the original software. // misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution. // 3. This notice may not be removed or altered from any source distribution.
#include <asmjit/core.h>
#if defined(ASMJIT_BUILD_X86) && ASMJIT_ARCH_X86
#include <asmjit/x86.h> #include <asmjit/x86.h>
#include <setjmp.h> #include <setjmp.h>
#include <stdio.h> #include <stdio.h>
@@ -4327,3 +4330,13 @@ int main(int argc, char* argv[]) {
return app.run(); return app.run();
} }
#else
int main() {
printf("AsmJit Compiler Test-Suite v%u.%u.%u is disabled on non-x86 host:\n",
unsigned((ASMJIT_LIBRARY_VERSION >> 16) ),
unsigned((ASMJIT_LIBRARY_VERSION >> 8) & 0xFF),
unsigned((ASMJIT_LIBRARY_VERSION ) & 0xFF));
return 0;
}
#endif

View File

@@ -21,7 +21,12 @@
// misrepresented as being the original software. // misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution. // 3. This notice may not be removed or altered from any source distribution.
#include <asmjit/core.h>
#if defined(ASMJIT_BUILD_X86)
#include <asmjit/x86.h> #include <asmjit/x86.h>
#endif
#include <stdio.h> #include <stdio.h>
using namespace asmjit; using namespace asmjit;
@@ -90,12 +95,10 @@ static void printInfoSimple(uint32_t arch, uint32_t instId, Args&&... args) {
printInfo(arch, inst, opArray, sizeof...(args)); printInfo(arch, inst, opArray, sizeof...(args));
} }
int main() { static void testX86Arch() {
using namespace x86; #if defined(ASMJIT_BUILD_X86)
uint32_t arch = Environment::kArchX64; uint32_t arch = Environment::kArchX64;
printf("AsmJit X86 Instruction Information Test\n\n");
printInfoSimple(arch, printInfoSimple(arch,
x86::Inst::kIdAdd, x86::Inst::kIdAdd,
x86::eax, x86::ebx); x86::eax, x86::ebx);
@@ -110,7 +113,7 @@ int main() {
printInfoSimple(arch, printInfoSimple(arch,
x86::Inst::kIdPextrw, x86::Inst::kIdPextrw,
x86::ptr(rax), x86::xmm1, imm(0)); x86::ptr(x86::rax), x86::xmm1, imm(0));
printInfoSimple(arch, printInfoSimple(arch,
x86::Inst::kIdVaddpd, x86::Inst::kIdVaddpd,
@@ -123,6 +126,13 @@ int main() {
printInfoSimple(arch, printInfoSimple(arch,
x86::Inst::kIdVaddpd, x86::Inst::kIdVaddpd,
x86::zmm0, x86::zmm1, x86::zmm2); x86::zmm0, x86::zmm1, x86::zmm2);
#endif
}
int main() {
printf("AsmJit Instruction Information Test\n\n");
testX86Arch();
return 0; return 0;
} }

View File

@@ -34,6 +34,9 @@
// - Copy the code to the destination address. // - Copy the code to the destination address.
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#include <asmjit/core.h>
#if defined(ASMJIT_BUILD_X86) && ASMJIT_ARCH_X86
#include <asmjit/x86.h> #include <asmjit/x86.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -173,3 +176,10 @@ int main() {
printf("Success:\n The generated function returned expected results\n"); printf("Success:\n The generated function returned expected results\n");
return 0; return 0;
} }
#else
int main() {
printf("AsmJit X86 Sections Test is disabled on non-x86 host\n\n");
return 0;
}
#endif

39
tools/ci-run.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env sh
set -e
BUILD_DIR=$1
if [ "$USE_VALGRIND" = "1" ]; then
RUN_CMD="valgrind --leak-check=full --show-reachable=yes --track-origins=yes"
fi
echo ""
echo "=== Starting Tests ==="
echo ""
eval "$RUN_CMD ${BUILD_DIR}/asmjit_test_unit --quick"
echo ""
echo "AsmJit Opcode Test"
eval "$RUN_CMD ${BUILD_DIR}/asmjit_test_opcode > /dev/null"
if [ -f ${BUILD_DIR}/asmjit_test_x86_asm ]; then
echo ""
eval "$RUN_CMD ${BUILD_DIR}/asmjit_test_x86_asm"
fi
if [ -f ${BUILD_DIR}/asmjit_test_x86_sections ]; then
echo ""
eval "$RUN_CMD ${BUILD_DIR}/asmjit_test_x86_sections"
fi
if [ -f ${BUILD_DIR}/asmjit_test_x86_instinfo ]; then
echo ""
eval "$RUN_CMD ${BUILD_DIR}/asmjit_test_x86_instinfo"
fi
if [ -f ${BUILD_DIR}asmjit_test_x86_cc ]; then
echo ""
eval "$RUN_CMD ${BUILD_DIR}/asmjit_test_x86_cc"
fi