Opened 4 years ago

Last modified 2 years ago

#62140 new defect

arm-none-eabi-gcc@9.2.0_1: cannot find -lstdc++_nano

Reported by: rubendibattista (Ruben Di Battista) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc: jweber-ice, cooljeanius (Eric Gallager)
Port: arm-none-eabi-gcc

Description

I'm trying to cross-compile a project (https://gitlab.com/rubendibattista/arduinodue-cmake) that normally builds on Ubuntu, and it used to build also with the cross-compiler here on Macports.

cmake -DCMAKE_TOOLCHAIN_FILE=$(realpath ../cmake/Arduino-Toolchain.cmake) -DCMAKE_INSTALL_PREFIX=$(realpath ../install) ..
realpath: /Users/rubendibattista/git/eve/control-system/ArduinoDueCMake/install: No such file or directory
-- The CXX compiler identification is GNU 9.2.0
-- The C compiler identification is GNU 9.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /opt/local/bin/arm-none-eabi-g++
-- Check for working CXX compiler: /opt/local/bin/arm-none-eabi-g++ - broken
CMake Error at /opt/local/share/cmake-3.19/Modules/CMakeTestCXXCompiler.cmake:59 (message):
  The C++ compiler

    "/opt/local/bin/arm-none-eabi-g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/rubendibattista/git/eve/control-system/ArduinoDueCMake/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make cmTC_c2022/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_c2022.dir/build.make CMakeFiles/cmTC_c2022.dir/build
    Building CXX object CMakeFiles/cmTC_c2022.dir/testCXXCompiler.cxx.obj
    /opt/local/bin/arm-none-eabi-g++ -DARDUINO=10611 -DARDUINO_ARCH_SAM -DARDUINO_SAM_DUE -DF_CPU=84000000 -DUSBCON -DUSB_MANUFACTURER="\"Arduino LLC\"" -DUSB_PID=0x003e -DUSB_PRODUCT="\"Arduino Due\"" -DUSB_VID=0x2341 -D__SAM3X8E__ -Dprintf=iprintf  -g -Os -w -ffunction-sections -fdata-sections --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -fno-rtti -fno-exceptions -std=gnu++11 -Wall -Wextra  -o CMakeFiles/cmTC_c2022.dir/testCXXCompiler.cxx.obj -c /Users/rubendibattista/git/eve/control-system/ArduinoDueCMake/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    Linking CXX executable cmTC_c2022
    /opt/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c2022.dir/link.txt --verbose=1
    /opt/local/bin/arm-none-eabi-g++  -g -Os -w -ffunction-sections -fdata-sections --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -fno-rtti -fno-exceptions -std=gnu++11 -Wall -Wextra  -specs=nosys.specs -specs=nano.specs  CMakeFiles/cmTC_c2022.dir/testCXXCompiler.cxx.obj -o cmTC_c2022
    /opt/local/lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/ld: cannot find -lstdc++_nano
    /opt/local/lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/ld: cannot find -lg_nano
    /opt/local/lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/ld: cannot find -lc_nano
    collect2: error: ld returned 1 exit status
    make[1]: *** [cmTC_c2022] Error 1
    make: *** [cmTC_c2022/fast] Error 2

Any idea if it's a problem with the port or a problem with the project?

Change History (5)

comment:1 Changed 4 years ago by ra1nb0w

same here but no answer.

comment:2 Changed 3 years ago by jweber-ice

Likely related:

/opt/local/bin/arm-none-eabi-gcc -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Wall
... linker files ...
-Wl,--no-whole-archive -specs=nano.specs -specs=nosys.specs -lc -lm -lnosys  -Wl,-Map=echoserver-standalone.map,--cref -Wl,--gc-sections -Wl,--fatal-warnings -u _printf_float -Wl,--defsym=bootSymbol=1
/opt/local/lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/ld: cannot find -lc_nano
/opt/local/lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/ld: cannot find -lc_nano
collect2: error: ld returned 1 exit status
make[2]: *** [echoserver/echoserver-standalone.elf] Error 1
make[1]: *** [echoserver/CMakeFiles/echoserver-standalone.elf.dir/all] Error 2
make: *** [all] Error 2

Both nano.specs and nosys.specs exist in the port and add -lc_nano to the link, however libc_nano.a is not installed by the port.

comment:3 Changed 3 years ago by jweber-ice

Cc: jweber-ice added

comment:4 Changed 2 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:5 Changed 2 years ago by johankytt

This is still an issue with arm-none-eabi-gcc 12.2.0 on M1 with MacOS 12.5.1

Note: See TracTickets for help on using tickets.