#125 dllwrap parameters

OTHER
closed
nobody
binutils (105)
wont-fix
Known_bugs
2013-01-21
2002-03-17
Gábor Lipták
No

GNU c:\MinGW\bin\dllwrap.exe 2.11.92 20011112

Warning long example follows.

It seems that I cannot specify my -l correctly using -l
python22.a fails in one place, using -l python22, fails
in another place.

I'm running dllwrap with these parameters:

$ dllwrap --dllname example.pyd --driver-name g++ --def
example.def -o example.
pyd example.o -s --entry _DllMain@12
--target=i386-mingw32 -Lc:\Python22\libs -
l python22.a --verbose
c:\MinGW\bin\dllwrap.exe: Using file: c:\MinGW\bin\dlltool
DLLTOOL name : c:\MinGW\bin\dlltool
DLLTOOL options : -v --dllname example.pyd
--exclude-symbol=DllMain@12 --def ex
ample.def
DRIVER name : g++
DRIVER options : -mdll -o example.pyd
-Wl,-e,_DllMain@12 -Wl,--image-base,0x6EA
00000 -v example.o -s -Lc:Python22libs -l python22.a
g++ -Wl,--base-file,c:\tmp/cca03468.base -mdll -o
example.pyd -Wl,-e,_DllMain@12
-Wl,--image-base,0x6EA00000 -v example.o -s
-Lc:Python22libs -l python22.a
Reading specs from
c:/MinGW/bin/../lib/gcc-lib/mingw32/2.95.3-6/specs
gcc version 2.95.3-6 (mingw special)
c:\MinGW\bin\..\lib\gcc-lib\mingw32\2.95.3-6\..\..\..\..\mingw32\bin\ld.exe --d
ll -Bdynamic -e _DllMainCRTStartup@12 -o example.pyd -s
c:/MinGW/bin/../lib/gcc-
lib/mingw32/2.95.3-6/../../../dllcrt2.o
-Lc:Python22libs -Lc:/MinGW/bin/../lib/g
cc-lib/mingw32/2.95.3-6 -Lc:/MinGW/bin/../lib/gcc-lib
-L/mingw/lib/gcc-lib/mingw
32/2.95.3-6
-Lc:/MinGW/bin/../lib/gcc-lib/mingw32/2.95.3-6/../../../../mingw32/l
ib
-L/mingw/lib/gcc-lib/mingw32/2.95.3-6/../../../../mingw32/lib
-Lc:/MinGW/bin/
../lib/gcc-lib/mingw32/2.95.3-6/../../..
-L/mingw/lib/gcc-lib/mingw32/2.95.3-6/.
./../.. --base-file c:\tmp/cca03468.base -e _DllMain@12
--image-base 0x6EA00000
example.o -l python22.a -lstdc++ -lmingw32 -lgcc
-lmoldname -lmsvcrt -luser32 -l
kernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc
-lmoldname -lmsvcrt
c:\MinGW\bin\..\lib\gcc-lib\mingw32\2.95.3-6\..\..\..\..\mingw32\bin\ld.exe:
can
not find -lpython22.a
c:\MinGW\bin\dllwrap.exe: g++ exited with status 1
c:\MinGW\bin\dllwrap.exe: Deleting temporary base file
c:\tmp/cca03468.base

or when running:

$ dllwrap --dllname example.pyd --driver-name g++ --def
example.def -o example.
pyd example.o -s --entry _DllMain@12
--target=i386-mingw32 -Lc:\Python22\libs -
l python22 --verbose
c:\MinGW\bin\dllwrap.exe: Using file: c:\MinGW\bin\dlltool
DLLTOOL name : c:\MinGW\bin\dlltool
DLLTOOL options : -v --dllname example.pyd
--exclude-symbol=DllMain@12 --def ex
ample.def
DRIVER name : g++
DRIVER options : -mdll -o example.pyd
-Wl,-e,_DllMain@12 -Wl,--image-base,0x6EA
00000 -v example.o -s -Lc:Python22libs -l python22
g++ -Wl,--base-file,c:\tmp/cca02764.base -mdll -o
example.pyd -Wl,-e,_DllMain@12
-Wl,--image-base,0x6EA00000 -v example.o -s
-Lc:Python22libs -l python22
g++: python22: No such file or directory
Reading specs from
c:/MinGW/bin/../lib/gcc-lib/mingw32/2.95.3-6/specs
gcc version 2.95.3-6 (mingw special)
c:\MinGW\bin\dllwrap.exe: g++ exited with status 1
c:\MinGW\bin\dllwrap.exe: Deleting temporary base file
c:\tmp/cca02764.base

Running a patched sequence from --dry-run:

g++ -Wl,--base-file,example.base -mdll -o example.pyd
-Wl,-e,_DllMain@12 -Wl,--image-base,0x6EA00000 -v
example.o -s -Lc:\Python22 -Lc:\MinGW\lib -L . -lpython22
ld.exe --dll -Bdynamic -e _DllMainCRTStartup@12 -o
example.pyd -s c:/MinGW/lib/dllcrt2.o -Lc:\Python22
-Lc:/MinGW/lib -L .
-LC:\MinGW\lib\gcc-lib\mingw32\2.95.3-6 --base-file
example.base -e _DllMain@12 --image-base 0x6EA00000
example.o -lpython22 -lstdc++ -lmingw32 -lgcc
-lmoldname -lmsvcrt -luser32 -lkernel32 -ladvapi32
-lshell32 -lmingw32 -lgcc -lmoldname -lmsvcrt
dlltool --base-file example.base --output-exp
example.exp --dllname example.pyd
--exclude-symbol=DllMain@12 --def example.def
g++ example.exp -mdll -o example.pyd -Wl,-e,_DllMain@12
-Wl,--image-base,0x6EA00=000 example.o -s -Lc:\Python22
-Lc:\MinGW\lib -L . -lpython22

Produces the dll (although without the correct export
it seems, but that is the next question).

Please comment.

Discussion

  • Danny Smith
    Danny Smith
    2002-03-20

    Logged In: YES
    user_id=11494

    I'm not sure what kind of comment you are after. It looks
    like dllwrap is choking on backslashes when passing -L and -
    l options to ld. There is also some inconsistency in the
    way you are using -larchive. The backslash problem could
    well be a bug, but one with an easy workaround: Get in the
    habit of using forward slashes.
    I'll have a look at the backslash problem.

    Danny

     
  • Gábor Lipták
    Gábor Lipták
    2002-03-21

    Logged In: YES
    user_id=79346

    Thanks for your pointers.

     
  • Luke Dunstan
    Luke Dunstan
    2002-05-22

    Logged In: YES
    user_id=30442

    The problem is that you are passing unquoted backslashes on
    the 'sh' command line: -Lc:\Python22\libs. You need to
    enclose the argument in quotes or use double backslashes.
    Better yet, use forward slashes as Danny suggests.

    This is not a bug and should be closed.

     
  • Danny Smith
    Danny Smith
    2002-06-23

    • status: open --> closed-wont-fix
     
  • Earnie Boyd
    Earnie Boyd
    2013-01-21

    • labels: ld --> binutils
    • status: closed-wont-fix --> closed
    • assigned_to: Danny Smith --> nobody
    • resolution: --> wont-fix
    • category: --> Known_bugs
    • milestone: --> OTHER