From ad2395d3db59668779cc0d303fd1cbea0cdaa330 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Tue, 21 Jan 2020 21:43:56 -0600 Subject: [PATCH] libremkey-hotp-verification: toolchain adjustments Pass through new toolchain path via $(CROSS) so we can set the c/c++ compiler paths correctly for CMake. Adjust patch to use new paths, and fix compiler/linker paths to correct a libusb linking issue. Signed-off-by: Matt DeVillier --- modules/libremkey-hotp-verification | 1 + patches/libremkey-hotp-verification.patch | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/libremkey-hotp-verification b/modules/libremkey-hotp-verification index c9b9d45a..c8339df4 100644 --- a/modules/libremkey-hotp-verification +++ b/modules/libremkey-hotp-verification @@ -16,4 +16,5 @@ libremkey-hotp-verification_output := \ libremkey-hotp-verification_configure := \ INSTALL="$(INSTALL)" \ + CROSS="$(CROSS)" \ cmake -DCMAKE_TOOLCHAIN_FILE=./Toolchain-heads.cmake -DCMAKE_AR="$(CROSS)ar" . diff --git a/patches/libremkey-hotp-verification.patch b/patches/libremkey-hotp-verification.patch index c2b5dfea..5f058f22 100644 --- a/patches/libremkey-hotp-verification.patch +++ b/patches/libremkey-hotp-verification.patch @@ -1,15 +1,24 @@ --- nitrokey-hotp-verification-a/Toolchain-heads.cmake 2018-05-22 09:55:46.907209235 -0700 +++ nitrokey-hotp-verification-b/Toolchain-heads.cmake 2018-05-22 09:55:26.659371966 -0700 -@@ -0,0 +1,18 @@ +@@ -0,0 +1,27 @@ +SET(CMAKE_SYSTEM_NAME Linux) +SET(CMAKE_SYSTEM_VERSION 1) + +# Specify the cross compiler -+SET(CMAKE_C_COMPILER $ENV{INSTALL}/bin/musl-gcc) -+SET(CMAKE_CXX_COMPILER $ENV{INSTALL}/bin/musl-gcc) ++SET(CMAKE_C_COMPILER $ENV{CROSS}gcc) ++SET(CMAKE_CXX_COMPILER $ENV{CROSS}gcc) ++ ++#sysroot location ++set(MYSYSROOT $ENV{INSTALL}) ++ ++# compiler/linker flags ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${MYSYSROOT}" CACHE INTERNAL "" FORCE) ++set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} --sysroot=${MYSYSROOT}" CACHE INTERNAL "" FORCE) ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${MYSYSROOT}" CACHE INTERNAL "" FORCE) ++set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} --sysroot=${MYSYSROOT}" CACHE INTERNAL "" FORCE) + +# Where is the target environment -+SET(CMAKE_FIND_ROOT_PATH $ENV{INSTALL}) ++SET(CMAKE_FIND_ROOT_PATH "${MYSYSROOT}") + +# Search for programs only in the build host directories +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)