This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [HEAD] Teach testsuite/lib/objc.exp about Darwin frameworks


> > I will commit this as obvious.  On Mac OS X, some ObjC-ish symbols
> > (most notably NSConstantString stuff) live in the Foundation framework
> > rather than libobjc.
> > 
> > As a result, the objc/execute/string[1-4].m test cases will now pass
> > on Geoff's native tester.  I've also tried this on i686-pc-linux-gnu to 
> > make sure it
> > does no harm.
> > 
> 
> [...]
> 
> No seriously...  Darwin isn't Mac OS X and therefor not all Darwin 
> targets will have Foundation to link against.  When these tests are run 
> for the GNU runtime on Darwin these should start failing there.  (I'm 
> sure you are aware of the efforts to reenable the GNU runtime for Darwin 
> targets by default in a fashion that will not conflict with the 
> preinstalled Apple runtime.)
> 
> It seems that the Apple runtime requires the availability of a class 
> named NSConstantString when string literals are used.  (The GNU runtime 
> uses -fconstant-string-class or falls back to NXConstantString which is 
> part of the runtimes libobjc.)
> 
> Could you please make the linking against Foundation conditional for the 
> Apple runtime?

Even this wouldn't be entirely satisfactory, as there are people trying to
compile and use gnustep-base with the Apple runtime, in which cases you'd
need the Apple runtime + linking against gnustep-base.

I suppose the solution would be to #include a trivial implementation of
NSConstantString in the tests when compiled with the Apple runtime.  That
way you don't depend on anything external and it just works, and you can
test with multiple library combinations.

If you want to do this (I don't have an Apple runtime at hand), it would
be good - should be quite easy (and little bit of fun) to write a trivial
NSConstantString implementation.

Else, I don't think we should be too picky and prevent improvements - I
think Zem's change is an improvement over what we have, so it's a good
change -- I'd just suggest adding comments to it about how to make it
better, so that if there is someone interested in that stuff (eg running
the tests on Darwin without Foundation) in the future, they'll know from
the comments how/what to do to extend the tests to support that.


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