Bug 1215498 - cross-arm-none-newlib-devel got syscalls supplied but it should not, as this targets bare metal.
Summary: cross-arm-none-newlib-devel got syscalls supplied but it should not, as this ...
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other (show other bugs)
Version: Current
Hardware: x86-64 openSUSE Tumbleweed
: P4 - Low : Normal (vote)
Target Milestone: ---
Assignee: Andreas Färber
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-20 06:55 UTC by Marc Welleweerd
Modified: 2023-10-07 11:02 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
reduced project that can trigger the issue (127.40 KB, application/gzip)
2023-09-20 06:57 UTC, Marc Welleweerd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Welleweerd 2023-09-20 06:55:07 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0
Build Identifier: 

When I use the package to compile my arm none binary, I get:

/usr/lib64/gcc/arm-none-eabi/13/ld: /usr/lib64/gcc/arm-none-eabi/13/../../../../arm-none-eabi/lib/thumb/v8-m.main+fp/hard/libg.a(libc_a-syscalls.o): in function `_close':
/home/abuild/rpmbuild/BUILD/newlib-4.3.0.20230120/build-regular-dir/arm-none-eabi/thumb/v8-m.main+fp/hard/newlib/../../../../../../newlib/libc/sys/arm/syscalls.c:443: multiple definition of `_close'; CMakeFiles/main.dir/main/system_calls.c.obj:<snip>200/main/system_calls_override.c:28: first defined here


I have done some searching but as fare I understand this Unix functions should not be included in this newlib variant.

Reproducible: Always

Steps to Reproduce:
1.run make dev #with cross-arm-none-newlib-devel and cross-arm-none-gcc13 installed

Actual Results:  
cmake ./CMakeLists.txt -DCMAKE_BUILD_TYPE=Development -Bbuild/build_development -DCMAKE_TOOLCHAIN_FILE=/opt/development/HPC200_TEMP/HPC200/main/cmake/arm-none-eabi-gcc.cmake -GNinja && \
   cmake --build build/build_development --parallel 18 --target main
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/arm-none-eabi-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/arm-none-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Srcs: main.cpp;system_calls_override.c
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /opt/development/HPC200_TEMP/HPC200/main/build/build_development
[3/3] Linking CXX executable hpc200.elf
FAILED: hpc200.elf 
: && /usr/bin/arm-none-eabi-g++ -mcpu=cortex-m33 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -Og -g -gdwarf-2 -Wall -Werror -fdata-sections -ffunction-sections -DUSE_HAL_DRIVER -DSTM32U575xx -mcpu=cortex-m33 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -Og -g -gdwarf-2 -Wall -Werror -fdata-sections -ffunction-sections -DUSE_HAL_DRIVER -DSTM32U575xx -mcpu=cortex-m33 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nosys.specs -T/opt/development/HPC200_TEMP/HPC200/main/STM32U575.ld -Wl,-Map=hpc200.map,--cref -Wl,--gc-sections,--no-warn-rwx-segments CMakeFiles/main.dir/main.cpp.obj CMakeFiles/main.dir/system_calls_override.c.obj -o hpc200.elf   && :
/usr/lib64/gcc/arm-none-eabi/13/ld: /usr/lib64/gcc/arm-none-eabi/13/../../../../arm-none-eabi/lib/thumb/v8-m.main+fp/hard/libg.a(libc_a-syscalls.o): in function `_close':
/home/abuild/rpmbuild/BUILD/newlib-4.3.0.20230120/build-regular-dir/arm-none-eabi/thumb/v8-m.main+fp/hard/newlib/../../../../../../newlib/libc/sys/arm/syscalls.c:443: multiple definition of `_close'; CMakeFiles/main.dir/system_calls_override.c.obj:/opt/development/HPC200_TEMP/HPC200/main/system_calls_override.c:1: first defined here
/usr/lib64/gcc/arm-none-eabi/13/ld: warning: cannot find entry symbol Reset_Handler; defaulting to 08020000
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
make: *** [Makefile:10: dev] Fout 1



Results are output of a reduced project and also got:
/usr/lib64/gcc/arm-none-eabi/13/ld: warning: cannot find entry symbol Reset_Handler; defaulting to 08020000
Warning that can be ignored 

I can supply a tarball of the reduced project
Comment 1 Marc Welleweerd 2023-09-20 06:57:48 UTC
Created attachment 869609 [details]
reduced project  that can trigger the issue
Comment 2 Marc Welleweerd 2023-09-21 06:22:37 UTC
Also i noticed the change log that specify notice that syscalls are not supplied

so it is a bug 


zo 19 dec 2021 13:00:00 CET
Stefan Brüns <stefan.bruens@rwth-aachen.de>
- Build also nano variants of the libraries. The flags/features
  are the same as used e.g. by ARM for their toolchain, or
  fedora; most notably syscalls are not supplied, as this targets
  bare metal.