Please Read and Support Compilation error in OSMOCOM BB
Hello Team, I hope you are well and good . While I am doing the compilation of osmocom BB , There are errors as following , I committed the "Hello world" in the Makefile then there was another error and it kept coming one after another after I did the commit . Please note I have installed all the pre-requisites , GnuARM ToolChain and Libsomocomcore as directed in document . Also I have tried on both Ubuntu 20 and 22 but still the error keep coming . Please let me know for any know solutions for the same and also let me know if you need some more information from myside . Advance thanks for your support and all this good work . comm/timer.c: In function ‘timer_irq’: comm/timer.c:184: warning: unused parameter ‘irq’ AR comm/libcomm.a CC tiffs/globals.o CC tiffs/init.o CC tiffs/readfile.o AR tiffs/libtiffs.a LD board/compal_e88/hello_world.compalram.elf arm-elf-gcc: board/compal_e88/hello_world.compalram.map: No such file or directory make[1]: *** [Makefile.inc:139: board/compal_e88/hello_world.compalram.elf] Error 1 make[1]: Leaving directory '/home/lab3/osmocom-bb/src/target/firmware' make: *** [Makefile:100: firmware] Error 2 BR// Niraj Kumar
Hello Niraj, On 05.02.2024 18:56, Neeraj Chaudhary wrote:
arm-elf-gcc: board/compal_e88/hello_world.compalram.map: No such file or directory
Please try reverting this commit: 818133cd23b493da472daff2cda9a8e97d0c9637 [1] It was reported by several other people that this commit breaks the firmware builds when using the old "arm-elf-*" toolchain. [1] https://cgit.osmocom.org/osmocom-bb/commit/?id=818133cd23b493da472daff2cda9a... -- Best regards, Vadim.
Many Thanks for your reply Vadim, I reverted the suggested commit and now getting the below error comm/timer.c: In function 'timer_irq': comm/timer.c:184:35: warning: unused parameter 'irq' [-Wunused-parameter] 184 | static void timer_irq(enum irq_nr irq) | ~~~~~~~~~~~~^~~ AR comm/libcomm.a arm-none-eabi-ar: `u' modifier ignored since `D' is the default (see `U') CC tiffs/globals.o CC tiffs/init.o CC tiffs/readfile.o tiffs/readfile.c:29:14: warning: declaration of built-in function 'index' without a prototype; expected 'char *(const char *, int)' [-Wbuiltin-declaration-mismatch] 29 | extern char *index(); | ^~~~~ AR tiffs/libtiffs.a arm-none-eabi-ar: `u' modifier ignored since `D' is the default (see `U') LD board/compal_e88/hello_world.highram.elf arm-none-eabi-ld: Error: unable to disambiguate: -nostartfiles (did you mean --nostartfiles ?) make[1]: *** [Makefile.inc:138: board/compal_e88/hello_world.highram.elf] Error 1 make[1]: Leaving directory '/home/nokia-lab3/osmocom-bb/src/target/firmware' make: *** [Makefile:100: firmware] Error 2 Also you mentioned that people are getting this error while using the old "arm-elf-*" Toolchain, May you please guide me on where I can get the new Toolchain ? So I do need to make these reverts . Currently I am following the OSMOCOM Guide and installing the toolchain as mentioned below . sudo apt install gcc-arm-none-eabi BR// Niraj Kumar On Wed, Feb 14, 2024 at 1:00 AM Vadim Yanitskiy <axilirator@gmail.com> wrote:
Hello Niraj,
On 05.02.2024 18:56, Neeraj Chaudhary wrote:
arm-elf-gcc: board/compal_e88/hello_world.compalram.map: No such file or directory
Please try reverting this commit:
818133cd23b493da472daff2cda9a8e97d0c9637 [1]
It was reported by several other people that this commit breaks the firmware builds when using the old "arm-elf-*" toolchain.
[1]
https://cgit.osmocom.org/osmocom-bb/commit/?id=818133cd23b493da472daff2cda9a...
-- Best regards, Vadim.
Hello Neeraj, On 14.02.2024 13:02, Neeraj Chaudhary wrote:
LD board/compal_e88/hello_world.highram.elf arm-none-eabi-ld: Error: unable to disambiguate: -nostartfiles (did you mean --nostartfiles ?) make[1]: *** [Makefile.inc:138: board/compal_e88/hello_world.highram.elf] Error 1 make[1]: Leaving directory '/home/nokia-lab3/osmocom-bb/src/target/firmware' make: *** [Makefile:100: firmware] Error 2
interestingly enough, this is exactly the error that the commit I suggested to revert is supposed to fix. I was getting this error with arm-none-eabi-gcc v13.2.0 and that commit fixed the problem for me. As a temporary workaround, in addition to having the Harald's commit reverted, I suggest applying this patch: --- a/src/target/firmware/Makefile.inc +++ b/src/target/firmware/Makefile.inc @@ -22,7 +22,7 @@ CFLAGS += -g$(DEBUGF) #ASFLAGS=--g$(DEBUGF) $(INCLUDES) -D__ASSEMBLY__ ASFLAGS=$(INCLUDES) -D__ASSEMBLY__ -LDFLAGS = -nostartfiles -nostdlib -nodefaultlibs --gc-sections --cref +LDFLAGS = -nostdlib -z nodefaultlib --gc-sections --cref #### QUIET OUTPUT #### This is how I used to workaround the problem when building locally, before the Harald's patch was merged.
Also you mentioned that people are getting this error while using the old "arm-elf-*" Toolchain, May you please guide me on where I can get the new Toolchain ? So I do need to make these reverts .
It appears like you're already using a more or less recent toolchain. But we would need to know the version, of course ;) I thought were using arm-none-eabi-gcc v4.8.2.
Currently I am following the OSMOCOM Guide and installing the toolchain as mentioned below .
sudo apt install gcc-arm-none-eabi
Please tell us the exact version(s) of the toolchain components: $ dpkg -l | grep arm-none-eabi And what kind of linux distribution you're using (Debian? Ubuntu?). I just gave it a try in docker, using debian:bookworm image: root@a2fb7cb6978c:/osmocom-bb/src# dpkg -l | grep arm-none-eabi ii binutils-arm-none-eabi 2.40-2+18+b1 amd64 ii gcc-arm-none-eabi 15:12.2.rel1-1 amd64 ii libnewlib-arm-none-eabi 3.3.0-1.3 all ii libstdc++-arm-none-eabi-dev 15:12.2.rel1-1+23 all ii libstdc++-arm-none-eabi-newlib 15:12.2.rel1-1+23 all And could successfully build the firmware without having to revert anything. -- Best regards, Vadim.
Many Thanks Vadim for your reply , I am getting the new error now . omm/timer.c: In function 'timer_irq': comm/timer.c:184:35: warning: unused parameter 'irq' [-Wunused-parameter] 184 | static void timer_irq(enum irq_nr irq) | ~~~~~~~~~~~~^~~ AR comm/libcomm.a arm-none-eabi-ar: `u' modifier ignored since `D' is the default (see `U') LD board/mt62xx/loader_mtk.mtkram.elf arm-none-eabi-gcc: error: board/mt62xx/loader_mtk.mtkram.map: No such file or directory arm-none-eabi-gcc: error: unrecognized command-line option '--gc-sections'; did you mean '--data-sections'? arm-none-eabi-gcc: error: unrecognized command-line option '--cref'; did you mean '--xref'? make[1]: *** [Makefile.inc:139: board/mt62xx/loader_mtk.mtkram.elf] Error 1 make[1]: Leaving directory '/home/nokia-lab3/osmocom-bb/src/target/firmware' make: *** [Makefile:104: mtk-firmware] Error 2 and I am using a ubuntu 22 machine , Output of arm-none-eabi is as following . dpkg -l | grep arm-none-eabi ii binutils-arm-none-eabi 2.38-3ubuntu1+15build1 amd64 GNU assembler, linker and binary utilities for ARM Cortex-R/M processors ii gcc-arm-none-eabi 15:10.3-2021.07-4 amd64 GCC cross compiler for ARM Cortex-R/M processors ii libnewlib-arm-none-eabi 3.3.0-1.3 all C library and math library compiled for bare metal using Cortex A/R/M BR// Niraj Kumar On Sun, Feb 18, 2024 at 7:50 PM Vadim Yanitskiy <axilirator@gmail.com> wrote:
Hello Neeraj,
On 14.02.2024 13:02, Neeraj Chaudhary wrote:
LD board/compal_e88/hello_world.highram.elf arm-none-eabi-ld: Error: unable to disambiguate: -nostartfiles (did you mean --nostartfiles ?) make[1]: *** [Makefile.inc:138: board/compal_e88/hello_world.highram.elf] Error 1 make[1]: Leaving directory '/home/nokia-lab3/osmocom-bb/src/target/firmware' make: *** [Makefile:100: firmware] Error 2
interestingly enough, this is exactly the error that the commit I suggested to revert is supposed to fix. I was getting this error with arm-none-eabi-gcc v13.2.0 and that commit fixed the problem for me.
As a temporary workaround, in addition to having the Harald's commit reverted, I suggest applying this patch:
--- a/src/target/firmware/Makefile.inc +++ b/src/target/firmware/Makefile.inc @@ -22,7 +22,7 @@ CFLAGS += -g$(DEBUGF) #ASFLAGS=--g$(DEBUGF) $(INCLUDES) -D__ASSEMBLY__ ASFLAGS=$(INCLUDES) -D__ASSEMBLY__
-LDFLAGS = -nostartfiles -nostdlib -nodefaultlibs --gc-sections --cref +LDFLAGS = -nostdlib -z nodefaultlib --gc-sections --cref
#### QUIET OUTPUT ####
This is how I used to workaround the problem when building locally, before the Harald's patch was merged.
Also you mentioned that people are getting this error while using the old "arm-elf-*" Toolchain, May you please guide me on where I can get the new Toolchain ? So I do need to make these reverts .
It appears like you're already using a more or less recent toolchain. But we would need to know the version, of course ;) I thought were using arm-none-eabi-gcc v4.8.2.
Currently I am following the OSMOCOM Guide and installing the toolchain as mentioned below .
sudo apt install gcc-arm-none-eabi
Please tell us the exact version(s) of the toolchain components:
$ dpkg -l | grep arm-none-eabi
And what kind of linux distribution you're using (Debian? Ubuntu?).
I just gave it a try in docker, using debian:bookworm image:
root@a2fb7cb6978c:/osmocom-bb/src# dpkg -l | grep arm-none-eabi ii binutils-arm-none-eabi 2.40-2+18+b1 amd64 ii gcc-arm-none-eabi 15:12.2.rel1-1 amd64 ii libnewlib-arm-none-eabi 3.3.0-1.3 all ii libstdc++-arm-none-eabi-dev 15:12.2.rel1-1+23 all ii libstdc++-arm-none-eabi-newlib 15:12.2.rel1-1+23 all
And could successfully build the firmware without having to revert anything.
-- Best regards, Vadim.
Hello Neeraj, I managed to reproduce the problem in a Docker container using ubuntu:jammy (22.04.4 LTS) as the base image. Doing what I suggested in a previous mail fixes build errors, so please carefully check if you followed my recommendations closely enough. Below is the Dockerfile I used for testing, including the workaround: ------------------------------------------------------------------ FROM ubuntu:jammy RUN apt-get update && \ apt-get install -y --no-install-recommends \ autoconf automake libtool \ build-essential \ gcc-arm-none-eabi \ libnewlib-arm-none-eabi \ ca-certificates \ python3 git WORKDIR /root RUN git clone https://git.osmocom.org/osmocom-bb # workaround for the ARM toolchain provided by Ubuntu 22.04.4 # ii binutils-arm-none-eabi 2.40-2+18+b1 # ii gcc-arm-none-eabi 15:12.2.rel1-1 RUN cd osmocom-bb/ && \ git config --global user.email "you@example.com" && \ git revert --no-edit 818133cd23b493da472daff2cda9a8e97d0c9637 && \ sed -i "/DCONFIG_TX_ENABLE/c\CFLAGS += -DCONFIG_TX_ENABLE" \ src/target/firmware/Makefile && \ sed -i "/LDFLAGS =/c\LDFLAGS = -nostdlib -z nodefaultlib --gc-sections --cref" \ src/target/firmware/Makefile.inc RUN cd osmocom-bb/src/ && make firmware ------------------------------------------------------------------ I don't think there is anything we can do to support the variety of toolchain variants/versions. We're using 'debian:bookworm' Docker image for the build verification, so I would suggest to use it too. We also have a Dockerfile for building the old toolchain: https://cgit.osmocom.org/docker-playground/tree/arm-none-eabi-gcc-4.8.2 -- Best regards, Vadim.
participants (2)
-
Neeraj Chaudhary -
Vadim Yanitskiy