zephyr/cmake/compiler/xcc/compiler_flags.cmake
Kai Vehmanen 99bab75a69 cmake: fix use of unsupported -fno-pie with xcc
The commit 8259931fce ("xcc-clang: Do not used unavailable options")
has a side-effect that builds with xcc default to use -fno-pie. This
is not a supported compiler option for xcc, resulting in failing builds.

Use same configuration for xcc as is in place for xcc-clang, and
do not use -fno-pie.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-29 08:40:29 -04:00

15 lines
568 B
CMake

# SPDX-License-Identifier: Apache-2.0
include(${ZEPHYR_BASE}/cmake/compiler/gcc/compiler_flags.cmake)
# XCC is based on GCC 4.2 which has a somewhat pedantic take on the
# fact that linkage semantics differed between C99 and GNU at the
# time. Suppress the warning, it's the best we can do given that
# it's a legacy compiler.
check_set_compiler_property(APPEND PROPERTY warning_base "-fgnu89-inline")
set_compiler_property(PROPERTY warning_error_misra_sane)
# XCC does not support -fno-pic and -fno-pie
set_compiler_property(PROPERTY no_position_independent "")