lancaster-university/microbit-dal

Cannot build with arm-none-eabi-gcc v11 or higher

Opened this issue · 1 comments

There are build issues with v11.3.1 (Arm GNU Toolchain 11.3.Rel1) and v12.3.1 (Arm GNU Toolchain 12.3.Rel1 (Build arm-12.35)).
Works with v10.3.1 (GNU Arm Embedded Toolchain 10.3-2021.10).

The linker basically fails to find implementations for _getpid and _kill.

With gcc v11:

$ yotta build
warning: The build target has not been set, so the default (bbc-microbit-classic-gcc,https://github.com/lancaster-university/yotta-target-bbc-microbit-classic-gcc) is being used. You can use `yotta target <targetname>` to set the build target. See http://docs.yottabuild.org/tutorial/targets.html for more information on using targets.
info: generate for target: bbc-microbit-classic-gcc 0.2.3 at /Users/microbit-carlos/workspace/carlos/docker-microbit-toolchain/rmfolder/microbit-samples/yotta_targets/bbc-microbit-classic-gcc
CMake Deprecation Warning at CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at CMakeLists.txt:16 (cmake_policy):
  The OLD behavior for policy CMP0017 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at /Users/microbit-carlos/.local/pipx/venvs/cmake/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.22/Modules/CMakeForceCompiler.cmake:75 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  /Users/microbit-carlos/workspace/carlos/docker-microbit-toolchain/rmfolder/microbit-samples/yotta_targets/mbed-gcc/CMake/toolchain.cmake:78 (cmake_force_c_compiler)
  toolchain.cmake:8 (include)
  /Users/microbit-carlos/.local/pipx/venvs/cmake/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.22/Modules/CMakeDetermineSystem.cmake:124 (include)
  CMakeLists.txt:76 (project)


CMake Deprecation Warning at /Users/microbit-carlos/.local/pipx/venvs/cmake/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.22/Modules/CMakeForceCompiler.cmake:89 (message):
  The CMAKE_FORCE_CXX_COMPILER macro is deprecated.  Instead just set
  CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  /Users/microbit-carlos/workspace/carlos/docker-microbit-toolchain/rmfolder/microbit-samples/yotta_targets/mbed-gcc/CMake/toolchain.cmake:79 (cmake_force_cxx_compiler)
  toolchain.cmake:8 (include)
  /Users/microbit-carlos/.local/pipx/venvs/cmake/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.22/Modules/CMakeDetermineSystem.cmake:124 (include)
  CMakeLists.txt:76 (project)


GCC version is: 11.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /Users/microbit-carlos/opt/arm-gnu-toolchain-11.3.rel1/bin/arm-none-eabi-gcc
CMake Deprecation Warning at ym/ble/source/CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at ym/ble-nrf51822/source/CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


suppressing warnings from ble-nrf51822
CMake Deprecation Warning at ym/nrf51-sdk/source/CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


suppressing warnings from nrf51-sdk
suppressing ALL warnings from mbed-classic, ble, ble-nrf51822 & nrf51-sdk
CMake Deprecation Warning at ym/microbit/source/CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at source/CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done
-- Generating done
-- Build files have been written to: /Users/microbit-carlos/workspace/carlos/docker-microbit-toolchain/rmfolder/microbit-samples/build/bbc-microbit-classic-gcc

[172/172] Linking CXX executable source/microbit-samples
/Users/microbit-carlos/opt/arm-gnu-toolchain-11.3.rel1/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /Users/microbit-carlos/opt/arm-gnu-toolchain-11.3.rel1/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-signalr.o): in function `_getpid_r':
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/newlib-cygwin/newlib/libc/reent/signalr.c:83: warning: _getpid is not implemented and will always fail
/Users/microbit-carlos/opt/arm-gnu-toolchain-11.3.rel1/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /Users/microbit-carlos/opt/arm-gnu-toolchain-11.3.rel1/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-signalr.o): in function `_kill_r':
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/newlib-cygwin/newlib/libc/reent/signalr.c:53: warning: _kill is not implemented and will always fail

And with gcc v12 we get the same linking error:

yotta build
warning: The build target has not been set, so the default (bbc-microbit-classic-gcc,https://github.com/lancaster-university/yotta-target-bbc-microbit-classic-gcc) is being used. You can use `yotta target <targetname>` to set the build target. See http://docs.yottabuild.org/tutorial/targets.html for more information on using targets.
info: generate for target: bbc-microbit-classic-gcc 0.2.3 at /Users/microbit-carlos/workspace/carlos/docker-microbit-toolchain/rmfolder/microbit-samples/yotta_targets/bbc-microbit-classic-gcc
CMake Deprecation Warning at CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at CMakeLists.txt:16 (cmake_policy):
  The OLD behavior for policy CMP0017 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at /Users/microbit-carlos/.local/pipx/venvs/cmake/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.22/Modules/CMakeForceCompiler.cmake:75 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  /Users/microbit-carlos/workspace/carlos/docker-microbit-toolchain/rmfolder/microbit-samples/yotta_targets/mbed-gcc/CMake/toolchain.cmake:78 (cmake_force_c_compiler)
  toolchain.cmake:8 (include)
  /Users/microbit-carlos/.local/pipx/venvs/cmake/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.22/Modules/CMakeDetermineSystem.cmake:124 (include)
  CMakeLists.txt:76 (project)


CMake Deprecation Warning at /Users/microbit-carlos/.local/pipx/venvs/cmake/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.22/Modules/CMakeForceCompiler.cmake:89 (message):
  The CMAKE_FORCE_CXX_COMPILER macro is deprecated.  Instead just set
  CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  /Users/microbit-carlos/workspace/carlos/docker-microbit-toolchain/rmfolder/microbit-samples/yotta_targets/mbed-gcc/CMake/toolchain.cmake:79 (cmake_force_cxx_compiler)
  toolchain.cmake:8 (include)
  /Users/microbit-carlos/.local/pipx/venvs/cmake/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.22/Modules/CMakeDetermineSystem.cmake:124 (include)
  CMakeLists.txt:76 (project)


GCC version is: 12.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /Users/microbit-carlos/opt/arm-gnu-toolchain-12.3.rel1/bin/arm-none-eabi-gcc
CMake Deprecation Warning at ym/ble/source/CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at ym/ble-nrf51822/source/CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


suppressing warnings from ble-nrf51822
CMake Deprecation Warning at ym/nrf51-sdk/source/CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


suppressing warnings from nrf51-sdk
suppressing ALL warnings from mbed-classic, ble, ble-nrf51822 & nrf51-sdk
CMake Deprecation Warning at ym/microbit/source/CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at source/CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done
-- Generating done
-- Build files have been written to: /Users/microbit-carlos/workspace/carlos/docker-microbit-toolchain/rmfolder/microbit-samples/build/bbc-microbit-classic-gcc

[172/172] Linking CXX executable source/microbit-samples
/Users/microbit-carlos/opt/arm-gnu-toolchain-12.3.rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /Users/microbit-carlos/opt/arm-gnu-toolchain-12.3.rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-signalr.o): in function `_getpid_r':
signalr.c:(.text._getpid_r+0x2): warning: _getpid is not implemented and will always fail
/Users/microbit-carlos/opt/arm-gnu-toolchain-12.3.rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: /Users/microbit-carlos/opt/arm-gnu-toolchain-12.3.rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc_nano.a(libc_a-signalr.o): in function `_kill_r':
signalr.c:(.text._kill_r+0xe): warning: _kill is not implemented and will always fail