Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to configure with --static-link #156

Closed
georged-youi opened this issue Nov 28, 2019 · 3 comments
Closed

failed to configure with --static-link #156

georged-youi opened this issue Nov 28, 2019 · 3 comments

Comments

@georged-youi
Copy link

georged-youi commented Nov 28, 2019

Trying to build statically for mac os, fails with the following errors:

hermes_ws ./hermes/utils/build/configure.py --static-link
Building hermes using Ninja into /Users/georgedorobantu/w/hermes_ws/build/
CMake flags: -DLLVM_BUILD_DIR=/Users/georgedorobantu/w/hermes_ws/llvm_build -DLLVM_SRC_DIR=/Users/georgedorobantu/w/hermes_ws/llvm -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=On -DHERMES_STATIC_LINK=On
CMake version:
cmake version 3.15.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).

+ /usr/local/Cellar/cmake/3.15.5/bin/cmake /Users/georgedorobantu/w/hermes_ws/hermes -G Ninja -DLLVM_BUILD_DIR=/Users/georgedorobantu/w/hermes_ws/llvm_build -DLLVM_SRC_DIR=/Users/georgedorobantu/w/hermes_ws/llvm -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=On -DHERMES_STATIC_LINK=On
-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_COMPUTED_GOTO
-- Performing Test HAVE_COMPUTED_GOTO - Failed
-- Performing Test HAVE_GC_SECTIONS
-- Performing Test HAVE_GC_SECTIONS - Failed
CMake Deprecation Warning at CMakeLists.txt:299 (cmake_policy):
  The OLD behavior for policy CMP0023 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Linker detection: ld64
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Failed
-- Performing Test CXX_SUPPORTS_FPIC
-- Performing Test CXX_SUPPORTS_FPIC - Failed
CMake Warning at /Users/georgedorobantu/w/hermes_ws/llvm_build/lib/cmake/llvm/HandleLLVMOptions.cmake:186 (message):
  -fPIC is not supported.
Call Stack (most recent call first):
  /Users/georgedorobantu/w/hermes_ws/llvm_build/lib/cmake/llvm/HandleLLVMOptions.cmake:217 (add_flag_or_print_warning)
  CMakeLists.txt:349 (include)


-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Failed
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Failed
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Failed
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Performing Test CXX_SUPPORTS_CXX11
-- Performing Test CXX_SUPPORTS_CXX11 - Failed
CMake Error at /Users/georgedorobantu/w/hermes_ws/llvm_build/lib/cmake/llvm/HandleLLVMOptions.cmake:430 (message):
  LLVM requires C++11 support but the '-std=c++11' flag isn't supported.
Call Stack (most recent call first):
  CMakeLists.txt:349 (include)


-- Configuring incomplete, errors occurred!
See also "/Users/georgedorobantu/w/hermes_ws/build/CMakeFiles/CMakeOutput.log".
See also "/Users/georgedorobantu/w/hermes_ws/build/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "./hermes/utils/build/configure.py", line 131, in <module>
    main()
  File "./hermes/utils/build/configure.py", line 126, in main
    cwd=args.hermes_build_dir,
  File "/Users/georgedorobantu/w/hermes_ws/hermes/utils/build/common.py", line 75, in run_command
    return subprocess.check_call(cmd, stdout=sys.stdout, stderr=sys.stderr, **kwargs)
  File "/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'/usr/local/Cellar/cmake/3.15.5/bin/cmake', '/Users/georgedorobantu/w/hermes_ws/hermes', u'-G', 'Ninja', u'-DLLVM_BUILD_DIR=/Users/georgedorobantu/w/hermes_ws/llvm_build', u'-DLLVM_SRC_DIR=/Users/georgedorobantu/w/hermes_ws/llvm', u'-DCMAKE_BUILD_TYPE=Debug', u'-DLLVM_ENABLE_ASSERTIONS=On', u'-DHERMES_STATIC_LINK=On']' returned non-zero exit status 1

Any ideas?

@dulinriley
Copy link
Contributor

So I think this problem isn't related to static linking for you, as the errors say:

  LLVM requires C++11 support but the '-std=c++11' flag isn't supported.

Earlier output says:

-- The CXX compiler identification is AppleClang 10.0.1.10010046

I've tried locally with Xcode 11, my c++ --version says this:

~/hermes $ c++ --version
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin19.0.0
Thread model: posix

Can you re-try with Xcode 11? You can download that from Apple's developer website, and you can
use sudo xcode-select -s /Applications/Xcode_version.app/ to switch which Xcode is available on
the command line.

@dulinriley
Copy link
Contributor

Also, if that succeeds, I've found that locally using --static-link will fail on MacOS with the following message:

[207/318] Linking CXX executable bin/hermesc
FAILED: bin/hermesc
...
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

According to a Stack Overflow post, MacOS makes it pretty hard to request
a full static link.

@tmikov
Copy link
Contributor

tmikov commented Dec 2, 2019

We don't support full static linking on MacOS, see

"Link Hermes statically. May only work on GNU/Linux.")
. However, the binary we produce on MacOS only depends on system libraries, so a static link should not be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants