linker: ld: include crt{begin,end}.o if LIBGCC_DIR is defined
Only include crtbegin.o and crtend.o when LIBGCC_DIR is defined.
Since LIBGCC_DIR is not defined when compiling for posix
architecture, crt{begin,end}.o cannot be referred to via
LIBGCC_DIR.
Also note that, when using llvm/clang, crt{begin,end}S.o are
automatically for native_posix which collide with symbols in
crt{begin,end}.o. So there is no point in making LIBGCC_DIR
available for native_posix under llvm/clang.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
5d9079ba6d
commit
c9d70bb986
1 changed files with 1 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ set(CMAKE_LINKER ${GNULD_LINKER})
|
||||||
set_ifndef(LINKERFLAGPREFIX -Wl)
|
set_ifndef(LINKERFLAGPREFIX -Wl)
|
||||||
|
|
||||||
if(NOT "${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "host")
|
if(NOT "${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "host")
|
||||||
if(CONFIG_CPP_EXCEPTIONS)
|
if(CONFIG_CPP_EXCEPTIONS AND LIBGCC_DIR)
|
||||||
# When building with C++ Exceptions, it is important that crtbegin and crtend
|
# When building with C++ Exceptions, it is important that crtbegin and crtend
|
||||||
# are linked at specific locations.
|
# are linked at specific locations.
|
||||||
# The location is so important that we cannot let this be controlled by normal
|
# The location is so important that we cannot let this be controlled by normal
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue