Skip to content

Cannot compile on macOS with M1 #25

@TheSpyder

Description

@TheSpyder

I'm using branch 1_1_1h+esy with esy version 0.6.8-macos.arm64.dev.3. On a fresh checkout running esy eventually fails. This is the output where the errors start:

ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ar: creating archive libcrypto.a
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd (3 slices)ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd (3 slices)

Undefined symbols for architecture i386:
  "___stderrp", referenced from:
      _main in shlibloadtest.o
  "_dlclose", referenced from:
      _main in shlibloadtest.o
  "_dlopen", referenced from:
      _main in shlibloadtest.o
  "_dlsym", referenced from:
      _main in shlibloadtest.o
  "_fclose", referenced from:
      _atexit_handler in shlibloadtest.o
  "_fopen$UNIX2003", referenced from:
      _atexit_handler in shlibloadtest.o
  "_fwrite$UNIX2003", referenced from:
      _main in shlibloadtest.o
      _atexit_handler in shlibloadtest.o
  "_strcmp", referenced from:
      _main in shlibloadtest.o
ld: symbol(s) not found for architecture i386
ld: dynamic main executables must link with libSystem.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [test/shlibloadtest] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [test/rsa_complex] Error 1
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(async_null.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(async_win.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(cms_cd.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(dso_dl.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(dso_openssl.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(dso_vms.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(dso_win32.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(ebcdic.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(ecp_nistp224.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(ecp_nistp256.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(ecp_nistp521.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(ecp_nistputil.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(e_rc5.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(m_md2.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(rand_egd.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(rand_vms.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(rand_win.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(threads_none.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(threads_win.o) has no symbols
ranlib -c libcrypto.a || echo Never mind.
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(async_null.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(async_win.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(cms_cd.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(dso_dl.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(dso_openssl.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(dso_vms.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(dso_win32.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(ebcdic.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(ecp_nistp224.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(ecp_nistp256.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(ecp_nistp521.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(ecp_nistputil.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(e_rc5.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(m_md2.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(rand_egd.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(rand_vms.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(rand_win.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(threads_none.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcrypto.a(threads_win.o) has no symbols
make: *** [all] Error 2
error: command failed: 'make' '-j4' (exited with 2)
esy-build-package: exiting with errors above...
error: build failed with exit code: 1

Full output:
esy compile.txt

I noticed a bunch of lines above this are compiling for i386, e.g.

cc -Iinclude -arch i386 -O3 -fomit-frame-pointer -D_REENTRANT -DNDEBUG -MMD -MF test/buildtest_x509v3.d.tmp -MT test/buildtest_x509v3.o -c -o test/buildtest_x509v3.o test/buildtest_x509v3.c

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