• 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: missing Intel binary [SOLVED] (was: how can I back down to Xcode 2.2.1, gcc 4.0.0?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: missing Intel binary [SOLVED] (was: how can I back down to Xcode 2.2.1, gcc 4.0.0?)


  • Subject: Re: missing Intel binary [SOLVED] (was: how can I back down to Xcode 2.2.1, gcc 4.0.0?)
  • From: Steve Christensen <email@hidden>
  • Date: Mon, 5 Jun 2006 15:51:45 -0700

OK, things are finally building, though it's been an interesting trip to get it to do so.

Niels, to answer your question, the projects (and targets) are all building both PPC and i386. This is reflected in both the build settings as well as seeing compile and link phases for both architectures in the build log.

Relevant build settings are as follows:

DEAD_CODE_STRIPPING = YES;
DEPLOYMENT_POSTPROCESSING = YES;
EXPORTED_SYMBOLS_FILE = ExportedSymbols.exp; (exports just main--being redundant)
GCC_DEBUGGING_SYMBOLS = full;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
ONLY_LINK_ESSENTIAL_SYMBOLS = NO;
SEPARATE_STRIP = NO;
STRIP_INSTALLED_PRODUCT = YES;
STRIP_STYLE = "non-global";


I'm using the 10.4u SDK for both architectures, with PPC built with gcc 3.3 /10.3 deployment target, and i386 built with gcc 4.0/10.4 deployment target.

When I ran nm to look at the symbols for each architecture, I noticed that there was no main() for i386, which is probably why relatively nothing was included in that image when lipo put everything together. I changed the declaration of main to:

  int main(...) __attribute__((visibility("default")));

then rebuilt everything and finally the i386 build included code and actually ran. Seems strange that I had to add that, but if it works...

I suspect that the reason the PPC build never had a problem is that the GCC_INLINES_ARE_PRIVATE_EXTERN and GCC_SYMBOLS_PRIVATE_EXTERN settings didn't translate into gcc 3.3 switches; the i386 compile adds -fvisibility=hidden and -fvisibility-inlines-hidden.


On Jun 5, 2006, at 10:10 AM, Niels Meersschaert wrote:

Check your release build configuration for your project and any dependent projects. I had noticed that it reverted my 386 & PPC architecture in my release build to just PPC after the update. Since you're seeing limited 386 code, I expect a dependency isn't running 386 as expected. You can confirm that also by looking at the build process. You should see every file run twice once for PPC & once for 386. If any files are missing, check your config in the project where those files live (for dependencies). You might also want to check the new clean dependencies box when you clean the project in case that could be contributing to your issues.

On Jun 3, 2006, at 9:31 PM, Steve Christensen wrote:

On Jun 3, 2006, at 5:14 PM, Shawn Erickson wrote:

On Jun 3, 2006, at 4:21 PM, Steve Christensen wrote:

I have been having so many problems since upgrading to Xcode 2.3 and gcc 4.0.1 that I just want to go back to Xcode 2.2.1 and gcc 4.0.0. Universal projects that previously built and ran on both architectures with the older tools only run on PPC. The i386 image in the UB binary is about 4K in size and apparently doesn't contain anything resembling code.

Also, no hints have been forthcoming from the Xcode mailing list so I don't know what to do to try to fix things. All I know is that I have to get software finished and out the door.

In trying to back down to Xcode 2.2.1, etc., I have run the Xcode 2.3 uninstall script, restarted, then run the Xcode 2.2.1 installer, restarted. I rebuild my projects and I end up in the same place as with 2.3. I've even tried running the Xcode 2.2.1 gcc installer standalone to see if that helps but nothing changes. I'm really hoping that I don't have to reinstall the OS so all the other stuff gets wiped and then get back to a known state.

My move from CodeWarrior to Xcode has been an entirely frustrating process at every step of the way. Every little setting has to be exactly perfect or nothing works as expected. Plus, doing what should be a simple tool upgrade throws everything up in the air again, just when I thought I had everything at least somewhat settled.

I don't think I'm doing anything fancy. I just want a set of Universal, dead-code stripped, symbol stripped executables. I don't think that's really what you'd call off-roading. Can somebody, perhaps even at Apple, help me out?

I think we will need more information. I have hit no issues switching several projects (some rather large) from Xcode 2.2.1 to 2.3 and on several different developer systems (including switching some over to DWARF).

I didn't think I had either since, after installing Xcode 2.3 and doing a full, clean rebuild, everything was working fine on my PPC development machine. It was only when I copied the binaries over to my Intel MacBook that I found they wouldn't load. Running "nm - a -arch all ..." would dump out all the global symbols for the PPC part and "nm: no name list" for the i386 part. I also ran nm on the pre-stripped, pre-combined per-architecture objects and they both showed a ton of symbols for methods, data, etc.


Further examination showed that the Intel image within the Universal binary was typically 4100 bytes, and "lipo - detailed_info ..." prints out the following:

fat_magic 0xcafebabe
nfat_arch 2
architecture i386
    cputype CPU_TYPE_I386
    cpusubtype CPU_SUBTYPE_I386_ALL
    offset 4096
    size 4100
    align 2^12 (4096)
architecture ppc
    cputype CPU_TYPE_POWERPC
    cpusubtype CPU_SUBTYPE_POWERPC_ALL
    offset 16384
    size 146628
    align 2^14 (16384)

Are you sure that something in your code didn't change around the same time as the switch to 2.3? ...maybe a wrongly placed #ifdef that is engaged when building for Intel?

No. The code has been relatively unchanged for awhile now, and in any case, there are almost no architecture-specific bits of code that could get turned on/off conditionally.


steve

_______________________________________________ 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
References: 
 >how can I back down to Xcode 2.2.1, gcc 4.0.0? (From: Steve Christensen <email@hidden>)
 >Re: how can I back down to Xcode 2.2.1, gcc 4.0.0? (From: Shawn Erickson <email@hidden>)
 >Re: how can I back down to Xcode 2.2.1, gcc 4.0.0? (From: Steve Christensen <email@hidden>)
 >Re: how can I back down to Xcode 2.2.1, gcc 4.0.0? (From: Niels Meersschaert <email@hidden>)

  • Prev by Date: Re: no rule to process file
  • Next by Date: Re: Cross-development problem with curl
  • Previous by thread: Re: how can I back down to Xcode 2.2.1, gcc 4.0.0?
  • Next by thread: 2.3 dedicated network build = pbnone
  • Index(es):
    • Date
    • Thread