From 4ab86f3a5043a593d19b95bc59cf069454369e97 Mon Sep 17 00:00:00 2001 From: Artem Dinaburg Date: Thu, 21 Jan 2021 12:38:20 -0500 Subject: [PATCH] Fixes for aarch64 build (#474) --- README.md | 2 +- tests/AArch64/CMakeLists.txt | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6aecd5b13..25d3bee05 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ Then you need to install 32-bit libstdc++ headers and libraries. On a Debian/Ubu ```sh sudo dpkg --add-architecture i386 sudo apt-get update -sudo apt-get install libc6-dev:i386 install libstdc++-10-dev:i386 g++-multilib +sudo apt-get install libc6-dev:i386 libstdc++-10-dev:i386 g++-multilib ``` This error happens because the SPARC32 runtime semantics (the bitcode library which lives in `/share/remill//semantics/sparc32.bc`) are built as 32-bit code, but 32-bit development libraries are not installed by default. diff --git a/tests/AArch64/CMakeLists.txt b/tests/AArch64/CMakeLists.txt index 3414c372f..1a0715720 100644 --- a/tests/AArch64/CMakeLists.txt +++ b/tests/AArch64/CMakeLists.txt @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -find_package(gtest REQUIRED) - -# google gtest -find_package(gtest REQUIRED) -list(APPEND PROJECT_LIBRARIES ${gtest_LIBRARIES}) -list(APPEND PROJECT_INCLUDEDIRECTORIES ${gtest_INCLUDE_DIRS}) +if (DEFINED ENV{TRAILOFBITS_LIBRARIES}) + find_package(gtest REQUIRED) + list(APPEND PROJECT_LIBRARIES ${gtest_LIBRARIES}) + list(APPEND PROJECT_INCLUDEDIRECTORIES ${gtest_INCLUDE_DIRS}) +else() + find_package(GTest CONFIG REQUIRED) + list(APPEND PROJECT_LIBRARIES GTest::gtest) +endif() enable_testing() enable_language(ASM)