zephyr/cmake/compiler
Daniel Leung deeb98da53 cmake: compiler/xcc: omit -g if needed for Clang
Some older versions of XCC Clang would result in the following
error during compilation:

  /tmp/file.s: Assembler messages:
  /tmp/file.s:20: Error: file number 1 already allocated
  clang-3.9: error: Xtensa-as command failed with exit code 1

due to a bug in LLVM: https://bugs.llvm.org/show_bug.cgi?id=11740.
This is fixed in upstream, https://reviews.llvm.org/D20002, in 2016.
However, it seems that it is only fixed after XCC RI-2018.0.
Instead of blanket disabling usage of '-g', use an environment
variable "XCC_NO_G_FLAG" to disable usage of flag '-g' to workaround
this issue. This needs to be manually set because there is no way to
know which XCC version is being used, and compiler flag checking for
'-g' would not result in error (and thus '-g' is not ignored).
This is only needed for older XCC Clang. For sufficiently new XCC
verisons, there is no need for this.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-25 21:16:32 -05:00
..
arcmwdt cmake: Populate var CMAKE_GCOV 2021-09-02 19:44:00 -04:00
armclang armclang: ARM Compiler C library support 2021-08-30 08:54:23 -04:00
clang cmake: Populate var CMAKE_GCOV 2021-09-02 19:44:00 -04:00
gcc cmake: compiler/xcc: omit -g if needed for Clang 2022-01-25 21:16:32 -05:00
host-gcc cmake: Populate var CMAKE_GCOV 2021-09-02 19:44:00 -04:00
icx cmake: fix isystem_include_dir path for windows 2021-04-02 13:36:49 -04:00
xcc cmake: compiler/xcc: omit -g if needed for Clang 2022-01-25 21:16:32 -05:00
compiler_features.cmake cmake: CMake compile features support 2021-10-01 14:40:33 -04:00
compiler_flags_template.cmake cmake: compiler: Add framework for disabling C++ standard includes 2021-09-21 11:39:18 -04:00