v0.10.0 installation: unrecognized option '-Xarch_x86_64'

299 views
Skip to first unread message

dcunited001

unread,
Apr 27, 2012, 2:57:56 PM4/27/12
to capybara-webkit
So i'm running into this error where incorrect options are getting
passed to GCC when installing.

I recently installed lion from scratch and the new version of XCode
really messed me up. I tried to install gcc from source, which didn't
work, then I just resorted to using `brew install gcc` and that seemed
to fix all my problems for all other gems. However, I still have
problems with this one gem. I believe it may be a one off problem
with my environment, but i really would like to avoid reinstalling or
messing with GCC. Are there any args I can pass to prevent passing
this option or passing the correct option?

============================================================

Installing capybara-webkit (0.10.0) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
extension.

/Users/davidconner/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
extconf.rb
cd src/ && /usr/local/bin/qmake /Users/davidconner/.rvm/gems/
ruby-1.9.2-p290@market_art_ems/gems/capybara-webkit-0.10.0/src/
webkit_server.pro -spec /usr/local/Cellar/qt/4.8.0/mkspecs/macx-g++ -o
Makefile.webkit_server
cd src/ && make -f Makefile.webkit_server
g++ -c -pipe -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -
Wall -W -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -
DQT_CORE_LIB -DQT_SHARED -I/usr/local/Cellar/qt/4.8.0/mkspecs/macx-g++
-I. -I/usr/local/Cellar/qt/4.8.0/lib/QtCore.framework/Versions/4/
Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtCore.framework/Versions/4/
Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtNetwork.framework/Versions/
4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtNetwork.framework/
Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtGui.framework/
Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtGui.framework/
Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtWebKit.framework/
Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtWebKit.framework/
Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/include -I. -F/usr/
local/Cellar/qt/4.8.0/lib -o CurrentUrl.o CurrentUrl.cpp
g++: unrecognized option '-Xarch_x86_64'
cc1plus: error: unrecognized command line option "-arch"
make[1]: *** [CurrentUrl.o] Error 1
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2

make
cd src/ && make -f Makefile.webkit_server
g++ -c -pipe -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -
Wall -W -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -
DQT_CORE_LIB -DQT_SHARED -I/usr/local/Cellar/qt/4.8.0/mkspecs/macx-g++
-I. -I/usr/local/Cellar/qt/4.8.0/lib/QtCore.framework/Versions/4/
Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtCore.framework/Versions/4/
Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtNetwork.framework/Versions/
4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtNetwork.framework/
Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtGui.framework/
Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtGui.framework/
Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtWebKit.framework/
Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/lib/QtWebKit.framework/
Versions/4/Headers -I/usr/local/Cellar/qt/4.8.0/include -I. -F/usr/
local/Cellar/qt/4.8.0/lib -o CurrentUrl.o CurrentUrl.cpp
g++: unrecognized option '-Xarch_x86_64'
cc1plus: error: unrecognized command line option "-arch"
make[1]: *** [CurrentUrl.o] Error 1
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2


Gem files will remain installed in /Users/davidconner/.rvm/gems/
ruby-1.9.2-p290@market_art_ems/gems/capybara-webkit-0.10.0 for
inspection.
Results logged to /Users/davidconner/.rvm/gems/ruby-1.9.2-
p290@market_art_ems/gems/capybara-webkit-0.10.0/./gem_make.out
An error occured while installing capybara-webkit (0.10.0), and
Bundler cannot continue.
Make sure that `gem install capybara-webkit -v '0.10.0'` succeeds
before bundling.

dcunited001

unread,
Apr 27, 2012, 3:03:18 PM4/27/12
to capybara-webkit
The problem is that the GCC/G++ that is normally used to compile stuff
on Macs is actually just a wrapper.

And this wrapper has Mac-Only arguments like -Xarch_x86_64, which then
get converted into the correct args.

dcunited001

unread,
Apr 27, 2012, 3:09:18 PM4/27/12
to capybara-webkit
Looks like I'm getting it to compile. I think my problem was that I
have a mucked up installation from all the things I tried to get GCC
to work. I'm not sure what the g++ binary is from below, i think it's
from the GNU G++.

$ ls -all /usr/local/bin/ | grep g++
-rwxr-xr-x    4 username  admin   533536 Mar  8 18:20 g++
lrwxr-xr-x    1 username  admin       46 Mar  8 19:11 g++-4.2 -> ../
Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2

I backed up the g++ and then added a symlink so that /usr/local/bin/g+
+ => /usr/local/bin/g++-4.2
This resolved my problems, not sure if it might introduce others.

Felipe Elias Philipp

unread,
Feb 27, 2013, 11:02:42 AM2/27/13
to capybar...@googlegroups.com
I'm running into the same issue, here's my trace: http://pastie.org/6348348

I have installed gcc 4.7 and I'm not sure it recognizes the option -Xarch_x86_64. I'm not expert on this, but that seems to be a similar problem.

I don't know how to proceed now :( 
Reply all
Reply to author
Forward
0 new messages