EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

bin/ld: unrecognised emulation mode: apfile

Started by mantaray August 24, 2004
I got the following error message while cross compiling my application for ecos.

arm-elf-gcc -Wl,-Map,-mapfile -L/root/httpd_test/ecos_kernel/install/lib -Ttarge
t.ld test_httpd.o -L../libhttpd-1.3/src -lhttp -o test
/opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../arm-elf/
bin/ld: unrecognised emulation mode: apfile
                                     ^^^^^^
Where do I change the value for the emulation mode?

Supported emulations: armelf
collect2: ld returned 1 exit status
make: *** [test] Error 1


Thanks!
mantaray wrote:
> I got the following error message while cross compiling my application for ecos. > > arm-elf-gcc -Wl,-Map,-mapfile -L/root/httpd_test/ecos_kernel/install/lib -Ttarge > t.ld test_httpd.o -L../libhttpd-1.3/src -lhttp -o test > /opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../arm-elf/ > bin/ld: unrecognised emulation mode: apfile > ^^^^^^ > Where do I change the value for the emulation mode? > > Supported emulations: armelf > collect2: ld returned 1 exit status > make: *** [test] Error 1 >
The linker switch -m selects the target emulation mode. You have specified -mapfile, meaning select 'apfile'. Please read again the ld command line specification for the map file. Tauno Voipio tauno voipio (at) iki fi
Thanks for the help earlier on. I make the file again and the linker
throw me the following errors:

arm-elf-gcc --print-map
-L/root/eCos_Library_Builds/Net_lib/net_lib_install/lib
-Ttarget.ld test_httpd.o -L../libhttpd-1.3/src -lhttp -o test
/opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../arm-elf/lib/crt0.o:
In function `start':
/opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../arm-elf/lib/crt0.o(.text+0x0):
multiple definition of `start'
/root/eCos_Library_Builds/Net_lib/net_lib_install/lib/vectors.o(.text+0x3c):
first defined here
/opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../arm-elf/bin/ld:
cannot find -lc
collect2: ld returned 1 exit status
make: *** [test] Error 1

The vectors.o is included in my eCos net lib. Does that mean that I
should remove the lib to solve the prob? What does crt0.o do?

As for the cannot find -lc, is it looking for libc and its missing?

Btw are there any good documentations or sites on using arm-elf tools?

Thanks!



Tauno Voipio <tauno.voipio@iki.fi.NOSPAM.invalid> wrote in message news:<5JNWc.448$O1.371@read3.inet.fi>...
> mantaray wrote: > > I got the following error message while cross compiling my application for ecos. > > > > arm-elf-gcc -Wl,-Map,-mapfile -L/root/httpd_test/ecos_kernel/install/lib -Ttarge > > t.ld test_httpd.o -L../libhttpd-1.3/src -lhttp -o test > > /opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../arm-elf/ > > bin/ld: unrecognised emulation mode: apfile > > ^^^^^^ > > Where do I change the value for the emulation mode? > > > > Supported emulations: armelf > > collect2: ld returned 1 exit status > > make: *** [test] Error 1 > > > > The linker switch -m selects the target emulation mode. > > You have specified -mapfile, meaning select 'apfile'. Please > read again the ld command line specification for the map file. > > Tauno Voipio > tauno voipio (at) iki fi
mantaray wrote:
> Thanks for the help earlier on. I make the file again and the linker > throw me the following errors: > > arm-elf-gcc --print-map > -L/root/eCos_Library_Builds/Net_lib/net_lib_install/lib > -Ttarget.ld test_httpd.o -L../libhttpd-1.3/src -lhttp -o test > /opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../arm-elf/lib/crt0.o: > In function `start': > /opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../arm-elf/lib/crt0.o(.text+0x0): > multiple definition of `start' > /root/eCos_Library_Builds/Net_lib/net_lib_install/lib/vectors.o(.text+0x3c): > first defined here > /opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../arm-elf/bin/ld: > cannot find -lc > collect2: ld returned 1 exit status > make: *** [test] Error 1 > > The vectors.o is included in my eCos net lib. Does that mean that I > should remove the lib to solve the prob? What does crt0.o do?
The file crt0.o is the C runtime initialization module. It seems that you have two conflicting start-up modules. This is probably an eCos problem - see the documentation on the proper way to link a run module for it. Sorry, I don't know enough of eCos to be able to help here.
> As for the cannot find -lc, is it looking for libc and its missing?
Yes. It should find a C library for arm-elf and it seems not be there. This is a toolkit configuration problem: the compiler is not configured to find the library, if it is there. Please note that the library must be suitable for the target processor, the host system (e.g. Linux) libc won't do. I'm using newlib with gcc 3.2.1 for stand-alone ARM code.
> Btw are there any good documentations or sites on using arm-elf tools?
You could start with: <http://www.objsw.com/CrossGCC/FAQ.html>. Good luck! Tauno Voipio tauno voipio (at) iki fi

The 2024 Embedded Online Conference