From c05a931bcef8f0d66d3ae308354153ca90d3de70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Wed, 28 Aug 2019 14:24:17 +0200 Subject: [PATCH] cmake: Explicitly set the entry point when testing toolchain flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We are observing warnings when test-compiling toolchain flags that look like: cannot find entry symbol _start; defaulting to 00000000000010d4 To fix this warning we explicitly set an entry point to an arbitrary address. The files are only compiled, not run, so the entry point does not need to be correct. Signed-off-by: Sebastian Bøe --- cmake/compiler/gcc/target.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/compiler/gcc/target.cmake b/cmake/compiler/gcc/target.cmake index 6214adc416f..051ad23e61b 100644 --- a/cmake/compiler/gcc/target.cmake +++ b/cmake/compiler/gcc/target.cmake @@ -105,7 +105,13 @@ endforeach() # # Appending onto any existing values lets users specify # toolchain-specific flags at generation time. -list(APPEND CMAKE_REQUIRED_FLAGS -nostartfiles -nostdlib ${isystem_include_flags} -Wl,--unresolved-symbols=ignore-in-object-files) +list(APPEND CMAKE_REQUIRED_FLAGS + -nostartfiles + -nostdlib + ${isystem_include_flags} + -Wl,--unresolved-symbols=ignore-in-object-files + -Wl,--entry=0 # Set an entry point to avoid a warning + ) string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") # Load toolchain_cc-family macros