[fpc-devel] More info on Bug 4430

Andrew Haines AndrewD207 at aol.com
Thu Oct 13 03:54:18 CEST 2005


Hi,

I submitted a bug (4430) and after doing so, found some more information.

I'll paste the bug contents here so you know what I'm talking about.

http://www.freepascal.org/bugs/showrec.php3?ID=4430
<bug>
Here's the scenario:

I've copied /usr/lib from my MacOSX computer to $HOME/darwin-root

I've compiled the binutils for target apple-darwin (see odcctools)

now from linux I execute in fpc/ :
make CPU_TARGET=powerpc OS_TARGET=darwin OPT=-Fl$HOME/darwin-root/usr/lib

which causes the error:
/usr/local/odcctools/bin/powerpc-darwin-ld: /usr/lib/crt1.o bad magic 
number (not a Mach-O file)

in compiler/systems/t_bsd.pas on line 362 is the line:
prtobj:='/usr/lib/crt1.o'

so it is hardcoded to /usr/lib.

I've tried changing this line to:
LibrarySearchPath.FindFile('crt1.o',prtobj)
but it finds /usr/lib/crt1.o

</bug>

The line:
LibrarySearchPath.FindFile('crt1.o',prtobj)
DOES work if I supply OPT='-Xd -Xr/home/andrew/darwin-root/usr/lib' to make.

I'm not sure if the -Xr part helps it out any or not...

I do know that -Xd didn't work when the line was : prtobj:='/usr/lib/crt1.o'

Regards,

Andrew Haines







More information about the fpc-devel mailing list