Opened 5 years ago

Closed 4 years ago

#59191 closed defect (fixed)

pypy: Undefined symbols: "_strnlen"

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: danchr (Dan Villiom Podlaski Christiansen)
Priority: Normal Milestone:
Component: ports Version: 2.6.1
Keywords: tiger leopard snowleopard Cc: kencu (Ken)
Port: pypy

Description

pypy doesn't build on Snow Leopard because:

	Undefined symbols for architecture x86_64:
	  "_strnlen", referenced from:
	      _opened_profile in vmprof_common.o
	      _vmprof_register_virtual_function in vmprof_unix.o
	ld: symbol(s) not found for architecture x86_64
	clang: error: linker command failed with exit code 1 (use -v to see invocation)

The legacysupport portgroup provides an implementation of strnlen for older systems. Maybe including that portgroup would help here?

Change History (7)

comment:1 in reply to:  description Changed 5 years ago by danchr (Dan Villiom Podlaski Christiansen)

Replying to ryandesign:

The legacysupport portgroup provides an implementation of strnlen for older systems. Maybe including that portgroup would help here?

Presumably it would, although I seriously doubt anyone is making any active effort to make sure that PyPy works on Snow Leopard.

comment:2 Changed 5 years ago by kencu (Ken)

I'll look at this.

comment:3 Changed 5 years ago by kencu (Ken)

Cc: kencu added

comment:4 Changed 5 years ago by kencu (Ken)

adding legacysupport

+PortGroup           legacysupport 1.0

+# strnlen
+legacysupport.newest_darwin_requires_legacy 10

does get past the stnlen error, but doesn't fix the build, as soon after, we see this:

Executing:  cd "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/pypy/goal" && arch -x86_64 /opt/local/lib/pypy-bootstrap/bin/pypy ../../rpython/bin/rpython --batch --verbose --cc=/opt/local/bin/clang-mp-9.0 --opt=jit --make-jobs=4 targetpypystandalone 
[translation:info] 2.7.10 (3260adbeba4a, Apr 19 2016, 13:10:19)
[PyPy 5.1.0 with GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]
[platform:msg] Set platform with 'host' cc=/opt/local/bin/clang-mp-9.0, using cc='/opt/local/bin/clang-mp-9.0', version='Unknown'
[translation:info] Translating target as defined by targetpypystandalone
[platform:Error] Undefined symbols for architecture x86_64:
[platform:Error]   "_clock_gettime", referenced from:
[platform:Error]       _RPyGilAcquireSlowPath in thread.o
[platform:Error] ld: symbol(s) not found for architecture x86_64
[platform:Error] clang: error: linker command failed with exit code 1 (use -v to see invocation)
Traceback (most recent call last):
  File "../../rpython/bin/rpython", line 20, in <module>
    main()
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/translator/goal/translate.py", line 217, in main
    targetspec_dic, translateconfig, config, args = parse_options_and_load_target()
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/translator/goal/translate.py", line 155, in parse_options_and_load_target
    targetspec_dic = load_target(targetspec)
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/translator/goal/translate.py", line 97, in load_target
    mod = __import__(specname)
  File "targetpypystandalone.py", line 6, in <module>
    from pypy.interpreter import gateway
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/pypy/interpreter/gateway.py", line 19, in <module>
    from pypy.interpreter.eval import Code
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/pypy/interpreter/eval.py", line 6, in <module>
    from pypy.interpreter.baseobjspace import W_Root
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/pypy/interpreter/baseobjspace.py", line 13, in <module>
    from rpython.rlib.buffer import StringBuffer
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/rlib/buffer.py", line 16, in <module>
    from rpython.rlib import rawstorage
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/rlib/rawstorage.py", line 49, in <module>
    cpuname = detect_cpu.autodetect()
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/jit/backend/detect_cpu.py", line 110, in autodetect
    return detect_model_from_host_platform()
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/jit/backend/detect_cpu.py", line 84, in detect_model_from_host_platform
    from rpython.jit.backend.x86 import detect_feature as feature
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/jit/backend/x86/detect_feature.py", line 4, in <module>
    from rpython.rlib.rmmap import alloc, free
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/rlib/rmmap.py", line 11, in <module>
    from rpython.rlib import rposix
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/rlib/rposix.py", line 8, in <module>
    from rpython.rlib import debug, jit, rstring, rthread, types
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/rlib/rthread.py", line 31, in <module>
    cconfig = rffi_platform.configure(CConfig)
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/rtyper/tool/rffi_platform.py", line 215, in configure
    for name, result in zip(entries, results):
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/rtyper/tool/rffi_platform.py", line 240, in configure_entries
    writer.path, eci, ignore_errors=ignore_errors))
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/rtyper/tool/rffi_platform.py", line 743, in run_example_code
    output = build_executable_cache(files, eci, ignore_errors=ignore_errors)
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/tool/gcc_cache.py", line 28, in build_executable_cache
    result = platform.execute(platform.compile(c_files, eci))
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/translator/platform/__init__.py", line 58, in compile
    return self._finish_linking(ofiles, eci, outputfilename, standalone)
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/translator/platform/__init__.py", line 235, in _finish_linking
    return self._link(cc_link, ofiles, largs, standalone, exe_name)
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/translator/platform/posix.py", line 60, in _link
    cwd=str(exe_name.dirpath()))
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/translator/platform/__init__.py", line 143, in _execute_c_compiler
    self._handle_error(returncode, stdout, stderr, outname)
  File "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/rpython/translator/platform/__init__.py", line 155, in _handle_error
    raise CompilationError(stdout, stderr)
CompilationError: CompilationError(err="""
	Undefined symbols for architecture x86_64:
	  "_clock_gettime", referenced from:
	      _RPyGilAcquireSlowPath in thread.o
	ld: symbol(s) not found for architecture x86_64
	clang: error: linker command failed with exit code 1 (use -v to see invocation)
	""")
Command failed:  cd "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_lang_pypy/pypy/work/pypy2.7-v7.2.0-src/pypy/goal" && arch -x86_64 /opt/local/lib/pypy-bootstrap/bin/pypy ../../rpython/bin/rpython --batch --verbose --cc=/opt/local/bin/clang-mp-9.0 --opt=jit --make-jobs=4 targetpypystandalone 
Exit code: 1

comment:5 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Interesting, since legacysupport does provide clock_gettime as well, right?

comment:6 Changed 5 years ago by kencu (Ken)

Yup. I have no explanation for you at present.

comment:7 Changed 4 years ago by danchr (Dan Villiom Podlaski Christiansen)

Resolution: fixed
Status: assignedclosed

In a57e34c000724ff2fed66b1905489299b58fafa6/macports-ports (master):

pypy: mark Snow Leopard and earlier as broken

Closes: #59191

Note: See TracTickets for help on using tickets.