[LLVMbugs] [Bug 22631] New: llvm fails to build on Lion and earlier due to use of environ in a dylib

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 18 22:53:30 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22631

            Bug ID: 22631
           Summary: llvm fails to build on Lion and earlier due to use of
                    environ in a dylib
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
          Assignee: unassignedbugs at nondot.org
          Reporter: jeremyhu at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

OS X versions earlier than 10.8 are unable to use environ directly.  That
symbol is provided in crt1.o to executables on earlier versions of OS X rather
than libdyld (which provides it on Mountain Lion and newer).  As such, llvm
trunk r229298 is failing to compile:

/opt/local/bin/clang++-mp-3.4 -pipe -Os -arch x86_64 -stdlib=libc++ -pipe -Os
-arch x86_64 -stdlib=libc++ -O3 -Wl,-install_name
-Wl,"/opt/local/libexec/llvm-3.7/lib/libLLVM-3.7svn.dylib" -Wl,-dead_strip
-rdynamic -Wl,-rpath -Wl, at executable_path/../lib
-L/opt/local/var/macports/build/_opt_mports_dports_lang_llvm-3.7/llvm-3.7/work/trunk/Release+Debug+Asserts/lib
-L/opt/local/var/macports/build/_opt_mports_dports_lang_llvm-3.7/llvm-3.7/work/trunk/Release+Debug+Asserts/lib
-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -L/opt/local/lib
-Wl,-headerpad_max_install_names -arch x86_64 -m64  -dynamiclib
-mmacosx-version-min=10.6 -o
/opt/local/var/macports/build/_opt_mports_dports_lang_llvm-3.7/llvm-3.7/work/trunk/Release+Debug+Asserts/lib/libLLVM-3.7svn.dylib
/opt/local/var/macports/build/_opt_mports_dports_lang_llvm-3.7/llvm-3.7/work/trunk/tools/llvm-shlib/Release+Debug+Asserts/libllvm.o
\
       -lLLVMAArch64AsmParser -lLLVMAArch64AsmPrinter -lLLVMAArch64CodeGen
-lLLVMAArch64Desc -lLLVMAArch64Disassembler -lLLVMAArch64Info
-lLLVMAArch64Utils -lLLVMARMAsmParser -lLLVMARMAsmPrinter -lLLVMARMCodeGen
-lLLVMARMDesc -lLLVMARMDisassembler -lLLVMARMInfo -lLLVMAnalysis
-lLLVMAsmParser -lLLVMAsmPrinter -lLLVMBitReader -lLLVMBitWriter -lLLVMCodeGen
-lLLVMCore -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo -lLLVMDebugInfoDWARF
-lLLVMDebugInfoPDB -lLLVMExecutionEngine -lLLVMHexagonCodeGen -lLLVMHexagonDesc
-lLLVMHexagonDisassembler -lLLVMHexagonInfo -lLLVMIRReader -lLLVMInstCombine
-lLLVMInstrumentation -lLLVMInterpreter -lLLVMLTO -lLLVMLineEditor -lLLVMLinker
-lLLVMMC -lLLVMMCDisassembler -lLLVMMCJIT -lLLVMMCParser -lLLVMMSP430AsmPrinter
-lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMipsAsmParser
-lLLVMMipsAsmPrinter -lLLVMMipsCodeGen -lLLVMMipsDesc -lLLVMMipsDisassembler
-lLLVMMipsInfo -lLLVMNVPTXAsmPrinter -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc
-lLLVMNVPTXInfo -lLLVMObjCARCOpts -lLLVMObject -lLLVMOption -lLLVMOrcJIT
-lLLVMPowerPCAsmParser -lLLVMPowerPCAsmPrinter -lLLVMPowerPCCodeGen
-lLLVMPowerPCDesc -lLLVMPowerPCDisassembler -lLLVMPowerPCInfo -lLLVMProfileData
-lLLVMR600AsmParser -lLLVMR600AsmPrinter -lLLVMR600CodeGen -lLLVMR600Desc
-lLLVMR600Info -lLLVMRuntimeDyld -lLLVMScalarOpts -lLLVMSelectionDAG
-lLLVMSparcAsmParser -lLLVMSparcAsmPrinter -lLLVMSparcCodeGen -lLLVMSparcDesc
-lLLVMSparcDisassembler -lLLVMSparcInfo -lLLVMSupport -lLLVMSystemZAsmParser
-lLLVMSystemZAsmPrinter -lLLVMSystemZCodeGen -lLLVMSystemZDesc
-lLLVMSystemZDisassembler -lLLVMSystemZInfo -lLLVMTarget -lLLVMTransformUtils
-lLLVMVectorize -lLLVMX86AsmParser -lLLVMX86AsmPrinter -lLLVMX86CodeGen
-lLLVMX86Desc -lLLVMX86Disassembler -lLLVMX86Info -lLLVMX86Utils
-lLLVMXCoreAsmPrinter -lLLVMXCoreCodeGen -lLLVMXCoreDesc
-lLLVMXCoreDisassembler -lLLVMXCoreInfo -lLLVMipa -lLLVMipo -all_load -lz
-lpthread -lffi -ledit -lcurses -lm 
Undefined symbols for architecture x86_64:
  "_environ", referenced from:
      Execute(llvm::sys::ProcessInfo&, llvm::StringRef, char const**, char
const**, llvm::StringRef const**, unsigned int, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >*) in
libLLVMSupport.a(Program.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


You're misusing TargetConditionals.h

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150219/06dd04d7/attachment.html>


More information about the llvm-bugs mailing list