Skip to content
Commit 0b09ca8c authored by Daniel Leung's avatar Daniel Leung Committed by Anas Nashif
Browse files

cmake: compiler/xcc: override and clear debug property 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.

Note that this is an alternative implementation to commit
deeb98da. This one does not
alter the GCC flag file, and instead, simply clear the debug
compiler property so "-g" is not used.

Signed-off-by: default avatarDaniel Leung <daniel.leung@intel.com>
parent becc1efe
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment