diff options
Diffstat (limited to 'zephyr/cmake')
-rw-r--r-- | zephyr/cmake/bintools/gnu/target.cmake | 2 | ||||
-rw-r--r-- | zephyr/cmake/bintools/llvm/generic.cmake | 2 | ||||
-rw-r--r-- | zephyr/cmake/bintools/llvm/target.cmake | 2 | ||||
-rw-r--r-- | zephyr/cmake/compiler/clang/compiler_flags.cmake | 5 | ||||
-rw-r--r-- | zephyr/cmake/compiler/clang/generic.cmake | 2 | ||||
-rw-r--r-- | zephyr/cmake/compiler/clang/target.cmake | 2 | ||||
-rw-r--r-- | zephyr/cmake/compiler/gcc/compiler_flags.cmake | 5 | ||||
-rw-r--r-- | zephyr/cmake/compiler/gcc/target.cmake | 2 | ||||
-rw-r--r-- | zephyr/cmake/linker/ld/gcc/linker_flags.cmake | 7 | ||||
-rw-r--r-- | zephyr/cmake/linker/ld/linker_flags.cmake | 6 | ||||
-rw-r--r-- | zephyr/cmake/linker/ld/target.cmake | 2 | ||||
-rw-r--r-- | zephyr/cmake/linker/lld/linker_flags.cmake | 2 | ||||
-rw-r--r-- | zephyr/cmake/linker/lld/target.cmake | 3 | ||||
-rw-r--r-- | zephyr/cmake/toolchain/coreboot-sdk/generic.cmake | 2 | ||||
-rw-r--r-- | zephyr/cmake/toolchain/coreboot-sdk/target.cmake | 2 | ||||
-rw-r--r-- | zephyr/cmake/toolchain/llvm/generic.cmake | 2 | ||||
-rw-r--r-- | zephyr/cmake/toolchain/llvm/target.cmake | 2 |
17 files changed, 34 insertions, 16 deletions
diff --git a/zephyr/cmake/bintools/gnu/target.cmake b/zephyr/cmake/bintools/gnu/target.cmake index 2ec9d075dc..13e81ed4a0 100644 --- a/zephyr/cmake/bintools/gnu/target.cmake +++ b/zephyr/cmake/bintools/gnu/target.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/zephyr/cmake/bintools/llvm/generic.cmake b/zephyr/cmake/bintools/llvm/generic.cmake index 94b35ed51d..f85236d39c 100644 --- a/zephyr/cmake/bintools/llvm/generic.cmake +++ b/zephyr/cmake/bintools/llvm/generic.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/zephyr/cmake/bintools/llvm/target.cmake b/zephyr/cmake/bintools/llvm/target.cmake index a77d459288..9e747483ae 100644 --- a/zephyr/cmake/bintools/llvm/target.cmake +++ b/zephyr/cmake/bintools/llvm/target.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/zephyr/cmake/compiler/clang/compiler_flags.cmake b/zephyr/cmake/compiler/clang/compiler_flags.cmake index 5f97625a58..3423f1c36c 100644 --- a/zephyr/cmake/compiler/clang/compiler_flags.cmake +++ b/zephyr/cmake/compiler/clang/compiler_flags.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -7,6 +7,9 @@ include("${ZEPHYR_BASE}/cmake/compiler/clang/compiler_flags.cmake") # Disable -fno-freestanding. set_compiler_property(PROPERTY hosted) +# Disable position independent code. +add_compile_options(-fno-PIC) + check_set_compiler_property(APPEND PROPERTY warning_extended -Wunused-variable -Werror=unused-variable -Werror=missing-braces -Werror=sometimes-uninitialized -Werror=unused-function diff --git a/zephyr/cmake/compiler/clang/generic.cmake b/zephyr/cmake/compiler/clang/generic.cmake index aa3665ad39..b848c8bd03 100644 --- a/zephyr/cmake/compiler/clang/generic.cmake +++ b/zephyr/cmake/compiler/clang/generic.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/zephyr/cmake/compiler/clang/target.cmake b/zephyr/cmake/compiler/clang/target.cmake index 6702087df5..bda3efdeae 100644 --- a/zephyr/cmake/compiler/clang/target.cmake +++ b/zephyr/cmake/compiler/clang/target.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/zephyr/cmake/compiler/gcc/compiler_flags.cmake b/zephyr/cmake/compiler/gcc/compiler_flags.cmake index 125f909c87..adc111835e 100644 --- a/zephyr/cmake/compiler/gcc/compiler_flags.cmake +++ b/zephyr/cmake/compiler/gcc/compiler_flags.cmake @@ -1,7 +1,10 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Zephyr cmake system looks into ${TOOLCHAIN_ROOT}, but we just send # this out to the copy in ${ZEPHYR_BASE}. include("${ZEPHYR_BASE}/cmake/compiler/gcc/compiler_flags.cmake") + +# Disable position independent code. +add_compile_options(-fno-PIC) diff --git a/zephyr/cmake/compiler/gcc/target.cmake b/zephyr/cmake/compiler/gcc/target.cmake index 5bdb6fc5f6..943ea167ca 100644 --- a/zephyr/cmake/compiler/gcc/target.cmake +++ b/zephyr/cmake/compiler/gcc/target.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/zephyr/cmake/linker/ld/gcc/linker_flags.cmake b/zephyr/cmake/linker/ld/gcc/linker_flags.cmake new file mode 100644 index 0000000000..f71793c431 --- /dev/null +++ b/zephyr/cmake/linker/ld/gcc/linker_flags.cmake @@ -0,0 +1,7 @@ +# Copyright 2022 The ChromiumOS Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# GCC 11 by default emits DWARF version 5 which cannot be parsed by +# pyelftools. Can be removed once pyelftools supports v5. +add_link_options(-gdwarf-4) diff --git a/zephyr/cmake/linker/ld/linker_flags.cmake b/zephyr/cmake/linker/ld/linker_flags.cmake index c80d1d2452..d6045ba6ed 100644 --- a/zephyr/cmake/linker/ld/linker_flags.cmake +++ b/zephyr/cmake/linker/ld/linker_flags.cmake @@ -1,7 +1,11 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Zephyr cmake system looks into ${TOOLCHAIN_ROOT}, but we just send # this out to the copy in ${ZEPHYR_BASE}. include("${ZEPHYR_BASE}/cmake/linker/ld/linker_flags.cmake") + +# There can also be compiler specific linker options, so try to include +# our version of that also. +include("${TOOLCHAIN_ROOT}/cmake/linker/${LINKER}/${COMPILER}/linker_flags.cmake" OPTIONAL) diff --git a/zephyr/cmake/linker/ld/target.cmake b/zephyr/cmake/linker/ld/target.cmake index 0e2ad1f4d7..02dd95b236 100644 --- a/zephyr/cmake/linker/ld/target.cmake +++ b/zephyr/cmake/linker/ld/target.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/zephyr/cmake/linker/lld/linker_flags.cmake b/zephyr/cmake/linker/lld/linker_flags.cmake index 5055e4c5a4..d382bd5b60 100644 --- a/zephyr/cmake/linker/lld/linker_flags.cmake +++ b/zephyr/cmake/linker/lld/linker_flags.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/zephyr/cmake/linker/lld/target.cmake b/zephyr/cmake/linker/lld/target.cmake index 1bbc6f479d..10774909a2 100644 --- a/zephyr/cmake/linker/lld/target.cmake +++ b/zephyr/cmake/linker/lld/target.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -21,6 +21,7 @@ macro(toolchain_ld_base) # Default flags zephyr_ld_options( ${TOOLCHAIN_LD_FLAGS} + -no-pie -Wl,--gc-sections --build-id=none) endmacro() diff --git a/zephyr/cmake/toolchain/coreboot-sdk/generic.cmake b/zephyr/cmake/toolchain/coreboot-sdk/generic.cmake index 1b86948bcd..d20f19528d 100644 --- a/zephyr/cmake/toolchain/coreboot-sdk/generic.cmake +++ b/zephyr/cmake/toolchain/coreboot-sdk/generic.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/zephyr/cmake/toolchain/coreboot-sdk/target.cmake b/zephyr/cmake/toolchain/coreboot-sdk/target.cmake index 5f3d86459b..82804e6b32 100644 --- a/zephyr/cmake/toolchain/coreboot-sdk/target.cmake +++ b/zephyr/cmake/toolchain/coreboot-sdk/target.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/zephyr/cmake/toolchain/llvm/generic.cmake b/zephyr/cmake/toolchain/llvm/generic.cmake index 6a248a13cf..933162d9bb 100644 --- a/zephyr/cmake/toolchain/llvm/generic.cmake +++ b/zephyr/cmake/toolchain/llvm/generic.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/zephyr/cmake/toolchain/llvm/target.cmake b/zephyr/cmake/toolchain/llvm/target.cmake index d79d73d1ae..e6960dade5 100644 --- a/zephyr/cmake/toolchain/llvm/target.cmake +++ b/zephyr/cmake/toolchain/llvm/target.cmake @@ -1,4 +1,4 @@ -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. |