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.