This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building newlib without -mhard-float



On Sep 7, 2007, at 9:02 AM, Dave Korn wrote:


Linking is strictly in command line order. As it runs along the commandline
it picks up undefined references; when it finds a new library or file it
resolves any outstanding references *but* it doesn't memorize all the syms
from that file and re-use them to fill in undefined references that turn up
*later* on the command-line. See also the --start-group and --end- group
options to ld.

Thanks for the explanation. Shortly after I sent that email I realized that it must be doing this.


However, the real underlying cause of the problem is that you're doing it
wrong. Don't invoke ld directly. Use the gcc compiler driver, and it will
automatically get all the startup files and libraries in the right places for
you.

So, I am actually not calling ld directly. I was, but I finally figured out how to call gcc and not have it throw a bunch of stuff in the wrong places. I only started with ld because that's what various examples I had started with. I now call:


arm-elf-gcc -Wl,-Map,mapfile.txt -mcpu=xscale -nostdlib -Wall -Wextra -Wredundant-decls -pedantic -Wshadow -O2 -Xlinker --script=link.lds - o h.elf obj/start.o obj/Util.o obj/glue.o obj/lcd.o obj/main.o -lc - lm -lgcc


So, the order is still important.


--
Rick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]