<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi all,</div><div><br></div><div>(Sorry if the answer to this is obvious - and thanks in advance~)</div><div><br></div><div>Short version:</div><div>linker error of _backtrace from LLVMSystem.a building a dynamic library embedding LLVM/clang, both against the OSX 10.4 sdk.</div><div><br></div><div>Long version:</div><div>I've just tried rebuilding my project using the 2.6 release, using the following commands to try and force LLVM to build against the OSX 10.4 sdk (I am actually doing this on an OS X 10.5.8 system):</div><div><br></div><div><div>env MACOSX_DEPLOYMENT_TARGET=10.4 ./configure --enable-targets=x86 --enable-jit --enable-optimized --enable-pic</div><div>env MACOSX_DEPLOYMENT_TARGET=10.4 make UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/</div><div><br></div><div>This seems to work fine. </div><div><br></div><div>However, my project is a dynamic library in which LLVM/Clang are embedded for adding runtime JIT capability to an existing application, but in attempting to build, I get a linker error on _backtrace from LLVMSystem.a. </div><div><br></div><div>Is this a simple mistake on my part, or is LLVM not supported against the 10.4 sdk? The problem disappears if I build against 10.5 sdk (using llvm-gcc 4.2), but unfortunately that's not possible for the application in question. Here's the (abriged) build command:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; ">CompileC build/Objects-normal/i386/gen_codegen.o gen_codegen.cpp normal i386 c++ com.apple.compilers.gcc.4_0</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; ">    cd llvm</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; ">    /Developer/usr/bin/gcc-4.0 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fvisibility-inlines-hidden -mmacosx-version-min=10.4 -gdwarf-2 -iquote /build/codegen.build/codegen-generated-files.hmap -I/llvm/build/codegen.build/codegen-own-target-headers.hmap -I/codegen.build/codegen-all-target-headers.hmap -iquote /build/codegen.build/codegen-project-headers.hmap -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/build/Development -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon -I/llvm/llvm-2.6/include -I/build/codegen.build/DerivedSources -DLUA_USE_MACOSX -DLUA_USE_DLOPEN -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -include /macho-prefix.pch -c /llvm/gen_codegen.cpp -o /build/codegen.build/Objects-normal/i386/gen_codegen.o</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; ">Ld "/sysbuild/Development/codegen.mxo/Contents/MacOS/codegen" normal i386</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; ">    cd /llvm</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; ">    setenv MACOSX_DEPLOYMENT_TARGET 10.4</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; ">    /Developer/usr/bin/g++-4.0 -arch i386 -bundle -isysroot /Developer/SDKs/MacOSX10.4u.sdk -L/build/Development -L/llvm-2.6/lib_osx -F/build/Development -filelist /build/codegen.build/Objects-normal/i386/codegen.LinkFileList -mmacosx-version-min=10.4 -lCompilerDriver -lLLVMAnalysis -lLLVMArchive -lLLVMAsmParser -lLLVMAsmPrinter -lLLVMBitReader -lLLVMBitWriter -lLLVMCodeGen -lLLVMCore -lLLVMDebugger -lLLVMExecutionEngine -lLLVMInstrumentation -lLLVMInterpreter -lLLVMipa -lLLVMipo -lLLVMJIT -lLLVMLinker -lLLVMMC -lLLVMScalarOpts -lLLVMSelectionDAG -lLLVMSupport -lLLVMSystem -lLLVMTarget -lLLVMTransformUtils -lLLVMX86AsmParser -lLLVMX86AsmPrinter -lLLVMX86CodeGen -lLLVMX86Info -lLTO -lLTO -lplugin_llvmc_Base -lplugin_llvmc_Clang -lprofile_rt -framework MaxAudioAPI -framework MaxAPI -framework Carbon -o "/sysbuild/Development/codegen.mxo/Contents/MacOS/codegen"</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; "><i>Undefined symbols:</i></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; "><i>  "_backtrace", referenced from:</i></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; "><i>      PrintStackTrace(void*) in libLLVMSystem.a(Signals.o)</i></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; "><i>ld: symbol(s) not found</i></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; "><i>collect2: ld returned 1 exit status</i></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 32px; text-indent: -32px; font: normal normal normal 11px/normal Courier; min-height: 13px; "><br></div></div></div><br><div><div>On Jan 14, 2009, at 3:43 PM, Graham Wakefield wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi,</div><div><br></div><div>For the record, adding </div><div>  UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/ </div><div>was insufficient to restrict the .a/.o files to link against the 10.4 sdk, but </div><div>  env MACOSX_DEPLOYMENT_TARGET=10.4 make </div><div>did the trick. </div><div><br></div><div>Thanks!</div><div><br></div><div><div>On Jan 14, 2009, at 1:29 PM, Jean-Daniel Dupas wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Le 14 janv. 09 à 21:48, Chris Lattner a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 14, 2009, at 12:44 PM, Graham Wakefield wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Sorry if this is a newb q... I'm developing an application on a 10.5 machine but want to target the 10.4 SDK. Is there a magic incantation for the llvm configure script to set the sysroot path, equivalent to e.g. --with-sysroot <span class="Apple-style-span" style="font-family: -webkit-monospace; font-size: 10px; white-space: pre; ">"/Developer/SDKs/MacOSX10.4u.sdk"<span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; white-space: normal; ">? </span></span><div><br></div></div></blockquote>Try 'make UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/'.</div><div><br></div><div>There are some comments in llvm/Makefile.rules that can help,</div><div></div></div></blockquote></div><br><div>Note that you don't have to use 10.4 SDK to target Tiger. You just have to set the "macosx version min" (either using the gcc flag -mmacosx-version-min=10.4 or using the MACOSX_DEPLOYMENT_TARGET env var)</div><div><br></div><div>env MACOSX_DEPLOYMENT_TARGET=10.4 make </div><div><br></div><div><br></div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div>_______________________________________________<br>LLVM Developers mailing list<br>LLVMdev@cs.uiuc.edu         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></body></html>