[MacRuby] #579: i386 compilation doesn't work
#579: i386 compilation doesn't work --------------------------------+------------------------------------------- Reporter: carlo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: --------------------------------+------------------------------------------- This bug report references MR0.5b2 as well as its standard MacRuby application template. Trying to build self-contained compiled i386 apps (embedded MR) works fine, but the apps won't run. i86_64 builds are showing no problems and work as expected, but i386 versions exit right away, logging the following error message: {{{ core:in `each': no such file to load -- bootstrap (LoadError) from [project path]/build/Release/MyApp.app/Contents/Resources/rb_main.rb:in `<main>' }}} "bootstrap" being whatever *.rbo file is to be loaded first. $LOAD_PATH looks okay, i.e. it's identical when running i386 or x86_64 code. The behaviour is the same on both single-arch builds and 32/64bit "combo" builds. Not compiling the the application yields an app which works a-okay on both architectures. Tried on a 2006 2GHz Core Duo MacBook as well as a late 2009 C2D iMac, both running XCode 3.2.1 on 10.6.2. (Both being *my* machines makes it possible I've somehow managed to misconfigure them in the same way, of course.) -- Ticket URL: <http://www.macruby.org/trac/ticket/579> MacRuby <http://macruby.org/>
#579: i386 compilation doesn't work --------------------------------+------------------------------------------- Reporter: carlo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by carlo@…): My bad, forgot to include more information about my settings. ARCHS: i386 x86_64 SDKROOT: macosx10.5 ONLY_ACTIVE_ARCH: no VALID_ARCHS: i386 x86_64 Rest of the settings is standard MR Xcode project settings. -- Ticket URL: <http://www.macruby.org/trac/ticket/579#comment:1> MacRuby <http://macruby.org/>
#579: i386 compilation doesn't work --------------------------------+------------------------------------------- Reporter: carlo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by carlo@…): Still doesn't work in 0.5 (final). Any ideas what else I could check? -- Ticket URL: <http://www.macruby.org/trac/ticket/579#comment:2> MacRuby <http://macruby.org/>
#579: i386 compilation doesn't work --------------------------------+------------------------------------------- Reporter: carlo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by lsansonetti@…): Looks like the AOT compiler is broken for 32-bit targets. {{{ $ cd /tmp $ echo 'p 42' > t.rb $ macrubyc --arch i386 --arch x86_64 -C t.rb -o t.rbo $ file t.rbo t.rbo: Mach-O universal binary with 2 architectures t.rbo (for architecture i386): Mach-O bundle i386 t.rbo (for architecture x86_64): Mach-O 64-bit bundle x86_64 $ macruby -r ./t.rbo -e '' 42 $ arch -i386 macruby -r ./t.rbo -e '' no such file to load -- ./t.rbo (LoadError) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/579#comment:3> MacRuby <http://macruby.org/>
#579: i386 compilation doesn't work --------------------------------+------------------------------------------- Reporter: carlo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by martinlagardette@…): Hi Carlo! This should be fixed with r3456. Could you please check? Thanks a lot! -- Ticket URL: <http://www.macruby.org/trac/ticket/579#comment:5> MacRuby <http://macruby.org/>
#579: i386 compilation doesn't work --------------------------------+------------------------------------------- Reporter: carlo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by carlo@…): Thanks! I'll take a look as soon as I have a bit more free time (lots of client work at the moment)… I'll report back. -- Ticket URL: <http://www.macruby.org/trac/ticket/579#comment:6> MacRuby <http://macruby.org/>
#579: i386 compilation doesn't work --------------------------------+------------------------------------------- Reporter: carlo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by carlo@…): I've downloaded the latest nightly (macruby_nightly-2010-02-11-1236.pkg), compile my app against it. It runs fine on 64bit, but 32bit results in this: {{{ *buildpath*/Ephemera.app/Contents/Resources/rb_main.rb:34:in `block': dlopen(*buildpath*/Ephemera.app/Contents/Resources/bootstrap.rbo, 9): no suitable image found. Did find: *buildpath*/Ephemera.app/Contents/Resources/bootstrap.rbo: mach-o, but wrong architecture - *buildpath*/Ephemera.app/Contents/Resources/bootstrap.rbo (LoadError) *buildpath*/Ephemera.app/Contents/Resources/rb_main.rb:9:in `<main>' }}} I figured said nightly should contain the proposed fix — am I mistaken? -- Ticket URL: <http://www.macruby.org/trac/ticket/579#comment:7> MacRuby <http://macruby.org/>
#579: i386 compilation doesn't work --------------------------------+------------------------------------------- Reporter: carlo@… | Owner: martinlagardette@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Changes (by lsansonetti@…): * owner: lsansonetti@… => martinlagardette@… * milestone: MacRuby 0.5 => MacRuby 0.6 Comment: I believe this is because macruby_deploy spawns macrubyc processes that only build for the current architecture. {{{ if !File.exist?(obj) or File.mtime(source) > File.mtime(obj) die "Can't compile \"#{source}\"" unless system("macrubyc -C \"#{source}\" -o \"#{obj}\"") FileUtils.rm_f(source) end }}} macruby_deploy should be smarter and retrieve the architecture from the Xcode environment variables and appropriately pass the right flags to macrubyc. Thibault, do you want to look at this? -- Ticket URL: <http://www.macruby.org/trac/ticket/579#comment:8> MacRuby <http://macruby.org/>
#579: i386 compilation doesn't work --------------------------------+------------------------------------------- Reporter: carlo@… | Owner: martinlagardette@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: | --------------------------------+------------------------------------------- Changes (by martinlagardette@…): * status: new => closed * resolution: => fixed Comment: Fixed with r3527.[[BR]] As discussed with Carlo, the script uses the Xcode ARCHS env var, so it should properly be set to i386 and x86_64 in the targets build info. Adding PPC will work but have not effect, since it will be intersected with rubyc VALID_ARCHS, containing only i386 and x86_64 -- Ticket URL: <http://www.macruby.org/trac/ticket/579#comment:9> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby