Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | From 1b9c8d4a7c9519c6085827da8be6546ce80ee711 Mon Sep 17 00:00:00 2001 |
| 2 | From: Anton Antonov <Anton.Antonov@arm.com> |
| 3 | Date: Wed, 31 Aug 2022 17:05:14 +0100 |
| 4 | Subject: [PATCH 1/4] Allow to find libgcc headers |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | Signed-off-by: Anton Antonov <Anton.Antonov@arm.com> |
| 8 | --- |
| 9 | external/newlib/newlib.cmake | 5 ++++- |
| 10 | 1 file changed, 4 insertions(+), 1 deletion(-) |
| 11 | |
| 12 | diff --git a/external/newlib/newlib.cmake b/external/newlib/newlib.cmake |
| 13 | index 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 | -- |
| 29 | 2.25.1 |
| 30 | |