Files
packages/libs/gost_engine/patches/020-cmake-allow-cross-compile.patch
Eneas U de Queiroz 771e7385ea gost_engine: disable tests, reset patches dir
Tests are breaking compilation for mipsel targets because of the removal
of the sysmips call.  Let's just not build them.

While at it, remove patches from 1.1 version and move the current ones
to the default 'patches' directory.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 085dc8d965)
2023-06-19 16:59:26 +08:00

60 lines
1.3 KiB
Diff

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,31 +64,35 @@ else()
add_definitions(-DL_ENDIAN)
endif()
-check_c_source_runs("
- #ifdef _MSC_VER
- # include <intrin.h>
- #else
- # include <x86intrin.h>
- #endif
- int main(void) {
- unsigned long long x = -1, y = 1, r;
- unsigned char cf;
- cf = _addcarry_u64(1, x, y, &r);
- return !(cf == 1 && r == 1);
- }
- " ADDCARRY_U64)
+if(NOT CMAKE_CROSSCOMPILING)
+ check_c_source_runs("
+ #ifdef _MSC_VER
+ # include <intrin.h>
+ #else
+ # include <x86intrin.h>
+ #endif
+ int main(void) {
+ unsigned long long x = -1, y = 1, r;
+ unsigned char cf;
+ cf = _addcarry_u64(1, x, y, &r);
+ return !(cf == 1 && r == 1);
+ }
+ " ADDCARRY_U64)
+
+ check_c_source_runs("
+ int main(void) {
+ char buf[16] = { 0, 1, 2 };
+ int *p = (int *)(buf + 1);
+ int *q = (int *)(buf + 2);
+ return (*p == *q);
+ }
+ " RELAXED_ALIGNMENT)
+endif()
+
if (ADDCARRY_U64)
add_definitions(-DHAVE_ADDCARRY_U64)
endif()
-check_c_source_runs("
- int main(void) {
- char buf[16] = { 0, 1, 2 };
- int *p = (int *)(buf + 1);
- int *q = (int *)(buf + 2);
- return (*p == *q);
- }
- " RELAXED_ALIGNMENT)
if (NOT RELAXED_ALIGNMENT)
add_definitions(-DSTRICT_ALIGNMENT)
endif()