Coincidentally, I was reading about this earlier today. Basically Apple would like to prevent you using crt0.o: http://developer.apple.com/qa/qa2001/qa1118.html Dan 2007/4/5, Michael Brian Bentley <bentley@crenelle.com>:
I find that I'm using macports more and more as I try to do builds using scripts that were developed on GNU/Linux systems with GNU versions of tools. I am finding that there's just enough difference in the use of some tools like sed and cp (of all utilities, cp?) that force me to add the GNU version to /opt/local/bin using mac ports so I can move on.
I have a command line tool that I'm trying to build on OS X for OS X, using gcc 3. During the link phase, it searches for, but can't find crt0.o. When I run this build script on a machine using a SuSE distribution of GNU/Linux, no problem.
I'm using the macports installs for gcc41 and gcc42.
According to some recent reading, http://www.delorie.com/djgpp/v2faq/faq8_2.html for example, I get the impression that crt0.o is something that's provided by the gcc compiler for the target platform. I see crt0.o provided with the arm-elf xcompiler builds of gcc, but not for the intel / intel versions of gcc. The linker is definitely looking for crt0.o, and the script that calls gcc does not mention crt0.o anywhere. The crt0.o file is mentioned in numerous other places for other builds.
I have found other files that seem related, like crtbegin.o, crtbeginS.o, and so on.
Can anyone shed some light on this?
Thanks,
-Mike _______________________________________________ macports-users mailing list macports-users@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/macports-users
On the plus side, this is the first meaningful explanation I've seen (thanks for finding it!) that says what gcc is doing and why. Now I know. Cool. Because of Apple's stark interest in keeping linking dynamic, I could see Apple adding a warning to their build of gcc that explains (briefly!) what's going on and how to fix it (use -xyz, not -srx, or whatever). Heck, they don't say in this tech note what you need to do in order to switch from static to dynamic linking. The truth is in the tech note, which is good, but it isn't where the problem resolution information will do the most good at the most sensible time, which would be to put it in with gcc. I've experienced carefully placed, undocumented gotchas courtesy Apple before. -m At 10:22 PM +0100 4/5/07, Dan Stowell wrote:
Coincidentally, I was reading about this earlier today. Basically Apple would like to prevent you using crt0.o: http://developer.apple.com/qa/qa2001/qa1118.html
Dan
participants (2)
-
Dan Stowell
-
Michael Brian Bentley