• 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
thin linking: "file is not of required architecture"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

thin linking: "file is not of required architecture"


  • Subject: thin linking: "file is not of required architecture"
  • From: Philip Hölzenspies <email@hidden>
  • Date: Thu, 10 Apr 2008 11:03:07 +0100

Dear all,

Hopefully, this is the right forum for this question and - equally hopefully - I didn't miss-google the archives. I have found a lot of messages regarding the linker problem "ld: warning in <foo>.so, file is not of required architecture." For package X or source Y, these problems are solved by removing this or recompiling that. I would like to understand what really is going on.

I'm using Leopard 10.5.2, with ld64-77 on a MacBook from the first Santa Rosa generation (2.2 GHz Intel Core 2 Duo, i.e. i386). From what I've understood, lipo is the tool to make universal binaries with, etc. Here is the problem I'm running into (you'll not know these libraries, but I believe that to be besides the point):

$ ld -r -o linked.o libMyListMod.so libMyListTree.so
ld: warning -arch not specified
ld: warning in libMyListMod.so, file is not of required architecture
ld: warning in libMyListTree.so, file is not of required architecture

From the ld manpage:

The linker accepts universal (multiple-architecture) input files, but always creates a "thin" (single-architecture), standard Mach-O output file. The architecture for the output file is specified using the - arch option. If this option is not used, ld attempts to determine the output architecture by examining the object files in command line order. The first "thin" architecture determines that of the output file. If no input object file is a "thin" file, the native 32-bit architecture for the host is used.

Adding a -arch option should thus not make a difference:

$ ld -arch i386 -r -o linked.o libMyListMod.so libMyListTree.so
ld: warning in libMyListMod.so, file is not of required architecture
ld: warning in libMyListTree.so, file is not of required architecture

Ah, so these shared object files must be of the wrong architecture:

$ lipo -detailed_info libMyListMod.so libMyListTree.so
input file libMyListMod.so is not a fat file
input file libMyListTree.so is not a fat file
Non-fat file: libMyListMod.so is architecture: i386
Non-fat file: libMyListTree.so is architecture: i386

Can anybody explain to me what I am missing?

Regards,
Philip
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: thin linking: "file is not of required architecture"
      • From: Peter O'Gorman <email@hidden>
    • Re: thin linking: "file is not of required architecture"
      • From: Chris Espinosa <email@hidden>
    • Re: thin linking: "file is not of required architecture"
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Link-Error XCode 3.0: -init can only be used with -dynamiclib
  • Next by Date: Re: thin linking: "file is not of required architecture"
  • Previous by thread: Re: Link-Error XCode 3.0: -init can only be used with -dynamiclib
  • Next by thread: Re: thin linking: "file is not of required architecture"
  • Index(es):
    • Date
    • Thread