[llvm-dev] Unable to build 'lld' on Mac OS 10.9

Vinay Kumar via llvm-dev llvm-dev at lists.llvm.org
Sun May 13 23:17:07 PDT 2018


Hi All,

I am trying to build the 'lld' linker on Mac OS 10.9, but during the build, I am getting the errors. Following are the steps that I have followed:


1.     I have downloaded the ‘llvm-stable’ source code from the following location:

 

https://github.com/llvm-mirror/llvm/tree/stable

 

2.     Machine details(on which llvm source code isbeing built) are as follows:


$ sw_vers

ProductName:   Mac OS X

ProductVersion: 10.9.5

BuildVersion:  13F1911

$ clang -v

Apple LLVM version 6.0 (clang-600.0.57) (based onLLVM 3.5svn)

Target: x86_64-apple-darwin13.4.0

Thread model: posix

$ xcode-select -v

xcode-select version 2333.

 

3.     Following command is successful:

  $ cmake-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=lld -DCMAKE_INSTALL_PREFIX=/testlocation/llvm_siri../llvm-stable

  CMakeDeprecation Warning at CMakeLists.txt:14 (cmake_policy):

 The OLD behavior for policy CMP0051 will be removed from a futureversion

 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 onlyunder

 specific short-term circumstances. Projects should be ported to the NEW

 behavior and not rely on setting a policy to OLD.

 

 

-- The C compiler identification isAppleClang 6.0.0.6000057

-- The CXX compiler identificationis AppleClang 6.0.0.6000057

-- The ASM compiler identificationis AppleClang

-- Found assembler:/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

-- 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

-- Found libtool -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool

-- Looking for dlfcn.h

-- Looking for dlfcn.h - found

-- Looking for errno.h

-- Looking for errno.h - found

-- Looking for fcntl.h

-- Looking for fcntl.h - found

-- Looking for link.h

-- Looking for link.h - not found

-- Looking for malloc.h

-- Looking for malloc.h - not found

-- Looking for malloc/malloc.h

-- Looking for malloc/malloc.h -found

-- Looking for pthread.h

-- Looking for pthread.h - found

-- Looking for signal.h

-- Looking for signal.h - found

-- Looking for sys/ioctl.h

-- Looking for sys/ioctl.h - found

-- Looking for sys/mman.h

-- Looking for sys/mman.h - found

-- Looking for sys/param.h

-- Looking for sys/param.h - found

-- Looking for sys/resource.h

-- Looking for sys/resource.h -found

-- Looking for sys/stat.h

-- Looking for sys/stat.h - found

-- Looking for sys/time.h

-- Looking for sys/time.h - found

-- Looking for sys/types.h

-- Looking for sys/types.h - found

-- Looking for termios.h

-- Looking for termios.h - found

-- Looking for unistd.h

-- Looking for unistd.h - found

-- Looking for valgrind/valgrind.h

-- Looking for valgrind/valgrind.h- not found

-- Looking for zlib.h

-- Looking for zlib.h - found

-- Looking for fenv.h

-- Looking for fenv.h - found

-- Looking for FE_ALL_EXCEPT

-- Looking for FE_ALL_EXCEPT -found

-- Looking for FE_INEXACT

-- Looking for FE_INEXACT - found

-- Looking for mach/mach.h

-- Looking for mach/mach.h - found

-- Looking for histedit.h

-- Looking for histedit.h - found

-- Looking forCrashReporterClient.h

-- Looking forCrashReporterClient.h - not found

-- Performing TestHAVE_CRASHREPORTER_INFO

-- Performing TestHAVE_CRASHREPORTER_INFO - Success

-- Looking for pthread_create inpthread

-- Looking for pthread_create inpthread - found

-- Looking for pthread_getspecificin pthread

-- Looking for pthread_getspecificin pthread - found

-- Looking for pthread_rwlock_initin pthread

-- Looking for pthread_rwlock_initin pthread - found

-- Looking for pthread_mutex_lockin pthread

-- Looking for pthread_mutex_lockin pthread - found

-- Looking for dlopen in dl

-- Looking for dlopen in dl - found

-- Looking for clock_gettime in rt

-- Looking for clock_gettime in rt- not found

-- Looking for pfm_initialize inpfm

-- Looking for pfm_initialize inpfm - not found

-- Looking for pthread.h

-- Looking for pthread.h - found

-- Looking for pthread_create

-- Looking for pthread_create -found

-- Found Threads: TRUE

-- Looking for compress2 in z

-- Looking for compress2 in z -found

-- Looking for el_init in edit

-- Looking for el_init in edit -found

-- Looking for setupterm in tinfo

-- Looking for setupterm in tinfo -not found

-- Looking for setupterm interminfo

-- Looking for setupterm in terminfo- not found

-- Looking for setupterm in curses

-- Looking for setupterm in curses- found

-- Found LibXml2:/usr/lib/libxml2.dylib (found version "2.9.0")

-- Looking for xar_open in xar

-- Looking for xar_open in xar -found

-- Looking for arc4random

-- Looking for arc4random - found

-- Looking for backtrace

-- Looking for backtrace - found

-- backtrace facility detected indefault set of libraries

-- Found Backtrace: /usr/include

-- Performing TestC_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW

-- Performing TestC_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed

-- Looking for _Unwind_Backtrace

-- Looking for _Unwind_Backtrace -found

-- Looking for getpagesize

-- Looking for getpagesize - found

-- Looking for sysconf

-- Looking for sysconf - found

-- Looking for getrusage

-- Looking for getrusage - found

-- Looking for setrlimit

-- Looking for setrlimit - found

-- Looking for isatty

-- Looking for isatty - found

-- Looking for futimens

-- Looking for futimens - not found

-- Looking for futimes

-- Looking for futimes - found

-- Looking for posix_fallocate

-- Looking for posix_fallocate -not found

-- Looking for lseek64

-- Looking for lseek64 - not found

-- Looking for mallctl

-- Looking for mallctl - not found

-- Looking for mallinfo

-- Looking for mallinfo - not found

-- Looking formalloc_zone_statistics

-- Looking formalloc_zone_statistics - found

-- Looking for getrlimit

-- Looking for getrlimit - found

-- Looking for posix_spawn

-- Looking for posix_spawn - found

-- Looking for pread

-- Looking for pread - found

-- Looking for realpath

-- Looking for realpath - found

-- Looking for sbrk

-- Looking for sbrk - found

-- Looking for strerror

-- Looking for strerror - found

-- Looking for strerror_r

-- Looking for strerror_r - found

-- Looking for strerror_s

-- Looking for strerror_s - notfound

-- Looking for setenv

-- Looking for setenv - found

-- Looking for dlopen

-- Looking for dlopen - found

-- Looking for dladdr

-- Looking for dladdr - found

-- Looking for __GLIBC__

-- Looking for __GLIBC__ - notfound

-- Looking for sched_getaffinity

-- Looking for sched_getaffinity -not found

-- Looking for CPU_COUNT

-- Looking for CPU_COUNT - notfound

-- Looking for pthread_getname_np

-- Looking for pthread_getname_np -found

-- Looking for pthread_setname_np

-- Looking for pthread_setname_np -found

-- Performing TestHAVE_CXX_ATOMICS_WITHOUT_LIB

-- Performing TestHAVE_CXX_ATOMICS_WITHOUT_LIB - Success

-- Performing TestHAVE_CXX_ATOMICS64_WITHOUT_LIB

-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB- Success

-- Performing Test LLVM_HAS_ATOMICS

-- Performing Test LLVM_HAS_ATOMICS- Success

-- Performing TestSUPPORTS_VARIADIC_MACROS_FLAG

-- Performing TestSUPPORTS_VARIADIC_MACROS_FLAG - Success

-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG

-- Performing TestSUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Success

-- Native target architecture isX86

-- Threads enabled.

-- Doxygen disabled.

-- Go bindings disabled.

-- Found ld64 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld

-- Could NOT find OCaml (missing:OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)

-- Could NOT find OCaml (missing:OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)

-- OCaml bindings disabled.

-- Could NOT find Python modulepygments

-- Could NOT find Python modulepygments.lexers.c_cpp

-- Could NOT find Python moduleyaml

-- LLVM host triple:x86_64-apple-darwin13.4.0

-- LLVM default target triple:x86_64-apple-darwin13.4.0

-- Performing Test C_SUPPORTS_FPIC

-- Performing Test C_SUPPORTS_FPIC- Success

-- Performing TestCXX_SUPPORTS_FPIC

-- Performing TestCXX_SUPPORTS_FPIC - Success

-- Building with -fPIC

-- Performing TestSUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG

-- Performing TestSUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success

-- Performing TestC_SUPPORTS_WERROR_DATE_TIME

-- Performing TestC_SUPPORTS_WERROR_DATE_TIME - Failed

-- Performing TestCXX_SUPPORTS_WERROR_DATE_TIME

-- Performing TestCXX_SUPPORTS_WERROR_DATE_TIME - Failed

-- Performing TestCXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW

-- Performing TestCXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed

-- Performing TestCXX_SUPPORTS_CXX11

-- Performing TestCXX_SUPPORTS_CXX11 - Success

-- Performing TestCXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG

-- Performing TestCXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success

-- Performing TestC_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG

-- Performing TestC_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success

-- Performing TestCXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG

-- Performing TestCXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success

-- Performing TestCXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR

-- Performing TestCXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR - Failed

-- Performing TestC_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG

-- Performing TestC_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success

-- Performing TestCXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG

-- Performing TestCXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success

-- Performing TestC_WCOMMENT_ALLOWS_LINE_WRAP

-- Performing TestC_WCOMMENT_ALLOWS_LINE_WRAP - Success

-- Performing TestC_SUPPORTS_STRING_CONVERSION_FLAG

-- Performing TestC_SUPPORTS_STRING_CONVERSION_FLAG - Success

-- Performing TestCXX_SUPPORTS_STRING_CONVERSION_FLAG

-- Performing TestCXX_SUPPORTS_STRING_CONVERSION_FLAG - Success

-- Found PythonInterp:/usr/bin/python2.7 (found version "2.7.5")

-- Constructing LLVMBuild projectinformation

-- Targeting AArch64

-- Targeting AMDGPU

-- Targeting ARM

-- Targeting BPF

-- Targeting Hexagon

-- Targeting Lanai

-- Targeting Mips

-- Targeting MSP430

-- Targeting NVPTX

-- Targeting PowerPC

-- Targeting Sparc

-- Targeting SystemZ

-- Targeting X86

-- Targeting XCore

-- LLD version: 7.0.0

-- Configuring done

 

 

-- Generating done

-- Build files have been writtento: /testlocation/llvm_lld/build

 

4.     But on running ‘make install’, following erroris observed:

$ make install

Scanning dependencies of targetLLVMDemangle

[ 0%] Building CXX objectlib/Demangle/CMakeFiles/LLVMDemangle.dir/ItaniumDemangle.cpp.o

[ 0%] Linking CXX static library ../libLLVMDemangle.a

[ 0%] Built target LLVMDemangle

Scanning dependencies of targetLLVMSupport

[ 0%] Building CXX objectlib/Support/CMakeFiles/LLVMSupport.dir/AMDGPUMetadata.cpp.o

In file included from /testlocation/llvm_lld/llvm-stable/lib/Support/AMDGPUMetadata.cpp:18:

In file included from /testlocation/llvm_lld/llvm-stable/include/llvm/Support/YAMLTraits.h:23:

In file included from /testlocation/llvm_lld/llvm-stable/include/llvm/Support/SourceMgr.h:25:

In file included from /testlocation/llvm_lld/llvm-stable/include/llvm/Support/MemoryBuffer.h:23:

In file included from /testlocation/llvm_lld/llvm-stable/include/llvm/Support/FileSystem.h:33:

In file included from /testlocation/llvm_lld/llvm-stable/include/llvm/Support/Chrono.h:14:

/testlocation/llvm_lld/llvm-stable/include/llvm/Support/FormatProviders.h:267:25:error: no viable conversion from

      'const char [2]' to 'llvm::StringLiteral'

                  .Case("Y", B ?"YES" : "NO")

                        ^~~

/testlocation/llvm_lld/llvm-stable/include/llvm/ADT/StringRef.h:857:9:note: candidate constructor

      (the implicit copy constructor) notviable: no known conversion from 'const char [2]' to 'const llvm::StringLiteral&' for 1st

      argument

 class StringLiteral : public StringRef {

        ^

/testlocation/llvm_lld/llvm-stable/include/llvm/ADT/StringRef.h:857:9:note: candidate constructor

      (the implicit move constructor) notviable: no known conversion from 'const char [2]' to 'llvm::StringLiteral&&' for 1st

      argument

 class StringLiteral : public StringRef {

        ^

/testlocation/llvm_lld/llvm-stable/include/llvm/ADT/StringRef.h:864:15:note: candidate disabled: invalid string literal

   constexpr StringLiteral(const char (&Str)[N])

              ^

/testlocation/llvm_lld/llvm-stable/include/llvm/ADT/StringSwitch.h:70:36:note: passing argument to parameter 'S' here

 StringSwitch &Case(StringLiteral S, T Value) {

                                   ^

1 error generated.

make[2]: ***[lib/Support/CMakeFiles/LLVMSupport.dir/AMDGPUMetadata.cpp.o] Error 1

make[1]: ***[lib/Support/CMakeFiles/LLVMSupport.dir/all] Error 2

make: *** [all] Error 2



 
 Please let me know how to resolve this error. 
Regards,Vinay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180514/f57d6622/attachment.html>


More information about the llvm-dev mailing list