From: Pedro A. <ped...@po...> - 2007-02-23 01:10:13
|
Brian Elmegaard wrote: > > I am struggling to make dlltool give me a lib file that can be used to > create matlab extensions with gcc. mexdlltool is a revised version of > dlltool that is distributed with gnumex (http://gnumex.sf.net). The > output from mexdlltool works, but the output from dlltool doesn't. > > When I check the output of an nm run on the output of the two dlltools > I see the following difference between the two relavant entries: > > dlltool gives: > dames00026.o: > 00000000 b .bss > 00000000 d .data > 00000000 i .idata$4 > 00000000 i .idata$5 > 00000000 i .idata$6 > 00000000 i .idata$7 > 00000000 t .text > U __head_lllmx_lib > 00000000 I __imp__MXCOPYPTRTOREAL8@12 > 00000000 T _MXCOPYPTRTOREAL8@12 > > dames00025.o: > 00000000 b .bss > 00000000 d .data > 00000000 i .idata$4 > 00000000 i .idata$5 > 00000000 i .idata$6 > 00000000 i .idata$7 > 00000000 t .text > U __head_lllmx_lib > 00000000 I __imp__MXCOPYPTRTOREAL8 > 00000000 T _MXCOPYPTRTOREAL8 > > > mexdlltool gives: > ds00026.o: > 00000000 b .bss > 00000000 d .data > 00000000 i .idata$4 > 00000000 i .idata$5 > 00000000 i .idata$6 > 00000000 i .idata$7 > 00000000 t .text > U __head_libmx_lib > 00000000 I __imp__MXCOPYPTRTOREAL8@12 > 00000000 T _MXCOPYPTRTOREAL8 > 00000000 T _MXCOPYPTRTOREAL8@12 > > ds00025.o: > 00000000 b .bss > 00000000 d .data > 00000000 i .idata$4 > 00000000 i .idata$5 > 00000000 i .idata$6 > 00000000 i .idata$7 > 00000000 t .text > U __head_libmx_lib > 00000000 I __imp__MXCOPYPTRTOREAL8 > 00000000 T _MXCOPYPTRTOREAL8 > Saving everyone the trouble of copy/pasting/diffing: --- dlltool.txt 2007-02-22 19:28:52.000000000 +0000 +++ mexdlltool.txt 2007-02-22 19:29:08.000000000 +0000 @@ -1,4 +1,4 @@ -dames00026.o: +ds00026.o: 00000000 b .bss 00000000 d .data 00000000 i .idata @@ -6,11 +6,12 @@ dames00026.o: 00000000 i .idata 00000000 i .idata 00000000 t .text - U __head_lllmx_lib + U __head_libmx_lib 00000000 I __imp__MXCOPYPTRTOREAL8@12 +00000000 T _MXCOPYPTRTOREAL8 00000000 T _MXCOPYPTRTOREAL8@12 -dames00025.o: +ds00025.o: 00000000 b .bss 00000000 d .data 00000000 i .idata @@ -18,6 +19,6 @@ dames00025.o: 00000000 i .idata 00000000 i .idata 00000000 t .text - U __head_lllmx_lib + U __head_libmx_lib 00000000 I __imp__MXCOPYPTRTOREAL8 00000000 T _MXCOPYPTRTOREAL8 > Can dlltool make the same output as mexdlltool by using the right > switches? > At first look, it seems that --add-stdcall-alias would do the trick (_MXCOPYPTRTOREAL8, _MXCOPYPTRTOREAL8@12), but going to the webpage you sited: http://gnumex.sourceforge.net/ and following the link to the "a general description of the problem": http://sources.redhat.com/ml/binutils/2001-12/msg00471.html I don't know if it would work. Have no idea if dlltool was already "fixed" as they say, perhaps you could try it out, and if it doesn't work, try to port that patch into current binutils? Cheers, Pedro Alves |