Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#30976 closed defect (fixed)

pypy fails to build without gcc-4.0 (cc1: error: unrecognized command line option "-arch" )

Reported by: jwm.columbia@… Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.0.1
Keywords: Cc:
Port: pypy

Description

When trying to build pypy on a system where it has not previously been installed (i.e. using python27, or python27-apple), the build process fails.

It appears the problem is caused by the CC flag "-arch x86_64", which I believe is specific to GCC on Darwin, and is not present in the compiler used (/opt/local/bin/gcc-mp-4.5).

Output of the offending build step is below. main.log is attached.

Thanks for your help!

--

[version:WARNING] Errors getting Mercurial information: Not running from a Mercurial repository!
[platform:msg] Setting platform to 'host' cc=/opt/local/bin/gcc-mp-4.5
[translation:info] Translating target as defined by targetpypystandalone
[platform:execute] /opt/local/bin/gcc-mp-4.5 -c -arch x86_64 -O3 -fomit-frame-pointer -mdynamic-no-pic /var/folders/9q/yg5x8qn176s3gcn095qkkn_00000gn/T/usession-unknown-4/gcctest.c -o /var/folders/9q/yg5x8qn176s3gcn095qkkn_00000gn/T/usession-unknown-4/gcctest.o
[platform:Error] cc1: error: unrecognized command line option "-arch"
Traceback (most recent call last):
  File "translate.py", line 324, in <module>
    main()
  File "translate.py", line 210, in main
    targetspec_dic, translateconfig, config, args = parse_options_and_load_target()
  File "translate.py", line 178, in parse_options_and_load_target
    targetspec_dic['handle_config'](config, translateconfig)
  File "targetpypystandalone.py", line 123, in handle_config
    from pypy.objspace.std import multimethod
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/objspace/std/__init__.py", line 1, in <module>
    from pypy.objspace.std.objspace import StdObjSpace
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/objspace/std/objspace.py", line 7, in <module>
    from pypy.objspace.std import (builtinshortcut, stdtypedef, frame, model,
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/objspace/std/builtinshortcut.py", line 3, in <module>
    from pypy.objspace.descroperation import DescrOperation
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/objspace/descroperation.py", line 8, in <module>
    from pypy.module.__builtin__.interp_classobj import W_InstanceObject
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/module/__builtin__/__init__.py", line 4, in <module>
    import pypy.module.imp.importing
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/module/imp/importing.py", line 14, in <module>
    from pypy.rlib import streamio, jit
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rlib/streamio.py", line 43, in <module>
    from pypy.rlib import rposix
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rlib/rposix.py", line 2, in <module>
    from pypy.rpython.lltypesystem.rffi import CConstant, CExternVariable, INT
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/lltypesystem/rffi.py", line 459, in <module>
    NUMBER_TYPES = setup()
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/lltypesystem/rffi.py", line 448, in setup
    names = populate_inttypes()
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/lltypesystem/rffi.py", line 442, in populate_inttypes
    platform.populate_inttypes(populatelist)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/tool/rfficache.py", line 82, in populate_inttypes
    sizes = sizeof_c_types(names_c, **kwds)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/tool/rfficache.py", line 44, in sizeof_c_types
    answer = ask_gcc(question, **kwds)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/tool/rfficache.py", line 34, in ask_gcc
    return build_executable_cache([c_file], eci)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/tool/gcc_cache.py", line 27, in build_executable_cache
    result = platform.execute(platform.compile(c_files, eci))
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/translator/platform/__init__.py", line 51, in compile
    ofiles = self._compile_o_files(cfiles, eci, standalone)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/translator/platform/__init__.py", line 60, in _compile_o_files
    ofiles.append(self._compile_c_file(self.cc, cfile, compile_args))
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/translator/platform/posix.py", line 38, in _compile_c_file
    cwd=str(cfile.dirpath()))
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/translator/platform/__init__.py", line 118, in _execute_c_compiler
    self._handle_error(returncode, stdout, stderr, outname)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/translator/platform/__init__.py", line 130, in _handle_error
    raise CompilationError(stdout, stderr)
pypy.translator.platform.CompilationError: CompilationError(err="""
	cc1: error: unrecognized command line option "-arch"
	""")

Attachments (1)

main.log (38.6 KB) - added by jwm.columbia@… 13 years ago.
main.log

Download all attachments as: .zip

Change History (8)

Changed 13 years ago by jwm.columbia@…

Attachment: main.log added

main.log

comment:1 Changed 13 years ago by jwm.columbia@…

Cc: jwm.columbia@… added

Cc Me!

comment:2 Changed 13 years ago by mf2k (Frank Schima)

Cc: jwm.columbia@… removed
Owner: changed from macports-tickets@… to jmr@…

comment:3 Changed 13 years ago by jmroot (Joshua Root)

Summary: pypy fails to build (cc1: error: unrecognized command line option "-arch" )pypy fails to build without gcc-4.0 (cc1: error: unrecognized command line option "-arch" )

comment:4 Changed 13 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

Should be fixed by r83123.

comment:5 in reply to:  4 Changed 13 years ago by jwm.columbia@…

Thanks for the very quick fix. Unfortunately, the build process now returns a new error on my system. It appears the '-m64' flag somehow gets parsed as '- m 6 4'.

I'm not sure whether this should be considered the same or a different issue, so I will paste the error log here to start with:

cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/translator/goal" && arch -x86_64 /opt/local/bin/python2.7 translate.py --batch --cc=/opt/local/bin/gcc-mp-4.5 --opt=jit --make-jobs=8 --cflags='-m64 -I/opt/local/include -L/opt/local/lib' targetpypystandalone.py
[version:WARNING] Errors getting Mercurial information: Not running from a Mercurial repository!
[platform:msg] Setting platform to 'host' cc=/opt/local/bin/gcc-mp-4.5
[translation:info] Translating target as defined by targetpypystandalone
[platform:execute] /opt/local/bin/gcc-mp-4.5 -c -m64 -O3 -fomit-frame-pointer -mdynamic-no-pic /var/folders/9q/yg5x8qn176s3gcn095qkkn_00000gn/T/usession-unknown-8/gcctest.c -o /var/folders/9q/yg5x8qn176s3gcn095qkkn_00000gn/T/usession-unknown-8/gcctest.o
[platform:execute] /opt/local/bin/gcc-mp-4.5 /var/folders/9q/yg5x8qn176s3gcn095qkkn_00000gn/T/usession-unknown-8/gcctest.o - m 6 4 -o /var/folders/9q/yg5x8qn176s3gcn095qkkn_00000gn/T/usession-unknown-8/gcctest
[platform:Error] gcc-mp-4.5: m: No such file or directory
[platform:Error] gcc-mp-4.5: 6: No such file or directory
[platform:Error] gcc-mp-4.5: 4: No such file or directory
[platform:Error] gcc-mp-4.5: -E or -x required when input is from standard input
Traceback (most recent call last):
  File "translate.py", line 324, in <module>
    main()
  File "translate.py", line 210, in main
    targetspec_dic, translateconfig, config, args = parse_options_and_load_target()
  File "translate.py", line 178, in parse_options_and_load_target
    targetspec_dic['handle_config'](config, translateconfig)
  File "targetpypystandalone.py", line 123, in handle_config
    from pypy.objspace.std import multimethod
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/objspace/std/__init__.py", line 1, in <module>
    from pypy.objspace.std.objspace import StdObjSpace
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/objspace/std/objspace.py", line 7, in <module>
    from pypy.objspace.std import (builtinshortcut, stdtypedef, frame, model,
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/objspace/std/builtinshortcut.py", line 3, in <module>
    from pypy.objspace.descroperation import DescrOperation
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/objspace/descroperation.py", line 8, in <module>
    from pypy.module.__builtin__.interp_classobj import W_InstanceObject
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/module/__builtin__/__init__.py", line 4, in <module>
    import pypy.module.imp.importing
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/module/imp/importing.py", line 14, in <module>
    from pypy.rlib import streamio, jit
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rlib/streamio.py", line 43, in <module>
    from pypy.rlib import rposix
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rlib/rposix.py", line 2, in <module>
    from pypy.rpython.lltypesystem.rffi import CConstant, CExternVariable, INT
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/lltypesystem/rffi.py", line 459, in <module>
    NUMBER_TYPES = setup()
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/lltypesystem/rffi.py", line 448, in setup
    names = populate_inttypes()
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/lltypesystem/rffi.py", line 442, in populate_inttypes
    platform.populate_inttypes(populatelist)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/tool/rfficache.py", line 82, in populate_inttypes
    sizes = sizeof_c_types(names_c, **kwds)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/tool/rfficache.py", line 44, in sizeof_c_types
    answer = ask_gcc(question, **kwds)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/rpython/tool/rfficache.py", line 34, in ask_gcc
    return build_executable_cache([c_file], eci)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/tool/gcc_cache.py", line 27, in build_executable_cache
    result = platform.execute(platform.compile(c_files, eci))
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/translator/platform/__init__.py", line 52, in compile
    return self._finish_linking(ofiles, eci, outputfilename, standalone)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/translator/platform/__init__.py", line 207, in _finish_linking
    return self._link(cc_link, ofiles, largs, standalone, exe_name)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/translator/platform/posix.py", line 66, in _link
    cwd=str(exe_name.dirpath()))
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/translator/platform/__init__.py", line 118, in _execute_c_compiler
    self._handle_error(returncode, stdout, stderr, outname)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_pypy/pypy/work/pypy-pypy-release-1.6/pypy/translator/platform/__init__.py", line 130, in _handle_error
    raise CompilationError(stdout, stderr)
pypy.translator.platform.CompilationError: CompilationError(err="""
	gcc-mp-4.5: m: No such file or directory
	gcc-mp-4.5: 6: No such file or directory
	gcc-mp-4.5: 4: No such file or directory
	gcc-mp-4.5: -E or -x required when input is from standard input
	""")

Replying to jmr@…:

Should be fixed by r83123.

comment:6 Changed 13 years ago by jmroot (Joshua Root)

When is a tuple not a tuple? When it's a string because you forgot the trailing comma. r83153

comment:7 Changed 13 years ago by jwm.columbia@…

Those can indeed be hard to catch. Build works for me now -- many thanks!

Note: See TracTickets for help on using tickets.