Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error with ARM Compiler 6 #71416

Closed
sreeramIfx opened this issue Apr 12, 2024 · 3 comments
Closed

Compilation error with ARM Compiler 6 #71416

sreeramIfx opened this issue Apr 12, 2024 · 3 comments
Assignees
Labels
area: Toolchains Toolchains bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale

Comments

@sreeramIfx
Copy link
Contributor

Describe the bug
Compiling blinky with GCC works fine, but the same app compiled with ARM Compiler 6 fails with the below described error when linking.

C:\WINDOWS\system32\cmd.exe /C "cd . && C:\workspace\ArmCompilers\bin\armlink.exe  --cpu=cortex-m4   --via=CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && C:\WINDOWS\system32\cmd.exe /C "cd /D C:\workspace\gitlab\zephyrproject-rtos\zephyr\build\zephyr && "C:\Program Files\CMake\bin\cmake.exe" -E true""
Error: L6384E: No Load Execution Region of name bss seen yet at line 11.
Error: L6384E: No Load Execution Region of name bss seen yet at line 15.

The errors seems to be from the below lines (not able to find __bss_start symbol) in the cmake\linker_script\arm\linker.cmake. I am able to work-around the errors by hardcoding instead of using __bss_start

zephyr_linker_symbol(SYMBOL __kernel_ram_start EXPR "(@__bss_start@)")
zephyr_linker_symbol(SYMBOL __kernel_ram_end  EXPR "(${RAM_ADDR} + ${RAM_SIZE})")
zephyr_linker_symbol(SYMBOL __kernel_ram_size EXPR "(@__kernel_ram_end@ - @__bss_start@)")

To Reproduce
Steps to reproduce the behavior:

  1. $Env:ZEPHYR_TOOLCHAIN_VARIANT="armclang"
  2. west build -p always -b cy8cproto_063_ble .\samples\basic\blinky\

Expected behavior
blinky should compile and link successfully with ARM compiler as well

Impact
Unable to use ARM Compiler for our platforms

Logs and console output

west build -p always -b cy8cproto_063_ble .\samples\basic\blinky\
-- west build: making build dir C:\workspace\gitlab\zephyrproject-rtos\zephyr\build pristine
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: C:/workspace/gitlab/zephyrproject-rtos/zephyr/samples/basic/blinky
-- CMake version: 3.29.0
-- Found Python3: C:/workspace/gitlab/zephyrproject-rtos/.venv/Scripts/python.exe (found suitable version "3.11.0", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: C:/workspace/gitlab/zephyrproject-rtos/zephyr/.cache
-- Zephyr version: 3.6.99 (C:/workspace/gitlab/zephyrproject-rtos/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: cy8cproto_063_ble, qualifiers: cyble_416045_02
-- Found armclang: C:/workspace/ArmCompilers/bin/armclang.exe (found suitable version "6.17", minimum required is "6.17")
-- Found Dtc: C:/ProgramData/chocolatey/bin/dtc.exe (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found BOARD.dts: C:/workspace/gitlab/zephyrproject-rtos/zephyr/boards/cypress/cy8cproto_063_ble/cy8cproto_063_ble.dts
-- Generated zephyr.dts: C:/workspace/gitlab/zephyrproject-rtos/zephyr/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: C:/workspace/gitlab/zephyrproject-rtos/zephyr/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: C:/workspace/gitlab/zephyrproject-rtos/zephyr/build/zephyr/dts.cmake
C:/workspace/gitlab/zephyrproject-rtos/zephyr/build/zephyr/zephyr.dts:231.20-235.5: Warning (simple_bus_reg): /soc/bless: missing or empty reg/ranges property
C:/workspace/gitlab/zephyrproject-rtos/zephyr/build/zephyr/zephyr.dts:39.29-54.5: Warning (avoid_unnecessary_addr_size): /soc/pinctrl@40310000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
Parsing C:/workspace/gitlab/zephyrproject-rtos/zephyr/Kconfig
Loaded configuration 'C:/workspace/gitlab/zephyrproject-rtos/zephyr/boards/cypress/cy8cproto_063_ble/cy8cproto_063_ble_defconfig'
Merged configuration 'C:/workspace/gitlab/zephyrproject-rtos/zephyr/samples/basic/blinky/prj.conf'
Configuration saved to 'C:/workspace/gitlab/zephyrproject-rtos/zephyr/build/zephyr/.config'
Kconfig header saved to 'C:/workspace/gitlab/zephyrproject-rtos/zephyr/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is ARMClang 6.17.0
-- The CXX compiler identification is ARMClang 6.17.0
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.29/Modules/Compiler/ARMClang.cmake:91 (message):
  Policy CMP0123 is not set: ARMClang cpu/arch compile and link flags must be
  set explicitly.  Run "cmake --help-policy CMP0123" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility, CMake will automatically add cpu/arch flags based on the
  CMAKE_SYSTEM_PROCESSOR and/or CMAKE_SYSTEM_ARCH variables.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.29/Modules/Compiler/ARMClang-C.cmake:3 (__compiler_armclang)
  C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeCInformation.cmake:25 (include)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/cmake/modules/kernel.cmake:128 (project)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/cmake/modules/zephyr_default.cmake:141 (include)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:4 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.29/Modules/Compiler/ARMClang.cmake:91 (message):
  Policy CMP0123 is not set: ARMClang cpu/arch compile and link flags must be
  set explicitly.  Run "cmake --help-policy CMP0123" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility, CMake will automatically add cpu/arch flags based on the
  CMAKE_SYSTEM_PROCESSOR and/or CMAKE_SYSTEM_ARCH variables.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.29/Modules/Compiler/ARMClang-CXX.cmake:3 (__compiler_armclang)
  C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeCXXInformation.cmake:25 (include)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/cmake/modules/kernel.cmake:128 (project)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/cmake/modules/zephyr_default.cmake:141 (include)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:4 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The ASM compiler identification is ARMClang
-- Found assembler: C:/workspace/ArmCompilers/bin/armclang.exe
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.29/Modules/Compiler/ARMClang.cmake:91 (message):
  Policy CMP0123 is not set: ARMClang cpu/arch compile and link flags must be
  set explicitly.  Run "cmake --help-policy CMP0123" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility, CMake will automatically add cpu/arch flags based on the
  CMAKE_SYSTEM_PROCESSOR and/or CMAKE_SYSTEM_ARCH variables.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.29/Modules/Compiler/ARMClang-ASM.cmake:9 (__compiler_armclang)
  C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeASMInformation.cmake:22 (include)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/cmake/modules/kernel.cmake:134 (enable_language)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/cmake/modules/zephyr_default.cmake:141 (include)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  C:/workspace/gitlab/zephyrproject-rtos/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:4 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.29/Modules/Compiler/ARMClang.cmake:91 (message):
  Policy CMP0123 is not set: ARMClang cpu/arch compile and link flags must be
  set explicitly.  Run "cmake --help-policy CMP0123" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility, CMake will automatically add cpu/arch flags based on the
  CMAKE_SYSTEM_PROCESSOR and/or CMAKE_SYSTEM_ARCH variables.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.29/Modules/Compiler/ARMClang-ASM.cmake:9 (__compiler_armclang)
  C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeASMInformation.cmake:22 (include)
  C:/workspace/gitlab/zephyrproject-rtos/modules/lib/picolibc/CMakeLists.txt:38 (project)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done (27.9s)
-- Generating done (0.4s)
-- Build files have been written to: C:/workspace/gitlab/zephyrproject-rtos/zephyr/build
←[92m-- west build: building application
[2/150] Generating include/generated/version.h
-- Zephyr version: 3.6.99 (C:/workspace/gitlab/zephyrproject-rtos/zephyr), build: v3.6.0-2462-g17081222e2e7
[146/150] Linking C executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map C:/workspace/gitlab/zephyrproject-rtos/zephyr/build/zephyr/zephyr_pre0.map
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\workspace\ArmCompilers\bin\armlink.exe  --cpu=cortex-m4   --via=CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && C:\WINDOWS\system32\cmd.exe /C "cd /D C:\workspace\gitlab\zephyrproject-rtos\zephyr\build\zephyr && "C:\Program Files\CMake\bin\cmake.exe" -E true""
Error: L6384E: No Load Execution Region of name bss seen yet at line 11.
Error: L6384E: No Load Execution Region of name bss seen yet at line 15.
Not enough information to list the image map.
Finished: 1 information, 0 warning and 2 error messages.
ninja: build stopped: subcommand failed.

Environment (please complete the following information):

  • OS: Windows
  • Toolchain: ARM Compiler 6
  • Commit SHA or Version used : 1708122
@sreeramIfx sreeramIfx added the bug The issue is a bug, or the PR is fixing a bug label Apr 12, 2024
@nordicjm nordicjm added the area: Toolchains Toolchains label Apr 12, 2024
@sreeramIfx
Copy link
Contributor Author

sreeramIfx commented Apr 12, 2024

I am also seeing the issue described @ #41435 (reply in thread)

I am able to work around the issue by using -DCONFIG_OUTPUT_DISASSEMBLY=n (as described in the above link). But its indicated that it should not happen with versions > 6.17 I am seeing it with ver 6.22 as well

@nashif nashif added the priority: low Low impact/importance bug label Apr 23, 2024
Copy link

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.

@github-actions github-actions bot added the Stale label Jun 23, 2024
@dipakgmx dipakgmx removed the Stale label Jun 26, 2024
Copy link

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.

@github-actions github-actions bot added the Stale label Aug 26, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Toolchains Toolchains bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale
Projects
Status: Done
Development

No branches or pull requests

5 participants