Loading...
You are not logged-in Login/Register





  • Posts   Search Threads
  • Derek GastonMarch 6, 2009 1:02 PM PST   
    "Bad CPU type in executable" with XCode

    I recently purchased the Intel compilers for OSX and just today needed to do some debugging... for which I usually use XCode on OSX.  I don't actually code my application using XCode... I just load up the executable in a blank project for debugging purposes.

    But it appears this doesn't work (or I'm doing something wrong) with the Intel compilers.  Here is the output I get from GDB (which XCode launches):

    This GDB was configured as "i386-apple-darwin".tty /dev/ttys013
    Architecture of file "/Users/gastdr/projects/bison/bison-dbg" does not match user selected architecture.
    Architecture of file "/Users/gastdr/projects/bison/bison-dbg" does not match user selected architecture.
    warning: A handler for the OS ABI "Darwin" is not built into this configuration
    of GDB.  Attempting to continue with the default i386:x86-64 settings.
    
    sharedlibrary apply-load-rules all
    (gdb) run
    Running…
    [Switching to process 4190 local thread 0xf03]
    arch: posix_spawnp: /Users/gastdr/projects/bison/bison-dbg: Bad CPU type in executable

    Anyone have any ideas?

    This is using version 11.0 20090131 and XCode version 3.1.2 on OSX 10.5.6

    Thanks,
    Derek

    Qale (Intel)March 9, 2009 9:41 AM PDT
    Rate
     
    Re: "Bad CPU type in executable" with XCode


    Could you run:  file <name of exe or lib for debugging>

    to see what architecture they were built for?


    Derek GastonMarch 10, 2009 3:27 PM PDT
    Rate
     
    Re: "Bad CPU type in executable" with XCode

    Quoting - Qale (Intel)

    Could you run:  file <name of exe or lib for debugging>

    to see what architecture they were built for?


    bison-opt: Mach-O 64-bit executable x86_64

    Thanks!


    Qale (Intel)March 10, 2009 3:39 PM PDT
    Rate
     
    Re: "Bad CPU type in executable" with XCode


    Did you set the "Architecture" properties in the target -> info -> build tab  to x86_64?

    Qale (Intel)March 10, 2009 5:23 PM PDT
    Rate
     
    Re: "Bad CPU type in executable" with XCode

    Quoting - Derek Gaston


    bison-opt: Mach-O 64-bit executable x86_64

    Thanks!

    Could you give me the steps to loading the executable into Xcode and get the result that you saw?

    Derek GastonMarch 19, 2009 4:30 PM PDT
    Rate
     
    Re: "Bad CPU type in executable" with XCode

    Quoting - Qale (Intel)

    Did you set the "Architecture" properties in the target -> info -> build tab  to x86_64?


    Ok - I got it.  I had to set the debugger to x86_64 in the drop down box in the top left of the Debugger or Debugger Console windows.

    THEN... I had to set the environment DYLD_LIBRARY_PATH environment variable (in the "Arguments" tab of the "Get Info" window for the executable) to include the stuff you usually get from sourcing iccvars.sh .  Is there a standard way to do this?  Is there some Framework or something I need to add to my XCode project so that it picks up these paths automatically?

    Thanks,
    Derek


    Qale (Intel)March 19, 2009 4:38 PM PDT
    Rate
     
    Re: "Bad CPU type in executable" with XCode


    >>>> I had to set the environment DYLD_LIBRARY_PATH environment variable (in the "Arguments" tab of the "Get Info" window for the executable) to include the stuff you usually get from sourcing iccvars.sh . Is there a standard way to do this? Is there some Framework or something I need to add to my XCode project so that it picks up these paths automatically?


    Unfortunately, no.  Intel compiler runtime libraries currently are not built as frameworks.   You need to set the path for DYLD_LIBRARY_PATH.

Forum jump:  

Intel Software Network Forums Statistics

16,371 users have contributed to 46,345 threads and 163,979 posts to date.

In the past 24 hours, we have 17 new thread(s) 90 new posts(s), and 65 new user(s).

In the past 3 days, the most popular thread for everyone has been Formula for the intersection of straight lines The most posts were made to Take a look at John Burkhard&# The post with the most views is \"-check none\" generates error

Please welcome our newest member theoriginalgunn


For more complete information about compiler optimizations, see our Optimization Notice.