question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Toolchain build failed on OSX Xcode 8, libffi depends on undefined mkostemp function

See original GitHub issue

Not sure what what is going on here… OSX 10.11.6, Xcode 8.0 (8A218a), using c7624becbd122d991112f37ee01cfa3a9b6a040f

$ ./toolchain.py build kivy
Want to build ['kivy']
Loaded recipe kivy (depends of ['python', 'sdl2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'ios'], optional are [])
Loaded recipe python (depends of ['hostpython', 'libffi'], optional are ['openssl'])
Loaded recipe sdl2 (depends of [], optional are [])
Loaded recipe sdl2_image (depends of ['sdl2'], optional are [])
Loaded recipe sdl2_mixer (depends of ['sdl2'], optional are [])
Loaded recipe sdl2_ttf (depends of ['sdl2', 'freetype'], optional are [])
Loaded recipe ios (depends of ['python'], optional are [])
Loaded recipe hostpython (depends of ['hostlibffi'], optional are [])
Loaded recipe libffi (depends of [], optional are [])
Loaded recipe freetype (depends of [], optional are [])
Loaded recipe hostlibffi (depends of [], optional are [])
Build order is ['freetype', 'hostlibffi', 'libffi', 'sdl2', 'hostpython', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python', 'ios', 'kivy']
Include dir added: {arch.arch}/freetype
Include dir added: {arch.arch}/hostlibffi
Include dir added: {arch.arch}/libffi
Include dir added: common/sdl2
Global: hostpython located at /Users/Tim/dev/kivy-ios/dist/hostpython/bin/python
Global: hostpgen located at /Users/Tim/dev/kivy-ios/dist/hostpython/bin/pgen
Include dir added: common/sdl2_image
Include dir added: common/sdl2_mixer
Include dir added: common/sdl2_ttf
# (ignored) Download freetype
# (ignored) Extract freetype
# (ignored) Build_all freetype
# (ignored) Download hostlibffi
# (ignored) Extract hostlibffi
Build hostlibffi for x86_64 (filtered)
# (ignored) Build hostlibffi
# (ignored) Download libffi
# (ignored) Extract libffi
# (ignored) Build_all libffi
# (ignored) Download sdl2
# (ignored) Extract sdl2
# (ignored) Build_all sdl2
# (ignored) Download hostpython
# (ignored) Extract hostpython
Build_all hostpython
Build hostpython for x86_64 (filtered)
# (ignored) Build hostpython
Install include files for hostpython
# (ignored) Install_include hostpython
Install frameworks for hostpython
# (ignored) Install_frameworks hostpython
Install sources for hostpython
# (ignored) Install_sources hostpython
Install hostpython
Makefile:1392: warning: overriding commands for target `Modules/posixmodule.o'
Makefile:1284: warning: ignoring old commands for target `Modules/posixmodule.o'
Makefile:1393: warning: overriding commands for target `Modules/posixmodule.so'
Makefile:1285: warning: ignoring old commands for target `Modules/posixmodule.so'
Makefile:1394: warning: overriding commands for target `Modules/errnomodule.o'
Makefile:1286: warning: ignoring old commands for target `Modules/errnomodule.o'
Makefile:1395: warning: overriding commands for target `Modules/errnomodule.so'
Makefile:1287: warning: ignoring old commands for target `Modules/errnomodule.so'
Makefile:1396: warning: overriding commands for target `Modules/pwdmodule.o'
Makefile:1288: warning: ignoring old commands for target `Modules/pwdmodule.o'
Makefile:1397: warning: overriding commands for target `Modules/pwdmodule.so'
Makefile:1289: warning: ignoring old commands for target `Modules/pwdmodule.so'
Makefile:1398: warning: overriding commands for target `Modules/_sre.o'
Makefile:1290: warning: ignoring old commands for target `Modules/_sre.o'
Makefile:1399: warning: overriding commands for target `Modules/_sre.so'
Makefile:1291: warning: ignoring old commands for target `Modules/_sre.so'
Makefile:1400: warning: overriding commands for target `Modules/_codecsmodule.o'
Makefile:1292: warning: ignoring old commands for target `Modules/_codecsmodule.o'
Makefile:1401: warning: overriding commands for target `Modules/_codecsmodule.so'
Makefile:1293: warning: ignoring old commands for target `Modules/_codecsmodule.so'
Makefile:1402: warning: overriding commands for target `Modules/_weakref.o'
Makefile:1310: warning: ignoring old commands for target `Modules/_weakref.o'
Makefile:1403: warning: overriding commands for target `Modules/_weakref.so'
Makefile:1311: warning: ignoring old commands for target `Modules/_weakref.so'
Makefile:1404: warning: overriding commands for target `Modules/zipimport.o'
Makefile:1294: warning: ignoring old commands for target `Modules/zipimport.o'
Makefile:1405: warning: overriding commands for target `Modules/zipimport.so'
Makefile:1295: warning: ignoring old commands for target `Modules/zipimport.so'
Makefile:1406: warning: overriding commands for target `Modules/symtablemodule.o'
Makefile:1296: warning: ignoring old commands for target `Modules/symtablemodule.o'
Makefile:1407: warning: overriding commands for target `Modules/_symtablemodule.so'
Makefile:1297: warning: ignoring old commands for target `Modules/_symtablemodule.so'
Makefile:1408: warning: overriding commands for target `Modules/xxsubtype.o'
Makefile:1353: warning: ignoring old commands for target `Modules/xxsubtype.o'
Makefile:1409: warning: overriding commands for target `Modules/xxsubtype.so'
Makefile:1354: warning: ignoring old commands for target `Modules/xxsubtype.so'
clang -Qunused-arguments -fcolor-diagnostics -lsqlite3 -lffi -L/Users/Tim/dev/kivy-ios/dist/hostlibffi/usr/local/lib  -o python.exe \
            Modules/python.o \
            libpython2.7.a -ldl  -framework CoreFoundation -L/Users/Tim/dev/kivy-ios/dist/hostpython/lib -lz                      
ld: warning: directory not found for option '-L/Users/Tim/dev/kivy-ios/dist/hostpython/lib'
Undefined symbols for architecture x86_64:
  "_mkostemp", referenced from:
      _open_temp_exec_file_dir in libffi.a(closures.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [python.exe] Error 1
Traceback (most recent call last):
  File "./toolchain.py", line 1311, in <module>
    ToolchainCL()
  File "./toolchain.py", line 1082, in __init__
    getattr(self, args.command)()
  File "./toolchain.py", line 1106, in build
    build_recipes(args.recipe, ctx)
  File "./toolchain.py", line 974, in build_recipes
    recipe.execute()
  File "/Users/Tim/dev/kivy-ios/toolchain.py", line 586, in execute
    self.build_all()
  File "/Users/Tim/dev/kivy-ios/toolchain.py", line 56, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/Tim/dev/kivy-ios/toolchain.py", line 698, in build_all
    self.install()
  File "/Users/Tim/dev/kivy-ios/recipes/hostpython/__init__.py", line 86, in install
    _env=build_env)
  File "/Users/Tim/dev/kivy-ios/toolchain.py", line 39, in shprint
    for line in command(*args, **kwargs):
  File "./tools/external/sh.py", line 565, in next
    self.wait()
  File "./tools/external/sh.py", line 500, in wait
    self.handle_command_exit_code(exit_code)
  File "./tools/external/sh.py", line 516, in handle_command_exit_code
    raise exc(self.ran, self.process.stdout, self.process.stderr)
sh.ErrorReturnCode_2: 

  RAN: '/usr/bin/make -C /Users/Tim/dev/kivy-ios/build/hostpython/x86_64/Python-2.7.1 bininstall inclinstall'

  STDOUT:
Makefile:1392: warning: overriding commands for target `Modules/posixmodule.o'
Makefile:1284: warning: ignoring old commands for target `Modules/posixmodule.o'
Makefile:1393: warning: overriding commands for target `Modules/posixmodule.so'
Makefile:1285: warning: ignoring old commands for target `Modules/posixmodule.so'
Makefile:1394: warning: overriding commands for target `Modules/errnomodule.o'
Makefile:1286: warning: ignoring old commands for target `Modules/errnomodule.o'
Makefile:1395: warning: overriding commands for target `Modules/errnomodule.so'
Makefile:1287: warning: ignoring old commands for target `Modules/errnomodule.so'
Makefile:1396: warning: overriding commands for target `Modules/pwdmodule.o'
Makefile:1288: warning: ignor... (2782 more, please see e.stdout)

  STDERR:

This might be useful:

$ ./toolchain.py recipes
audiostream  master  
click        master  
distribute   0.7.3   
ffmpeg       2.6.3   
ffpyplayer   v3.2    
flask        master  
freetype     2.5.5   
host_setuptools None    
hostlibffi   3.2.1   
hostpython   2.7.1   
ios          master  
itsdangerous master  
jinja2       master  
kivy         1.9.1   
libffi       3.2.1   
libjpeg      v9a     
markupsafe   master  
moodstocks   4.1.5   
numpy        1.9.1   
openssl      1.0.2h  
photolibrary master  
pil          2.8.2   
pkgresources None    
plyer        master  
pycrypto     2.6.1   
pymoodstocks master  
pyobjus      master  
python       2.7.1   
pyyaml       3.11    
sdl2         iOS-improvements
sdl2_image   2.0.0   
sdl2_mixer   2.0.0   
sdl2_ttf     2.0.12  
werkzeug     master 

I notice when libffi is configuring, it says:

checking for mkostemp... yes

Is that right? The line in libffi that calls mkostemp : https://github.com/libffi/libffi/blob/5d0365c605c472f40d1195cf7ba04ae08e360cb7/src/closures.c#L502

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
cruor99commented, Sep 19, 2016

I am experiencing the same issue. I think it might be related to the recent xcode update, so I’ll try to go back to xcode 7 and see what happens then. I’ll report back with what I find.

edit:

Can confirm that downgrading to Xcode 7 lets you build again.

0reactions
erikwiffincommented, Mar 16, 2017

Okay, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble with installing cocoapods | Apple Developer Forums
I am getting the same error over and over again and I do not know why. ... ERROR: Failed to build gem native...
Read more >
Kivy-IOS Compilation Build Failed Error: "/usr/bin/python
Hi all. I am trying to start comp by. $ toolchain build python3 openssl kivy. but I get the following error: [DEBUG ]...
Read more >
A brand new website interface for an even better experience!
Toolchain build failed on OSX Xcode 8, libffi depends on undefined mkostemp function.
Read more >
Standard Toolchain Setup for Linux and macOS - ESP32
This setup guide will help you on getting everything installed on Linux and macOS based systems. For Linux Users . To compile...
Read more >
R Compiler Tools for Rcpp on macOS - The Coatless Professor
Editor's Note: This is an updated post that covers how to install the macOS toolchain for versions of R starting at 4.y.z..
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found