[LLVMdev] Link error with TOOLLINKOPTS=-ldbghelp on MinGW

John Criswell criswell at cs.uiuc.edu
Mon Oct 25 12:10:15 PDT 2004


Henrik Bach wrote:
> Hi LLVM'ers
> 
> When linking tblgen tool I get below error message on MinGW.
> 
> I have put TOOLLINKOPTS=-ldbghelp in Makefile.config.
> 
> However, when rearranging library dbghelp to the end of the g++
> line, tblgen gets linked.

It seems that the -L path options are specified before the LLVM 
libraries (libSystem and libsupport) are linked in.  I think g++ may 
only search linker paths that are specified before a library is specified.

Perhaps you need to make sure that all library paths are specified 
before listing the libraries to link in.

In other words,

g++ -Lpath1 -Lpath2 -ldbghelp -lSystem

...instead of...

g++ -ldbghelp -lSystem -Lpath1 -Lpath2

Just a guess; can anyone verify this?

-- John T.

> 
> --------------------------
> make[2]: Entering directory `/C/Projects/build/MinGW/llvm/utils/TableGen'
> Linking Debug executable tblgen
> /C/Projects/build/MinGW/llvm/mklib --tag=disable-shared --tag=CXX 
> --mode=link g++ -I/C/Projects/build/MinGW/llvm/utils/TableGen 
> -I/C/Projects/build/MinGW/llvm/../../../src/llvm/utils/TableGen 
> -I/C/Projects/build/MinGW/llvm/../../../src/llvm/include 
> -I/C/Projects/build/MinGW/llvm/include 
> -I/C/Projects/build/MinGW/llvm/include 
> -I/C/Projects/build/MinGW/llvm/../../../src/llvm/include -D_GNU_SOURCE 
> -D__STDC_LIMIT_MACROS -D__MINGW -Wall -W -Wwrite-strings -Wno-unused -g 
> -D_DEBUG -rpath /C/Projects/build/MinGW/llvm/tools/Debug -export-dynamic 
> -ldbghelp -L/C/Projects/build/MinGW/llvm/lib/Debug 
> -L/C/Projects/build/MinGW/llvm/lib/Debug -o 
> /C/Projects/build/MinGW/llvm/tools/Debug/tblgen 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/AsmWriterEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/CodeEmitterGen.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/CodeGenTarget.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/FileLexer.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/FileParser.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/InstrInfoEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/InstrSelectorEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/Record.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/RegisterInfoEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/TableGen.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/TableGenBackend.o 
> -lsupport -lLLVMsystem
> /C/Projects/build/MinGW/llvm/mklib --tag=disable-shared --tag=CXX 
> --mode=link g++ -I/C/Projects/build/MinGW/llvm/utils/TableGen 
> -I/C/Projects/build/MinGW/llvm/../../../src/llvm/utils/TableGen 
> -I/C/Projects/build/MinGW/llvm/../../../src/llvm/include 
> -I/C/Projects/build/MinGW/llvm/include 
> -I/C/Projects/build/MinGW/llvm/include 
> -I/C/Projects/build/MinGW/llvm/../../../src/llvm/include -D_GNU_SOURCE 
> -D__STDC_LIMIT_MACROS -D__MINGW -Wall -W -Wwrite-strings -Wno-unused  -g 
> -D_DEBUG  -rpath /C/Projects/build/MinGW/llvm/tools/Debug 
> -export-dynamic -ldbghelp -L/C/Projects/build/MinGW/llvm/lib/Debug 
> -L/C/Projects/build/MinGW/llvm/lib/Debug  -o 
> /C/Projects/build/MinGW/llvm/tools/Debug/tblgen 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/AsmWriterEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/CodeEmitterGen.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/CodeGenTarget.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/FileLexer.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/FileParser.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/InstrInfoEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/InstrSelectorEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/Record.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/RegisterInfoEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/TableGen.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/TableGenBackend.o 
> -lsupport -lLLVMsystem
> g++ -I/C/Projects/build/MinGW/llvm/utils/TableGen 
> -I/C/Projects/build/MinGW/llvm/../../../src/llvm/utils/TableGen 
> -I/C/Projects/build/MinGW/llvm/../../../src/llvm/include 
> -I/C/Projects/build/MinGW/llvm/include 
> -I/C/Projects/build/MinGW/llvm/include 
> -I/C/Projects/build/MinGW/llvm/../../../src/llvm/include -D_GNU_SOURCE 
> -D__STDC_LIMIT_MACROS -D__MINGW -Wall -W -Wwrite-strings -Wno-unused -g 
> -D_DEBUG -o /C/Projects/build/MinGW/llvm/tools/Debug/tblgen 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/AsmWriterEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/CodeEmitterGen.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/CodeGenTarget.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/FileLexer.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/FileParser.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/InstrInfoEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/InstrSelectorEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/Record.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/RegisterInfoEmitter.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/TableGen.o 
> /C/Projects/build/MinGW/llvm/utils/TableGen/Debug/TableGenBackend.o 
> -Wl,--export-dynamic  -ldbghelp -L/C/Projects/build/MinGW/llvm/lib/Debug 
> -lsupport -lLLVMsystem -L/C/Projects/build/MinGW/llvm/tools/Debug
> c:/Projects/build/MinGW/llvm/lib/Debug/libLLVMsystem.a(Signals.o)(.text+0x8a3): 
> In function `Z28LLVMUnhandledExceptionFilterP19_EXCEPTION_POINTERS':
> --------------------------
> 
> Any suggestions?
> 
> Henrik
> 
> _________________________________________________________________
> Find det, du søger på MSN Søg http://search.msn.dk
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev


-- 
*********************************************************************
* John T. Criswell                         Email: criswell at uiuc.edu *
* Research Programmer                                               *
* University of Illinois at Urbana-Champaign                        *
*                                                                   *
* "It's today!" said Piglet. "My favorite day," said Pooh.          *
*********************************************************************




More information about the llvm-dev mailing list