Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Xcode 2.0 balks at linking dynamic libraries and frameworks.



I have an Audio Unit project which uses a BSD dynamic library and a Cocoa framework to provide common services to a collection of plug-ins.

Up to now this has worked fine. Yesterday I installed Xcode 2.0, and now it refuses to link targets of either of these types.

+ I tried with the existing dynamic library and framework, in a project
imported from XCode 1.5. I also tried a dummy brand new dynamic library
target created in XCode 2.0. This produced the same result, suggesting
that it's not down to a failure to update target settings.


+ The diagnostic is always:

ld: /Users/ian/FD Synthesiser/build/FD Synthesiser.build/FDS Library.build/Objects-normal/ppc/plugins.o has local relocation entries in non-writable section (__TEXT,__text)

  where "plugins.o" is always the first module in the link list.

+ I get the same result whether I build with GCC 3.3 or GCC 4.0

+ A trivial library containing one module, and one function, such as:

    int snafu (void) { return (42); }

will link without problems. I suspect the problem is the presence of
any external reference in the module - so adding "#import <Carbon/ Carbon.h>
to the above module is enough to trigger the problem.



I'm about to try going back to XCode 1.5, so I' afraid I won't be able to try any experiments to narrow this down, but if anyone has a definitive fix I'd be pleased to hear it.


------------

Later:-

It appears that supplying the linker flag "-read_only_relocs suppress" is a workaround for this problem. But I still don't know whether this is just a feature of all dynamic libraries that someone has decided should now be an error condition, or whether the compiler has started generating different code.

This may or may no be related, but it also seems that XCode will always pass -mdynamic_no_pic to the compiler, even if your target inspector's "Build" pane shows that you've asked it not to.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ian Kemmish 18 Durham Close, Biggleswade, Beds SG18 8HZ
email@hidden Tel: +44 1767 601361 Mob: +44 7952 854387
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.