Skip to content

Build failure on macOS #2710

Description

@seragh

What seems to be the problem?

Fails to build on macOS. This is the log from a CI machine:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 2498k    0 2498k    0     0  1676k      0 --:--:--  0:00:01 --:--:-- 2531k
100 7089k    0 7089k    0     0  2832k      0 --:--:--  0:00:02 --:--:-- 3544k
100 8374k    0 8374k    0     0  2976k      0 --:--:--  0:00:02 --:--:-- 3626k
make[1]: warning: -jN forced in submake: disabling jobserver mode.
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: bin/Release/libluashim-lib.a will be fat and ar(1) will not be able to operate on it
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd (3 slices)
ld: dynamic executables or dylibs must link with libSystem.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../bin/release/example.so] Error 1
make[1]: *** [example] Error 2
make[1]: *** Waiting for unfinished jobs....
../../binmodules/luasocket/src/select.c:124:16: warning: variable 'n' set but not used [-Wunused-but-set-variable]
    int i = 1, n = 0;
               ^
1 warning generated.
../../binmodules/luasocket/src/select.c:124:16: warning: variable 'n' set but not used [-Wunused-but-set-variable]
    int i = 1, n = 0;
               ^
1 warning generated.
../../binmodules/luasocket/src/select.c:124:16: warning: variable 'n' set but not used [-Wunused-but-set-variable]
    int i = 1, n = 0;
               ^
1 warning generated.
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd (3 slices)
Undefined symbols for architecture i386:
  "___bzero", referenced from:
      _meth_accept in tcp.o
      _global_create in tcp.o
      _global_connect in tcp.o
      _tcp_create in tcp.o
  "___darwin_check_fd_set_overflow", referenced from:
      _global_select in select.o
      _collect_fd in select.o
      _global_select in select.o
      _collect_fd in select.o
  "___error", referenced from:
      _inet_meth_getpeername in inet.o
      _inet_meth_getsockname in inet.o
      _inet_global_gethostname in inet.o
      _global_create in serial.o
      _meth_getsockname in unixdgram.o
      _meth_getsockname in unixstream.o
      _socket_waitfd in usocket.o
      ...
  "___sprintf_chk", referenced from:
      _auxiliar_tostring in auxiliar.o
      _auxiliar_checkclass in auxiliar.o
      _auxiliar_checkgroup in auxiliar.o
      _opt_meth_setoption in options.o
      _opt_meth_getoption in options.o
  "___stack_chk_fail", referenced from:
      _auxiliar_tostring in auxiliar.o
      _auxiliar_checkclass in auxiliar.o
      _auxiliar_checkgroup in auxiliar.o
      _buffer_meth_receive in buffer.o
      _inet_meth_getpeername in inet.o
      _inet_meth_getsockname in inet.o
      _inet_trydisconnect in inet.o
      ...
  "___stack_chk_guard", referenced from:
      _auxiliar_tostring in auxiliar.o
      _auxiliar_checkclass in auxiliar.o
      _auxiliar_checkgroup in auxiliar.o
      _buffer_meth_receive in buffer.o
      _inet_meth_getpeername in inet.o
      _inet_meth_getsockname in inet.o
      _inet_trydisconnect in inet.o
      ...
      _auxiliar_tostring in auxiliar.o
      _auxiliar_checkclass in auxiliar.o
      _auxiliar_checkgroup in auxiliar.o
      _buffer_meth_receive in buffer.o
      _inet_meth_getpeername in inet.o
      _inet_meth_getsockname in inet.o
      _inet_trydisconnect in inet.o
      ...
      _auxiliar_tostring in auxiliar.o
      _auxiliar_checkclass in auxiliar.o
      _auxiliar_checkgroup in auxiliar.o
      _buffer_meth_receive in buffer.o
      _inet_meth_getpeername in inet.o
      _inet_meth_getsockname in inet.o
      _inet_trydisconnect in inet.o
      ...
      _auxiliar_tostring in auxiliar.o
      _auxiliar_checkclass in auxiliar.o
      _auxiliar_checkgroup in auxiliar.o
      _buffer_meth_receive in buffer.o
      _inet_meth_getpeername in inet.o
      _inet_meth_getsockname in inet.o
      _inet_trydisconnect in inet.o
      ...
      _auxiliar_tostring in auxiliar.o
      _auxiliar_checkclass in auxiliar.o
      _auxiliar_checkgroup in auxiliar.o
      _buffer_meth_receive in buffer.o
      _inet_meth_getpeername in inet.o
      _inet_meth_getsockname in inet.o
      _inet_trydisconnect in inet.o
      ...
      _auxiliar_tostring in auxiliar.o
      _auxiliar_checkclass in auxiliar.o
      _auxiliar_checkgroup in auxiliar.o
      _buffer_meth_receive in buffer.o
      _inet_meth_getpeername in inet.o
      _inet_meth_getsockname in inet.o
      _inet_trydisconnect in inet.o
      ...
      _auxiliar_tostring in auxiliar.o
      _auxiliar_checkclass in auxiliar.o
      _auxiliar_checkgroup in auxiliar.o
      _buffer_meth_receive in buffer.o
      _inet_meth_getpeername in inet.o
      _inet_meth_getsockname in inet.o
      _inet_trydisconnect in inet.o
      ...
      ...
  "___strcpy_chk", referenced from:
      _meth_bind in unixdgram.o
      _meth_connect in unixdgram.o
      _meth_sendto in unixdgram.o
      _meth_bind in unixstream.o
      _meth_connect in unixstream.o
  "_accept$UNIX2003", referenced from:
      _socket_accept in usocket.o
  "_bind$UNIX2003", referenced from:
      _socket_bind in usocket.o
  "_close$UNIX2003", referenced from:
      _socket_destroy in usocket.o
  "_connect$UNIX2003", referenced from:
      _socket_connect in usocket.o
  "_fcntl$UNIX2003", referenced from:
      _socket_bind in usocket.o
      _socket_setblocking in usocket.o
      _socket_setnonblocking in usocket.o
  "_free", referenced from:
      _meth_receive in udp.o
      _meth_receivefrom in udp.o
      _meth_receive in unixdgram.o
      _meth_receivefrom in unixdgram.o
  "_freeaddrinfo", referenced from:
      _inet_tryconnect in inet.o
      _inet_trybind in inet.o
      _inet_global_getaddrinfo in inet.o
      _inet_global_getnameinfo in inet.o
      _meth_sendto in udp.o
  "_gai_strerror", referenced from:
      _inet_meth_getpeername in inet.o
      _inet_meth_getsockname in inet.o
      _meth_receivefrom in udp.o
      _meth_sendto in udp.o
      _socket_gaistrerror in usocket.o
  "_getaddrinfo", referenced from:
      _inet_tryconnect in inet.o
      _inet_trybind in inet.o
      _inet_global_getaddrinfo in inet.o
      _inet_global_getnameinfo in inet.o
      _meth_sendto in udp.o
  "_gethostbyaddr", referenced from:
      _socket_gethostbyaddr in usocket.o
     (maybe you meant: _socket_gethostbyaddr)
  "_gethostbyname", referenced from:
      _socket_gethostbyname in usocket.o
     (maybe you meant: _socket_gethostbyname)
  "_gethostname", referenced from:
      _inet_global_gethostname in inet.o
  "_getnameinfo", referenced from:
      _inet_meth_getpeername in inet.o
      _inet_meth_getsockname in inet.o
      _inet_global_getaddrinfo in inet.o
      _inet_global_getnameinfo in inet.o
      _meth_receivefrom in udp.o
  "_getpeername$UNIX2003", referenced from:
      _inet_meth_getpeername in inet.o
  "_getsockname$UNIX2003", referenced from:
      _inet_meth_getsockname in inet.o
      _meth_getsockname in unixdgram.o
      _meth_getsockname in unixstream.o
  "_getsockopt", referenced from:
      _opt_get_reuseaddr in options.o
      _opt_get_reuseport in options.o
      _opt_get_tcp_nodelay in options.o
      _opt_get_keepalive in options.o
      _opt_get_dontroute in options.o
      _opt_get_broadcast in options.o
      _opt_get_ip6_unicast_hops in options.o
      ...
  "_gettimeofday", referenced from:
      _timeout_get in timeout.o
      _timeout_gettime in timeout.o
      _timeout_getretry in timeout.o
      _timeout_markstart in timeout.o
      _timeout_lua_gettime in timeout.o
  "_h_errno", referenced from:
      _socket_gethostbyaddr in usocket.o
      _socket_gethostbyname in usocket.o
  "_hstrerror", referenced from:
      _socket_hoststrerror in usocket.o
  "_inet_aton", referenced from:
      _inet_global_toip in inet.o
      _inet_global_tohostname in inet.o
      _opt_set_ip_multicast_if in options.o
      _opt_setmembership in options.o
  "_inet_ntoa", referenced from:
      _inet_global_toip in inet.o
      _inet_pushresolved in inet.o
      _opt_get_ip_multicast_if in options.o
  "_inet_pton", referenced from:
      _opt_ip6_setmembership in options.o
  "_listen$UNIX2003", referenced from:
      _socket_listen in usocket.o
  "_malloc", referenced from:
      _meth_receive in udp.o
      _meth_receivefrom in udp.o
      _meth_receive in unixdgram.o
      _meth_receivefrom in unixdgram.o
  "_nanosleep$UNIX2003", referenced from:
      _timeout_lua_sleep in timeout.o
  "_open$UNIX2003", referenced from:
      _global_create in serial.o
  "_poll$UNIX2003", referenced from:
      _socket_waitfd in usocket.o
      _socket_connect in usocket.o
      _socket_accept in usocket.o
      _socket_send in usocket.o
      _socket_sendto in usocket.o
      _socket_recv in usocket.o
      _socket_recvfrom in usocket.o
      ...
  "_read$UNIX2003", referenced from:
      _socket_read in usocket.o
  "_recv$UNIX2003", referenced from:
      _socket_connect in usocket.o
      _socket_recv in usocket.o
  "_recvfrom$UNIX2003", referenced from:
      _socket_recvfrom in usocket.o
  "_select$UNIX2003", referenced from:
      _socket_select in usocket.o
  "_send$UNIX2003", referenced from:
      _socket_send in usocket.o
  "_sendto$UNIX2003", referenced from:
      _socket_sendto in usocket.o
  "_setsockopt", referenced from:
      _inet_trycreate in inet.o
      _inet_tryconnect in inet.o
      _inet_trybind in inet.o
      _opt_set_reuseaddr in options.o
      _opt_set_reuseport in options.o
      _opt_set_tcp_nodelay in options.o
      _opt_set_keepalive in options.o
      ...
  "_shutdown", referenced from:
      _socket_shutdown in usocket.o
     (maybe you meant: _socket_shutdown)
  "_signal", referenced from:
      _socket_open in usocket.o
  "_socket", referenced from:
      _socket_create in usocket.o
     (maybe you meant: _socket_gaistrerror, _socket_recvfrom , _socket_close , _socket_listen , _socket_gethostbyaddr , _socket_destroy , _socket_strerror , _socket_gethostbyname , _socket_bind , _socket_create , _socket_read , _socket_setblocking , _socket_hoststrerror , _socket_select , _socket_connect , _socket_open , _socket_waitfd , _socket_ioerror , _socket_shutdown , _socket_write , _socket_setnonblocking , _luaopen_socket_unix , _socket_send , _socket_accept , _luaopen_socket_serial , _luaopen_socket_core , _socket_sendto , _socket_recv )
  "_strcmp", referenced from:
      _inet_trybind in inet.o
      _opt_meth_setoption in options.o
      _opt_meth_getoption in options.o
      _opt_set_ip_multicast_if in options.o
      _opt_setmembership in options.o
      _meth_setpeername in udp.o
  "_strerror$UNIX2003", referenced from:
      _socket_strerror in usocket.o
      _socket_gaistrerror in usocket.o
  "_strlen", referenced from:
      _meth_bind in unixdgram.o
      _meth_connect in unixdgram.o
      _meth_sendto in unixdgram.o
      _meth_bind in unixstream.o
      _meth_connect in unixstream.o
  "_strtol", referenced from:
      _inet_meth_getpeername in inet.o
      _meth_receivefrom in udp.o
  "_write$UNIX2003", referenced from:
      _socket_write in usocket.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../bin/release/luasocket.dylib] Error 1
make[1]: *** [luasocket] Error 2
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: bin/Release/liblua-lib.a will be fat and ar(1) will not be able to operate on it
make: *** [osx] Error 2

What did you expect to happen?

Builds as did 5.0.0-beta7.

What have you tried so far?

Explicitly setting a 64 bit platform, which works, tho I don't know what I get, an Intel or ARM machine.

How can we reproduce this?

Please provide a minimal, reproducible example we can use to replicate the problem in our own development environments. Use code blocks to format code and console output nicely.

  • Visual Studio 2026 (vs2026)
  • Visual Studio 2022 (vs2022)
  • Visual Studio 2019 (vs2019)
  • Visual Studio 2017 (vs2017)
  • Visual Studio 2015 (vs2015)
  • Visual Studio 2012 (vs2012)
  • Visual Studio 2010 (vs2010)
  • Visual Studio 2008 (vs2008)
  • Visual Studio 2005 (vs2005)
  • GNU Makefile (gmake)
  • GNU Makefile Legacy (gmakelegacy)
  • XCode (xcode)
  • Codelite
  • Compile Commands
  • Other (Please list below)

What version of Premake are you using?

251f0a2

Anything else we should know?

nothing, ask if you have questions.

(You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to issues like these!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions