stlink: remove dependency on libssp

__stack_chk_fail is provided by libroot
This commit is contained in:
Jerome Duval
2021-10-14 17:32:27 +02:00
parent c045b0432c
commit 9b9346f6c2
2 changed files with 39 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
From 096a8cdae1859505980e303d8ce38fc9867e2058 Mon Sep 17 00:00:00 2001
From e55d31a95f0515bdcb138d27c29581df3b42e6ad Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Thu, 1 Oct 2020 21:37:16 +1000
Subject: Fix for Haiku
@@ -40,5 +40,41 @@ index c2e2df9..65d8982 100644
#define MINIMAL_API_VERSION 0x01000104 // v1.0.20
#elif defined (_WIN32)
--
2.28.0
2.30.2
From 469c5d5fdbebd58b4310b86c29b1963366fc2958 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 14 Oct 2021 17:31:10 +0200
Subject: __stack_chk_fail can be provided by libc
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dec48d4..8800a30 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,13 +67,16 @@ if (STLINK_HAVE_UNISTD_H)
add_definitions(-DSTLINK_HAVE_UNISTD_H)
endif ()
+include(CheckFunctionExists)
include(CheckLibraryExists)
-CHECK_LIBRARY_EXISTS(ssp __stack_chk_fail "" _stack_chk_fail_exists)
-if (_stack_chk_fail_exists)
- set(SSP_LIB -static ssp)
-else ()
- set(SSP_LIB "")
+set(SSP_LIB "")
+CHECK_FUNCTION_EXISTS(__stack_chk_fail HAVE_STACK_CHK_FAIL)
+if (NOT HAVE_STACK_CHK_FAIL)
+ CHECK_LIBRARY_EXISTS(ssp __stack_chk_fail "" _stack_chk_fail_exists)
+ if (_stack_chk_fail_exists)
+ set(SSP_LIB -static ssp)
+ endif ()
endif ()
--
2.30.2

View File

@@ -5,7 +5,7 @@ programming and debugging of these chips."
HOMEPAGE="https://github.com/texane/stlink"
COPYRIGHT="2011-2020 The Capt'ns Missing Link Authors"
LICENSE="BSD (3-clause)"
REVISION="1"
REVISION="2"
SOURCE_URI="https://github.com/texane/stlink/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="ca9a640f84c3e2c9873bd51759594bc05c00cdf6e1f21b434ae2c0e7985433d8"
PATCHES="stlink-$portVersion.patchset"
@@ -29,7 +29,6 @@ PROVIDES="
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libssp$secondaryArchSuffix
lib:libusb_1.0$secondaryArchSuffix
"