• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: maformed library error with NEXT_ROOT set?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: maformed library error with NEXT_ROOT set?


  • Subject: Re: maformed library error with NEXT_ROOT set?
  • From: Chris Espinosa <email@hidden>
  • Date: Thu, 20 Nov 2003 15:22:16 -0800

On Nov 20, 2003, at 2:12 PM, Mike Pinkerton wrote:

To get mozilla to build, we have to set

CFLAGS="-I/Developer/SDKs/MacOSX10.1.5.sdk/usr/include"
LDFLAGS="-L/Developer/SDKs/MacOSX10.1.5.sdk/usr/lib"
NEXT_ROOT="/Developer/SDKs/MacOSX10.1.5.sdk"
MACOSX_DEPLOYMENT_TARGET=10.1

manually so our makefiles can find the correct sdks (and not pick up
nspr/nss that's in panther already).

however, when we then go to build any xcode project in the tree from the
command line, we get the following error if NEXT_ROOT is set:


/usr/bin/xcodebuild -project DefaultPlugin.xcode -target "Default
Plugin" -buildstyle Development

dyld: /usr/bin/xcodebuild malformed library:
/Developer/SDKs/MacOSX10.2.7.sdk/System/Library/Frameworks/ CoreServices.framework/Frameworks/CarbonCore.framework/CarbonCore
(not a Mach-O library file, bad filetype value)


The project has a native target and is targeting the 10.1 SDK. The same
thing happens with the pbproj version of the same project. The project
builds fine from the UI.

Is this a known issue? Are we doing something incorrectly?

Yes. NEXT_ROOT should only be set around the invocation of the linker (either ld or cc). It globally changes the behavior of dyld, so that even new tool execution tries to use the libraries in that root. (It's a remnant of an older style of OS build bootstrapping, and is here being shanghaied for the SDK feature).


When you leave NEXT_ROOT set for execution of another process (e.g. xcodebuild itself) it tries to load the stub library from the SDK, which is (correctly) failing.

What you may want to do is to redefine the CC and LD commands to execute scripts that set NEXT_ROOT, execute the compiler or linker, then reset NEXT_ROOT.

Chris
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.

References: 
 >maformed library error with NEXT_ROOT set? (From: "Mike Pinkerton" <email@hidden>)

  • Prev by Date: Re: XCode, Java and Main
  • Next by Date: Re: zero-link vs library
  • Previous by thread: maformed library error with NEXT_ROOT set?
  • Next by thread: Groups, shell scripts, yacc
  • Index(es):
    • Date
    • Thread