crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.51k stars 1.62k forks source link

Undefined symbols | macOS 10.12.6 Brew installation failed Crystal 0.35.0 #9476

Closed 636f7374 closed 4 years ago

636f7374 commented 4 years ago

Summary

Brew install Crystal

$ brew install crystal
Updating Homebrew...
Warning: You are using macOS 10.12.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.

==> Downloading https://github.com/crystal-lang/shards/archive/v0.11.1.tar.gz
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/b714cc78f379fa6d22e16d28e5bfd9971192d6060da71685e4a560a33e57d619--shards-0.11.1.tar.gz
==> Downloading https://github.com/ivmai/bdwgc/commit/5668de71107022a316ee967162
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/dc1928e97e9e7b3faf616c17dec04221b09064823c14e0dd7cf6476ca714921d--5668de71107022a316ee967162bc16c10754b9ce.patch
==> Downloading https://github.com/ivmai/bdwgc/releases/download/v8.0.4/gc-8.0.4
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/90e8505c0bde3e3378e551f43950493aae28aea07c7929c064605253192ddbf4--gc-8.0.4.tar.gz
==> Downloading https://github.com/crystal-lang/crystal/releases/download/0.34.0
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/aa8d5f6769a65b257abc3251ec0d8668acabaac14aac3e23c75b6f1c6d982172--crystal-0.34.0-1-darwin-x86_64.tar.gz
==> Downloading https://github.com/crystal-lang/crystal/archive/0.35.0.tar.gz
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/8ac0bcd0d4f733015d336f87f9f68075a8785e4396fb73c42e407174430d2f43--crystal-0.35.0.tar.gz
==> Patching bdw-gc
==> Applying 5668de71107022a316ee967162bc16c10754b9ce.patch
patching file include/gc.h
Hunk #1 succeeded at 1561 (offset -17 lines).
patching file misc.c
Hunk #1 succeeded at 2199 with fuzz 1 (offset -1 lines).
patching file pthread_support.c
Hunk #1 succeeded at 1400 (offset -3 lines).
patching file tests/test.c
Hunk #1 succeeded at 1309 (offset -3 lines).
Hunk #2 succeeded at 1341 (offset -3 lines).
Hunk #3 succeeded at 1486 (offset -3 lines).
Hunk #4 succeeded at 1548 (offset -11 lines).
patching file win32_threads.c
Hunk #1 succeeded at 216 (offset 2 lines).
Hunk #2 succeeded at 384 (offset 5 lines).
Hunk #3 succeeded at 922 with fuzz 1 (offset 2 lines).
Hunk #4 succeeded at 971 (offset 2 lines).
Hunk #5 succeeded at 1514 (offset 2 lines).
==> ./configure --disable-shared --enable-large-config
==> make
==> make deps
==> make crystal release=true FLAGS=--no-debug CRYSTAL_CONFIG_LIBRARY_PATH=
Last 15 lines from /Users/User/Library/Logs/Homebrew/crystal/04.make:
make
crystal
release=true
FLAGS=--no-debug
CRYSTAL_CONFIG_LIBRARY_PATH=

Using /usr/local/opt/llvm/bin/llvm-config [version=10.0.0]
CRYSTAL_CONFIG_LIBRARY_PATH="" CRYSTAL_CONFIG_BUILD_COMMIT="" SOURCE_DATE_EPOCH="1591712501" ./bin/crystal build --no-debug --release  -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
Undefined symbols for architecture x86_64:
  "_futimens", referenced from:
      llvm::sys::fs::setLastAccessAndModificationTime(int, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) in libLLVMSupport.a(Path.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: `clang "${@}" -o '/private/tmp/crystal-20200614-62030-1wbx3ur/crystal-0.35.0/.build/crystal'  -rdynamic  /private/tmp/crystal-20200614-62030-1wbx3ur/crystal-0.35.0/src/llvm/ext/llvm_ext.o `"/usr/local/opt/llvm/bin/llvm-config" --libs --system-libs --ldflags 2> /dev/null` -lstdc++ -lpcre -lgc -lpthread /private/tmp/crystal-20200614-62030-1wbx3ur/crystal-0.35.0/src/ext/libcrystal.a -levent -liconv -ldl -L/private/tmp/crystal-20200614-62030-1wbx3ur/crystal-0.35.0/boot/embedded/lib -L/private/tmp/crystal-20200614-62030-1wbx3ur/crystal-0.35.0/boot/embedded/lib`
make: *** [.build/crystal] Error 1

Do not report this issue to Homebrew/brew or Homebrew/core!

Error: You are using macOS 10.12.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.

Llvm Information

$ which clang
/usr/local/opt/llvm/bin/clang

iMac:~ User$ clang -v
clang version 10.0.0 
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

Brew Llvm Information

$ brew install llvm
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 4 taps (caskroom/cask, homebrew/cask, homebrew/cask-versions and homebrew/core).
==> New Formulae
idris2                                   kde-threadweaver
==> Updated Formulae
imagemagick@6 ✔            imagemagick                nativefier
libzip ✔                   kde-extra-cmake-modules    stgit
gitmoji                    makepkg
==> Updated Casks
1password-cli                            mudlet
1password-cli                            mudlet
adobe-dng-converter                      musictube
adobe-dng-converter                      musictube
balenaetcher                             netron
balenaetcher                             netron
banking-4                                nosqlbooster-for-mongodb
banking-4                                nosqlbooster-for-mongodb
blitz                                    odrive
blitz                                    odrive
brave-browser-dev                        pingplotter
busycal                                  pingplotter
busycal                                  pomello
cabal                                    pomello
cabal                                    popo
clashx                                   popo
clashx                                   powershell
clickup                                  powershell
clickup                                  qiyimedia
crossover                                qiyimedia
crossover                                qownnotes
datadog-agent                            qownnotes
datadog-agent                            quail
drawio                                   quail
drawio                                   redcine-x-pro
dungeon-crawl-stone-soup-console         redcine-x-pro
dungeon-crawl-stone-soup-console         refined-github-safari
dungeon-crawl-stone-soup-tiles           refined-github-safari
dungeon-crawl-stone-soup-tiles           remember-the-milk
eve-launcher                             remember-the-milk
eve-launcher                             screen
extraterm                                screen
extraterm                                seadrive
file-juicer                              seadrive
file-juicer                              serial
firecamp                                 serial
firecamp                                 signal
grids                                    signal
grids                                    sqlpro-for-mysql
handbrake                                sqlpro-for-mysql
handbrake                                sqlpro-for-postgres
hex-fiend-beta                           sqlpro-for-postgres
icq                                      ssh-config-editor
icq                                      ssh-config-editor
idagio                                   stack-stack
idagio                                   stack-stack
iina-plus                                subsurface
iina-plus                                subsurface
joplin                                   superproductivity
joplin                                   superproductivity
jumpshare                                ultimate
jumpshare                                ultimate
keeweb                                   universal-media-server
keeweb                                   universal-media-server
krisp                                    vivaldi
krisp                                    vivaldi
litecoin                                 whale
litecoin                                 whale
macgdbp                                  wickrme
macgdbp                                  wickrme
marked                                   wpsoffice
marked                                   wpsoffice
menutube                                 yammer
menutube                                 yammer
microsoft-teams                          yourkit-java-profiler
microsoft-teams                          yourkit-java-profiler

Warning: You are using macOS 10.12.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.

==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-1
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/474a77e97bc3c30c3dcba5a5f4df25f06e523e94dfbaab040eae3dfe5dbda7b6--clang-10.0.0.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-1
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/909c0539983fe3118549a6cc4f43de8b4fb0a17daa952c82b4f1a733757aaebb--clang-tools-extra-10.0.0.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-1
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/0eb49cc68dd2e52dc874a10c64725caaa805539aa2507a3fcc643613f73353d2--compiler-rt-10.0.0.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-1
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/550b51b1815f92e99b41b3a8a9798a4182d408d59936a3f5b0e2b43fed9000a7--libcxx-10.0.0.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-1
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/db47c95dae8101008aaa3ef13afd8e8564183460cef722009903fec8106513c0--libunwind-10.0.0.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-1
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/a80cc18f6f0457dc162e609008fae76643fc601364fd733f495834847373e724--lld-10.0.0.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-1
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/b13c2dac9fd1457d1b1b43070839fd63f08592cdbe39b4834a7c6a5199d731cd--lldb-10.0.0.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-1
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/2f787b4efc4708d5d0a3be946c9d637f8c9e8cbf9cac60e32b57b58055be096f--openmp-10.0.0.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-1
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/82e01b25e59fdc4bb8634d9b43ae82be4910cb24133c83723c4bf9c521ad78fb--polly-10.0.0.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-1
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/f1fb43b3a3ad9303a695a43dab72af20bd23d3381640536099a470643dc8f2d0--llvm-10.0.0.src.tar.xz
==> cmake -G Unix Makefiles .. -DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra;ll
==> make
==> make install
==> make install-xcode-toolchain
==> Caveats
To use the bundled libc++ please add the following LDFLAGS:
  LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"

llvm is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have llvm first in your PATH run:
  echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> /Users/User/.bash_profile

For compilers to find llvm you may need to set:
  export LDFLAGS="-L/usr/local/opt/llvm/lib"
  export CPPFLAGS="-I/usr/local/opt/llvm/include"

==> Summary
🍺  /usr/local/Cellar/llvm/10.0.0_3: 7,079 files, 1.2GB, built in 57 minutes 9 seconds
Removing: /usr/local/Cellar/llvm/10.0.0_1... (7,079 files, 1.2GB)
$ brew info llvm
llvm: stable 10.0.0, HEAD [keg-only]
Next-gen compiler infrastructure
https://llvm.org/
/usr/local/Cellar/llvm/10.0.0_3 (7,079 files, 1.2GB)
  Built from source on 2020-06-14 at 16:36:28
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/llvm.rb
==> Dependencies
Build: cmake ✔, python@3.8 ✔
Required: libffi ✔
==> Requirements
Build: xcode ✔
==> Options
--HEAD
    Install HEAD version
==> Caveats
To use the bundled libc++ please add the following LDFLAGS:
  LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"

llvm is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have llvm first in your PATH run:
  echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> /Users/User/.bash_profile

For compilers to find llvm you may need to set:
  export LDFLAGS="-L/usr/local/opt/llvm/lib"
  export CPPFLAGS="-I/usr/local/opt/llvm/include"

System Information

$ uname -a
Darwin iMac 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
636f7374 commented 4 years ago

Update

References

jhass commented 4 years ago

I think Crystal technically may, but Homebrew and by extension its LLVM build doesn't anymore.

636f7374 commented 4 years ago

@jhass 👌 Okay, I see, thank you for your help.

kubo commented 4 years ago

In Homebrew's macOS Requirements:

  • macOS High Sierra (10.13) (or higher)