Kevin Kelley
2010-Sep-29 15:29 UTC
[LLVMdev] LLVM2.8rc2 on MinGW 4.5.1 with --enable-shared
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. ...
NAKAMURA Takumi
2010-Sep-29 15:53 UTC
[LLVMdev] LLVM2.8rc2 on MinGW 4.5.1 with --enable-shared
Good midnight, Kevin. cygming/shared might have been broken since r112976, IIRC. (ToT, too) A trivial patch; --- a/Makefile.rules +++ b/Makefile.rules @@ -942,6 +942,11 @@ ifdef EXPORTED_SYMBOL_FILE # First, set up the native export file, which may differ from the source # export file. +# The option --version-script is not effective on GNU ld win32. +ifneq (,$(filter $(HOST_OS),Cygwin MingW)) + HAVE_LINK_VERSION_SCRIPT := 0 +endif + ifeq ($(HOST_OS),Darwin) # Darwin convention prefixes symbols with underscores. NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed ...Takumi 2010/9/30 Kevin Kelley <kevin at kelleysoft.com>:> 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. ... > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Kevin Kelley
2010-Sep-29 17:24 UTC
[LLVMdev] LLVM2.8rc2 on MinGW 4.5.1 with --enable-shared
On 9/29/2010 10:53 AM, NAKAMURA Takumi wrote:> > A trivial patch;Beautiful! That worked perfectly for me. Thanks much. --kevin> --- a/Makefile.rules > +++ b/Makefile.rules > @@ -942,6 +942,11 @@ ifdef EXPORTED_SYMBOL_FILE > # First, set up the native export file, which may differ from the source > # export file. > > +# The option --version-script is not effective on GNU ld win32. > +ifneq (,$(filter $(HOST_OS),Cygwin MingW)) > + HAVE_LINK_VERSION_SCRIPT := 0 > +endif > + > ifeq ($(HOST_OS),Darwin) > # Darwin convention prefixes symbols with underscores. > NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed > > > ...Takumi >
NAKAMURA Takumi
2010-Oct-04 01:53 UTC
[LLVMdev] LLVM2.8rc2 on MinGW 4.5.1 with --enable-shared
Good morning, Bill. I saw my *trivial* patch has been applied in r115093 on branch_28, thank you. The comment says "Disable MinGW & shared because it never worked." but it oughta be a proper thing to activate cygming --enable-shared. ;) May I apply it on ToT, too? ...Takumi 2010/9/30 NAKAMURA Takumi <geek4civic at gmail.com>:> Good midnight, Kevin. > > cygming/shared might have been broken since r112976, IIRC. (ToT, too) > > A trivial patch; > > --- a/Makefile.rules > +++ b/Makefile.rules > @@ -942,6 +942,11 @@ ifdef EXPORTED_SYMBOL_FILE > # First, set up the native export file, which may differ from the source > # export file. > > +# The option --version-script is not effective on GNU ld win32. > +ifneq (,$(filter $(HOST_OS),Cygwin MingW)) > + HAVE_LINK_VERSION_SCRIPT := 0 > +endif > + > ifeq ($(HOST_OS),Darwin) > # Darwin convention prefixes symbols with underscores. > NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed > > > ...Takumi > > > 2010/9/30 Kevin Kelley <kevin at kelleysoft.com>: >> 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. ... >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >
Possibly Parallel Threads
- [LLVMdev] LLVM2.8rc2 on MinGW 4.5.1 with --enable-shared
- [LLVMdev] [PATCH] Capability of Win32.DLL with ENABLE_SHARED
- [LLVMdev] [PATCH] Capability of Win32.DLL with ENABLE_SHARED
- [LLVMdev] [PATCH] Capability of Win32.DLL with ENABLE_SHARED
- [LLVMdev] [patch] EXPORTED_SYMBOL_FILE using mingw and cmake