[LLVMdev] LLVM2.8rc2 on MinGW 4.5.1 with --enable-shared

Kevin Kelley kevin at kelleysoft.com
Wed Sep 29 08:29:04 PDT 2010


Anybody having success building an LLVM.dll in this configuration?
It's failing for me, in tools/llvm-shlib, with an error suggesting
that the gcc ld doesn't understand the format of the exports map
being generated.

(plain configure && make works just fine, it's just this shared
option that fails; google shows support for --enable-shared was
added around 2.7 timeframe and worked for both cygwin and mingw.
MinGW's been getting some activity this year, with regard to
shared libs, so I've been tracking current versions; not sure
whether this is a mingw regression or what's really going on.)


Anywyay, here's what that generated exports map looks like:

$cat tools/llvm-shlib/Release/LLVM-2.8rc.exports.map
{
   global:
     ARMCompilationCallback;
     ARMCompilationCallbackC;
     AlphaCompilationCallback;
     LLVMABIAlignmentOfType;
     LLVMABISizeOfType;
     ...many many more symbols...
     x86DisassemblerThreeByte3AOpcodes DATA;
     x86DisassemblerTwoByteOpcodes DATA;
   local: *;
};

and this is the error:

llvm[0]: Linking Release Shared Library LLVM-2.8rc.dll
c:\MinGW\mingw-nuwen6.6\bin/ld.exe:C:/msys/llvm/rc2/tools/llvm-shlib/Release/LLVM-2.8rc.exports.map: 
file format not recognized; treating as linker script
c:\MinGW\mingw-nuwen6.6\bin/ld.exe:C:/msys/llvm/rc2/tools/llvm-shlib/Release/LLVM-2.8rc.exports.map:1: 
syntax error
collect2: ld returned 1 exit status
make: *** [/llvm/rc2/Release/bin/LLVM-2.8rc.dll] Error 1


So I'm thinking that there's some missing syntax in the map
file, but I don't know what ld expects.  Google didn't help
me there.  :-)

This isn't worth a lot of time, since the static libs work just
fine, but getting shared to work would be nice.  If anybody's
done this, I'd appreciate hearing about it.


Kevin


LLVM checked out from release/2.8/rc2 and configured with:
   ../28rc2/configure --enable-optimized --enable-shared

$ gcc --version
gcc.exe (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc. ...

$ ld --version
GNU ld (GNU Binutils) 2.20.1.20100303
Copyright 2009 Free Software Foundation, Inc. ...



More information about the llvm-dev mailing list