zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.75k stars 6.56k forks source link

LLVM / clang: compilation of JLINK_MONITOR_ISR_SES.s fails #77071

Open tejlmand opened 2 months ago

tejlmand commented 2 months ago

Describe the bug

Compilation of JLINK_MONITOR_ISR_SES.s fails when compiling with clang.

[966/1082] Building ASM object zephyr/CMakeFiles/zephyr.dir/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s.obj
FAILED: zephyr/CMakeFiles/zephyr.dir/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s.obj 
ccache /opt/LLVM-ET-Arm-18.1.3-Linux-x86_64/bin/clang -target armv8m.main-none-eabi -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DNRF54L15_ENGA_XXAA -DNRF_APPLICATION -DNRF_CONFIG_CPU_FREQ_MHZ=128 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I../kernel/include -I../arch/arm/include -Izephyr/include/generated/zephyr -I../include -Izephyr/include/generated -I../soc/nordic -I../soc/nordic/nrf54l/. -I../soc/nordic/common/. -I/projects/github/ncs/modules/hal/cmsis/CMSIS/Core/Include -I../modules/cmsis/. -I/projects/github/ncs/modules/hal/nordic/nrfx -I/projects/github/ncs/modules/hal/nordic/nrfx/drivers/include -I/projects/github/ncs/modules/hal/nordic/nrfx/mdk -I../modules/hal_nordic/nrfx/. -I/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/include -isystem ../lib/libc/common/include -isystem modules/picolibc/picolibc/include -isystem /opt/LLVM-ET-Arm-18.1.3-Linux-x86_64/lib/clang/18/include -Oz -imacros /projects/github/ncs/zephyr/build/zephyr/include/generated/zephyr/autoconf.h -fno-common -g -gdwarf-4 -fcolor-diagnostics --config /projects/github/ncs/zephyr/cmake/toolchain/llvm/clang_libgcc.cfg -fshort-enums -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfpu=none -mfloat-abi=soft -xassembler-with-cpp -imacros /projects/github/ncs/zephyr/include/zephyr/toolchain/zephyr_stdint.h -D_ASMLANGUAGE -Wno-sometimes-uninitialized -Wno-shift-overflow -Wno-missing-braces -Wno-self-assign -Wno-address-of-packed-member -Wno-unused-function -Wno-initializer-overrides -Wno-section -Wno-unknown-warning-option -Wno-unused-variable -Wno-format-invalid-specifier -Wno-gnu -Wno-tautological-compare -fno-asynchronous-unwind-tables -ftls-model=local-exec -Wno-vla -fmacro-prefix-map=/projects/github/ncs/zephyr/samples/hello_world=CMAKE_SOURCE_DIR -fmacro-prefix-map=/projects/github/ncs/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/projects/github/ncs=WEST_TOPDIR -ffunction-sections -fdata-sections -nostdinc -MD -MT zephyr/CMakeFiles/zephyr.dir/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s.obj -MF zephyr/CMakeFiles/zephyr.dir/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s.obj.d -o zephyr/CMakeFiles/zephyr.dir/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s.obj -c /projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s
/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s:58:9: error: unknown directive
        .name JLINK_MONITOR_ISR

To Reproduce Steps to reproduce the behavior:

  1. west build -p -b nrf52840dk/nrf52840 samples/hello_world/ -- -DCONFIG_SEGGER_DEBUGMON=y -DCONFIG_CORTEX_M_DEBUG_MONITOR_HOOK=y
  2. See error

Expected behavior Successful compilation

Impact Unable to use Segger's J-Link debug monitor

Logs and console output Build log:

$ west build -p -b nrf52840dk/nrf52840 samples/hello_world/ -- -DCONFIG_SEGGER_DEBUGMON=y -DCONFIG_CORTEX_M_DEBUG_MONITOR_HOOK=y
-- west build: making build dir /projects/github/ncs/zephyr/build pristine
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /projects/github/ncs/zephyr/samples/hello_world
-- CMake version: 3.20.6
-- Found Python3: /home/tora/zephyr-venv/bin/python3 (found suitable version "3.10.12", minimum required is "3.8") found components: Interpreter 
-- Cache files will be written to: /home/tora/.cache/zephyr
-- Zephyr version: 3.7.0-rc2 (/projects/github/ncs/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf52840dk, qualifiers: nrf52840
-- Found toolchain: host (clang/ld)
...
-- The C compiler identification is Clang 18.1.3
-- The CXX compiler identification is Clang 18.1.3
-- The ASM compiler identification is Clang
-- Found assembler: /opt/LLVM-ET-Arm-18.1.3-Linux-x86_64/bin/clang
...
-- west build: building application
[4/1080] Preparing syscall dependency handling

[6/1080] Generating include/generated/zephyr/version.h
-- Zephyr version: 3.7.0-rc2 (/projects/github/ncs/zephyr), build: v3.7.0-rc2-45-g768b8bbca30a
[1031/1080] Building ASM object modules/segger/CMakeFiles/modules__segger.dir/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s.obj
FAILED: modules/segger/CMakeFiles/modules__segger.dir/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s.obj 
ccache /opt/LLVM-ET-Arm-18.1.3-Linux-x86_64/bin/clang -target armv7m-none-eabi -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DNRF52840_XXAA -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -Izephyr/include/generated/zephyr -I../include -Izephyr/include/generated -I../soc/nordic -I../soc/nordic/nrf52/. -I../soc/nordic/common/. -I/projects/github/ncs/modules/hal/cmsis/CMSIS/Core/Include -I../modules/cmsis/. -I/projects/github/ncs/modules/hal/nordic/nrfx -I/projects/github/ncs/modules/hal/nordic/nrfx/drivers/include -I/projects/github/ncs/modules/hal/nordic/nrfx/mdk -I../modules/hal_nordic/nrfx/. -I/projects/github/ncs/modules/debug/segger/SEGGER -I/projects/github/ncs/modules/debug/segger/Config -I/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/include -isystem ../lib/libc/common/include -isystem modules/picolibc/picolibc/include -isystem /opt/LLVM-ET-Arm-18.1.3-Linux-x86_64/lib/clang/18/include -Oz -imacros /projects/github/ncs/zephyr/build/zephyr/include/generated/zephyr/autoconf.h -fno-common -g -gdwarf-4 -fcolor-diagnostics --config /projects/github/ncs/zephyr/cmake/toolchain/llvm/clang_libgcc.cfg -fshort-enums -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=none -mfloat-abi=soft -xassembler-with-cpp -imacros /projects/github/ncs/zephyr/include/zephyr/toolchain/zephyr_stdint.h -D_ASMLANGUAGE -Wno-sometimes-uninitialized -Wno-shift-overflow -Wno-missing-braces -Wno-self-assign -Wno-address-of-packed-member -Wno-unused-function -Wno-initializer-overrides -Wno-section -Wno-unknown-warning-option -Wno-unused-variable -Wno-format-invalid-specifier -Wno-gnu -Wno-tautological-compare -fno-asynchronous-unwind-tables -ftls-model=local-exec -Wno-vla -fmacro-prefix-map=/projects/github/ncs/zephyr/samples/hello_world=CMAKE_SOURCE_DIR -fmacro-prefix-map=/projects/github/ncs/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/projects/github/ncs=WEST_TOPDIR -ffunction-sections -fdata-sections -nostdinc -MD -MT modules/segger/CMakeFiles/modules__segger.dir/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s.obj -MF modules/segger/CMakeFiles/modules__segger.dir/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s.obj.d -o modules/segger/CMakeFiles/modules__segger.dir/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s.obj -c /projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s
/projects/github/ncs/modules/debug/segger/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s:58:9: error: unknown directive
        .name JLINK_MONITOR_ISR
        ^
[1044/1080] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
ninja: build stopped: subcommand failed.

Environment (please complete the following information):

github-actions[bot] commented 5 days ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.