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.88k stars 6.63k forks source link

Build Failure on HSDK Board with MWDT Lite Toolchain #78565

Open klisevich opened 2 months ago

klisevich commented 2 months ago

Describe the bug I am experiencing a build failure when trying to compile the hello_world sample for the HSDK board using the MWDT Lite toolchain. The error suggests that the gen_offset_header.py script fails due to a missing symbol table in the offsets.c.obj file.

Target Platform: hsdk Toolchain: DesignWare ARC C/C++ Compiler MW-Lite U-2023.06

To Reproduce Steps to reproduce the behavior: 1.Set the following environment variables in PS:

$env:ZEPHYR_TOOLCHAIN_VARIANT = 'arcmwdt'
$env:ARCMWDT_TOOLCHAIN_PATH = 'C:\MWLite'

2.Run the build command:

west build -b hsdk samples/hello_world --pristine

  1. The build process fails with this error message:
    FAILED: zephyr/include/generated/zephyr/offsets.h
    ...
    LookupError: Could not find symbol table

    Expected behavior The hello_world sample should compile successfully without any errors or warnings.

Logs and console output

(.venv) PS C:\Users\wro-s\zephyr_untouched\zephyr> echo $env:ZEPHYR_TOOLCHAIN_VARIANT
arcmwdt
(.venv) PS C:\Users\wro-s\zephyr_untouched\zephyr> echo $env:ARCMWDT_TOOLCHAIN_PATH
C:\MWLite
(.venv) PS C:\Users\wro-s\zephyr_untouched\zephyr> west build -b hsdk samples\hello_world --pristine
-- west build: making build dir C:\Users\wro-s\zephyr_untouched\zephyr\build pristine
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: C:/Users/wro-s/zephyr_untouched/zephyr/samples/hello_world
-- CMake version: 3.30.2
-- Found Python3: C:/Users/wro-s/zephyr_untouched/.venv/Scripts/python.exe (found suitable version "3.11.9", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: C:/Users/wro-s/zephyr_untouched/zephyr/.cache
-- Zephyr version: 3.7.99 (C:/Users/wro-s/zephyr_untouched/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: hsdk, qualifiers: arc_hsdk
-- Found host-tools: zephyr 0.16.8 (C:/Users/wro-s/zephyr-sdk-0.16.8)
-- Found dts preprocessor: C:/Users/wro-s/zephyr-sdk-0.16.8/aarch64-zephyr-elf/bin/aarch64-zephyr-elf-gcc.exe (Zephyr SDK 0.16.8)
-- Found Dtc: C:/ProgramData/chocolatey/bin/dtc.exe (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found BOARD.dts: C:/Users/wro-s/zephyr_untouched/zephyr/boards/snps/hsdk/hsdk.dts
-- Generated zephyr.dts: C:/Users/wro-s/zephyr_untouched/zephyr/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: C:/Users/wro-s/zephyr_untouched/zephyr/build/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: C:/Users/wro-s/zephyr_untouched/zephyr/build/zephyr/dts.cmake
Parsing C:/Users/wro-s/zephyr_untouched/zephyr/Kconfig
Loaded configuration 'C:/Users/wro-s/zephyr_untouched/zephyr/boards/snps/hsdk/hsdk_defconfig'
Merged configuration 'C:/Users/wro-s/zephyr_untouched/zephyr/samples/hello_world/prj.conf'
Configuration saved to 'C:/Users/wro-s/zephyr_untouched/zephyr/build/zephyr/.config'
Kconfig header saved to 'C:/Users/wro-s/zephyr_untouched/zephyr/build/zephyr/include/generated/zephyr/autoconf.h'
-- Found GNU objcopy helper for MWDT: C:/Users/wro-s/zephyr-sdk-0.16.8/arc-zephyr-elf/bin/arc-zephyr-elf-objcopy.exe (Zephyr SDK 0.16.8)
-- The C compiler identification is Clang 15.0.7
-- The CXX compiler identification is Clang 15.0.7
-- The ASM compiler identification is unknown
-- Found assembler: C:/MWLite/MetaWare/arc/bin/ccac.exe
-- Warning: Did not find file Compiler/-ASM
CMake Deprecation Warning at C:/Users/wro-s/zephyr_untouched/zephyr/cmake/modules/FindDeprecated.cmake:107 (message):
  The macro/function 'toolchain_ld_base' is deprecated.  Please use
  'arcmwdt/linker_flags.cmake' and define the appropriate linker flags as
  properties instead.  See
  'C:/Users/wro-s/zephyr_untouched/zephyr/cmake/linker/linker_flags_template.cmake'
  for known linker properties.
Call Stack (most recent call first):
  C:/Users/wro-s/zephyr_untouched/zephyr/CMakeLists.txt:363 (find_package)

CMake Deprecation Warning at C:/Users/wro-s/zephyr_untouched/zephyr/cmake/modules/FindDeprecated.cmake:123 (message):
  The macro/function 'toolchain_ld_baremetal' is deprecated.  Please use
  'arcmwdt/linker_flags.cmake' and define the appropriate linker flags as
  properties instead.  See
  'C:/Users/wro-s/zephyr_untouched/zephyr/cmake/linker/linker_flags_template.cmake'
  for known linker properties.
Call Stack (most recent call first):
  C:/Users/wro-s/zephyr_untouched/zephyr/CMakeLists.txt:385 (find_package)

-- Warning: Did not find file Compiler/-ASM
-- Setting build type to 'MinSizeRel' as none was specified.
-- Configuring done (7.6s)
-- Generating done (0.4s)
-- Build files have been written to: C:/Users/wro-s/zephyr_untouched/zephyr/build
←[92m-- west build: building application
[1/130] Generating include/generated/zephyr/version.h
-- Zephyr version: 3.7.99 (C:/Users/wro-s/zephyr_untouched/zephyr), build: v3.7.0-2925-gca09a4b91c4a
[7/130] Generating include/generated/zephyr/offsets.h
FAILED: zephyr/include/generated/zephyr/offsets.h C:/Users/wro-s/zephyr_untouched/zephyr/build/zephyr/include/generated/zephyr/offsets.h
C:\Windows\system32\cmd.exe /C "cd /D C:\Users\wro-s\zephyr_untouched\zephyr\build\zephyr && C:\Users\wro-s\zephyr_untouched\.venv\Scripts\python.exe C:/Users/wro-s/zephyr_untouched/zephyr/scripts/build/gen_offset_header.py -i C:/Users/wro-s/zephyr_untouched/zephyr/build/zephyr/CMakeFiles/offsets.dir/./arch/arc/core/offsets/offsets.c.obj -o C:/Users/wro-s/zephyr_untouched/zephyr/build/zephyr/include/generated/zephyr/offsets.h"
Traceback (most recent call last):
  File "C:\Users\wro-s\zephyr_untouched\zephyr\scripts\build\gen_offset_header.py", line 83, in <module>
    ret = gen_offset_header(args.input, input_file, output_file)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wro-s\zephyr_untouched\zephyr\scripts\build\gen_offset_header.py", line 42, in gen_offset_header
    for sym in get_symbol_table(obj).iter_symbols():
               ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wro-s\zephyr_untouched\zephyr\scripts\build\gen_offset_header.py", line 26, in get_symbol_table
    raise LookupError("Could not find symbol table")
LookupError: Could not find symbol table
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' --build 'C:\Users\wro-s\zephyr_untouched\zephyr\build'

Environment (please complete the following information): OS: Windows 11 pro Toolchain: DesignWare ARC C/C++ Compiler MW-Lite U-2023.06, Zephyr SDK 0.16.8 Zephyr Version: 3.7.99 (commit https://github.com/zephyrproject-rtos/zephyr/commit/ca09a4b91c4a977d743837419f11d7c9d373364e) CMake version: 3.30.2 Python version: 3.11.9 west version: 1.2.0

github-actions[bot] commented 7 hours 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.