swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [swarm-hackers] A radical suggestion


From: Marcus G. Daniels
Subject: Re: [swarm-hackers] A radical suggestion
Date: Wed, 08 Jan 2003 20:51:03 -0700
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.2.1) Gecko/20021130

> Actually it fails in just the same way Swarm is failing!:

> The difference is I changed the Makefile:

all: example
%.o: %.m
       gcc -fno-common -fgnu-runtime -c $< -o $@
%.o: %.c
       gcc -no-cpp-precomp -fno-common -c $< -o $@

The compiler has a different expectation of the runtime when you change to -fgnu-runtime. Here is an example that makes the subdirectories "apple" and "gnu" with a pair of dynamic libraries "libobjc.dylib" and the executables "example". You can see both are self-contained and runnable. Now delete the "libobjc.dylib" in the "apple" subdirectory and re-run "example" and you'll see that you don't get the "local _objc_getClasses" implementation, but instead the system implementation. In contrast, it doesn't work at all when you delete the libobjc.dylib in the "gnu" subdirectory because by default you won't have a shared library for the GNU runtime. For clarity, in Makefile.common you'll see that even the GCC driver isn't used to link the final executable, just the linker. You can also see that libtool is run with -v and shows you what is being linked. It's not inheriting things from the system libobjc. Don't be superstitious.

Attachment: example.tar.gz
Description: GNU Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]