blob: b73b5dc35002cf5d47b4c0128a805db2bb6772a3 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From 1b9c8d4a7c9519c6085827da8be6546ce80ee711 Mon Sep 17 00:00:00 2001
2From: Anton Antonov <Anton.Antonov@arm.com>
3Date: Wed, 31 Aug 2022 17:05:14 +0100
4Subject: [PATCH 1/4] Allow to find libgcc headers
5
6Upstream-Status: Pending
7Signed-off-by: Anton Antonov <Anton.Antonov@arm.com>
8---
9 external/newlib/newlib.cmake | 5 ++++-
10 1 file changed, 4 insertions(+), 1 deletion(-)
11
12diff --git a/external/newlib/newlib.cmake b/external/newlib/newlib.cmake
13index fff5e2a..13eb78c 100644
14--- a/external/newlib/newlib.cmake
15+++ b/external/newlib/newlib.cmake
16@@ -82,7 +82,10 @@ message(STATUS "libgcc.a is used from ${LIBGCC_PATH}")
17 # Moreover the GCC specific header file include directory is also required.
18 # Specify LIBGCC_INCLUDE_DIRS in the command line to manually override the libgcc relative location below.
19 if(NOT DEFINED LIBGCC_INCLUDE_DIRS)
20- get_filename_component(_TMP_VAR "${LIBGCC_PATH}" DIRECTORY)
21+
22+ # "libgcc.a" lib location in ${LIBGCC_PATH} might not contain a correct path to headers
23+ # We can get the correct path if we ask for a location without a library name
24+ gcc_get_lib_location(LIBRARY_NAME "" RES _TMP_VAR)
25 set(LIBGCC_INCLUDE_DIRS
26 "${_TMP_VAR}/include"
27 "${_TMP_VAR}/include-fixed" CACHE STRING "GCC specific include PATHs")
28--
292.25.1
30