[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [swarm-hackers] A radical suggestion
From: |
Bill Northcott |
Subject: |
Re: [swarm-hackers] A radical suggestion |
Date: |
Thu, 9 Jan 2003 12:55:07 +1100 |
> >This does not reproduce the problem.
> >
> What problem? I've seen no error log.
Sorry, I thought I had posted the error log. You should be able to
reproduce it yourself by pulling the current code from the cvs and
following the instructions in README.MacOSX and INSTALL.MacOSX. The Swarm
target in the PB project will attempt a full autogen.sh, configure, make
sequence.
Since this is a fair amount of hassle what with building an FSF compiler
because the Apple one crashes etc, I reproduce the error at the end of the
email. Renaming the Swarm runtime as libobjcs and amended reissuing the
instruction with -lobjcs reduces the undefined symbol count to two from
scores.
> >Swarm is working on ObjectiveC code and the compiler is clearly in
> >ObjectiveC mode because it has ObjectiveC flags and does not complain.
In
> >Objective-C mode, the compiler is automatically generating calls to the
> >Objective-C runtime. In C mode it presumably generates automatic calls
> >only to the C runtime, which is not called libobjc. So your link would
> >not have the problem, which is in Swarm.
> >
> >
> Ok, see attachment for the same thing done with the Objective C
compiler.
Actually it fails in just the same way Swarm is failing!:
$make
/usr/bin/libtool -dynamic objc.o objc_sym.o -o libobjc.dylib -lc
ld: for architecture ppc
ld: Undefined symbols:
___objc_class_name_Object
___objc_exec_class
/usr/bin/libtool: internal link edit command failed
make: *** [libobjc.dylib] Error 1
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 $@
libobjc.dylib: objc.o objc_sym.o
/usr/bin/libtool -dynamic objc.o objc_sym.o -o libobjc.dylib -lc
example: example.m libobjc.dylib
gcc example.m -L. -lobjc -o $@
clean:
$(RM) objc.o objc_sym.o example libobjc.dylib
I have been trying to work out the easiest way to frame an example. Wo I
just did it!
It worked for you because you did not use the -fgnu-runtime flag. In your
build, gcc would have generated calls to the Apple runtime which would
have been satisfied by ld linking against the Apple libobjc. So your were
linking both your libobjc and the Apple one. We need it to ignore the
Apple one completely.
The Swarm code in the cvs builds what should be a viable libobjc. So we
could use that to test simple examples. I'll try today.
Bill
Compile log from Swarm build failing in tools directory:
mv -f findImp.o .libs/findImp.lo
/Users/billn/Public/GNU/dst/bin/gcc -no-cpp-precomp -DHAVE_CONFIG_H -I.
-I../../../../tools -I.. -I.. -I../src -I../../../../src -I../libobjc
-I../../../../libobjc -I../../../../src/collections
-I../../../../src/defobj -I../../../../src/activity
-I../../../../src/objectbase -I../../../../src/random
-I../../../../src/simtools -I../../../../src/gui
-I../../../../src/simtoolsgui -I../../../../src/misc -I. -DDLL_EXPORT -g
-O2 -fgnu-runtime -fno-strict-aliasing -Wall -Wno-import -Wno-protocol
-Wno-long-long -c ../../../../tools/findImp.m -MT findImp.lo -MD -MP -MF
.deps/findImp.TPlo >/dev/null 2>&1
mv -f .libs/findImp.lo findImp.lo
/bin/sh ../libtool --mode=link /Users/billn/Public/GNU/dst/bin/gcc
-no-cpp-precomp -g -O2 -fgnu-runtime -fno-strict-aliasing -Wall
-Wno-import -Wno-protocol -Wno-long-long -o findImp -L../src
-L../libobjc findImp.lo -lswarm
/Users/billn/Public/GNU/dst/bin/gcc -no-cpp-precomp -g -O2 -fgnu-runtime
-fno-strict-aliasing -Wall -Wno-import -Wno-protocol -Wno-long-long -o
.libs/findImp findImp.o
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/libobjc
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/.libs -lswarm
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/space
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/analysis
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/simtoolsgui
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/simtools
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/random
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/tkobjc
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/tclobjc
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/objectbase
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/activity
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/defobj
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/collections
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/misc
-L/usr/lib -L/usr/local/lib -L/usr/X11R6/lib
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/space/.libs
-lspace
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/analysis/.libs
-lanalysis
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/simtoolsgui/.libs
-lsimtoolsgui
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/simtools/.libs
-lsimtools
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/random/.libs
-lrandom
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/tkobjc/.libs
-ltkobjc
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/tclobjc/.libs
-ltclobjc
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/objectbase/.libs
-lobjectbase
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/activity/.libs
-lactivity
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/defobj/.libs
-ldefobj
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/collections/.libs
-lcollections
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/src/misc/.libs
-lmisc
-L/Users/billn/Public/Swarm/swarmgo/macosx/swarmx/build/libobjc/.libs
-lobjc -lgcc -lBLT24 -ltk8.4 -ltcl8.4 -lXpm -lz -lX11 -lm -ldl
gcc: unrecognized option `-no-cpp-precomp'
/usr/bin/ld: warning multiple definitions of symbol _tclStubsPtr
/usr/local/lib/libtk8.4.dylib(tclStubLib.o) definition of _tclStubsPtr
/usr/local/lib/libtcl8.4.dylib(tclStubLib.o) definition of _tclStubsPtr
/usr/bin/ld: warning multiple definitions of symbol _tclIntStubsPtr
/usr/local/lib/libtk8.4.dylib(tclStubLib.o) definition of _tclIntStubsPtr
/usr/local/lib/libtcl8.4.dylib(tclStubLib.o) definition of _tclIntStubsPtr
/usr/bin/ld: warning multiple definitions of symbol _tclPlatStubsPtr
/usr/local/lib/libtk8.4.dylib(tclStubLib.o) definition of _tclPlatStubsPtr
/usr/local/lib/libtcl8.4.dylib(tclStubLib.o) definition of
_tclPlatStubsPtr
/usr/bin/ld: warning multiple definitions of symbol _tclIntPlatStubsPtr
/usr/local/lib/libtk8.4.dylib(tclStubLib.o) definition of
_tclIntPlatStubsPtr
/usr/local/lib/libtcl8.4.dylib(tclStubLib.o) definition of
_tclIntPlatStubsPtr
/usr/bin/ld: warning multiple definitions of symbol _Tcl_InitStubs
/usr/local/lib/libtk8.4.dylib(tclStubLib.o) definition of _Tcl_InitStubs
/usr/local/lib/libtcl8.4.dylib(tclStubLib.o) definition of _Tcl_InitStubs
/usr/bin/ld: Undefined symbols:
___objc_exec_class
_get_imp
_objc_lookup_class
and many many more!
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
- Re: [swarm-hackers] A radical suggestion,
Bill Northcott <=