- NSIS Discussion
- debian package advice re System.dll
Archive: debian package advice re System.dll
pabs
30th September 2005 09:50 UTC
debian package advice re System.dll
I've found that if I strip out the code related to System::Call from System.dll, then I can build the dll fine. This results in a fairly crippled System.dll that can't be used in the examples that rely on System.dll, because most of these use System::Call as well as the other functions.
Do people think that the System.dll functions Alloc, Free, Copy, Store and Int64Op are worth shipping a crippled System.dll in debian?
kichik
30th September 2005 12:02 UTC
System::Call is the heart of the plug-in. I think a better idea would be to use some program that converts the ASM code. GCC just wants a different syntax...
pabs
30th September 2005 20:14 UTC
Do you know of any such program? Or some document comparing the two syntaxes?
kichik
30th September 2005 23:14 UTC
I don't know such a program. The two syntaxes are Intel's and AT&T's, as far as I remember. There's also a different in block identifier and type (__asm {mov eax, 1} vs. asm("mov %eax, 1")). I don't remember which names goes to which syntax.
pabs
1st October 2005 02:49 UTC
Suppose I manage to translate the assembly to AT&T syntax, how will this be managed? Will the Intel version change often enough for the AT&T version to become out of sync?
pabs
1st October 2005 06:45 UTC
OK, converted most of the assembly to gcc syntax. I'm getting 3 errors:
build/release/System/Source/System.o:System.c:(.text+0x116f): undefined reference to `proc'
build/release/System/Source/System.o:System.c:(.text+0xf43): undefined reference to `alloca_probe'
build/release/System/Source/System.o:System.c:(.text+0x10b2): undefined reference to `__LOCAL_SIZE'
The first is because I don't know how to refer to function parameters in gcc asm.
The second is because I don't know how to refer to functions in gcc asm.
The third seems to be because the code relies on MSVC's stack layout:
http://msdn.microsoft.com/library/de...m/msmod_15.aspI think it might be easier to strip out all the assembly and write it in C. Any idea if this would be possible?
kichik
1st October 2005 11:36 UTC
It seems impossible to strip it all out. How do you push a variable number of parameters to a function when the number is set at runtime? How do you create a __stdcall function that accepts a variable number of arguments?
The Intel version will probably not change much, but it'd be better to have a script that automatically converts prior to compiling.
pabs
11th October 2005 06:03 UTC
I wrote a script that gets most of the way to an AT&T version, but the remaining 10% (needed for proper comilation) would require implmenting a proper assembly tokeniser. I think it would be much easier to just stick ifdefs around the place and add the AT&T version too.
Would this be acceptable? If so, I hope to get it done in time for inclusion in 2.11.
kichik
11th October 2005 12:33 UTC
Were you able to get around __LOCAL_SIZE and alloca?
An ifdef is acceptable. Of course, a conversion script is always preferable.
pabs
11th October 2005 15:58 UTC
Nope, not yet able to port __LOCAL_SIZE and alloca. I'll keep digging though.
Cool, I'll get working on the ifdefs.
pabs
12th October 2005 10:35 UTC
In wine, alloca_probe just subtracts the value in eax from esp:
http://cvs.winehq.org/cvsweb/wine/dl...-cvsweb-markup
Also found a mention of gcc/__LOCAL_SIZE together:
http://66.102.7.104/search?q=cache:G...__GNUC__&hl=en
kichik
12th October 2005 12:17 UTC
I don't know how WINE handles alloca, but it's more than just subtracting a value from ESP. All references to local variables should be offseted once the value of ESP changes.
kichik
13th October 2005 12:50 UTC
cdecl is not quite the same thing as naked. It does less than stdcall because it doesn't clean up the stack, but it still initializes the stack in the epilog and uninitializes it in the prolog. It also probably pushes registers and makes room for the local variables. At least you won't need __LOCAL_SIZE...
pabs
14th October 2005 04:56 UTC
OK, I'll try that and see if it works.
BTW, this might take a while, so feel free to release in the meantime.
pabs
18th January 2006 05:37 UTC
Not sure if I'll be able to finish this any time soon. I've attached the current unfinished patch for anyone who wants to work on this.
pabs
16th March 2008 04:22 UTC
A Debian user is working on converting the code to pure GCC assembly so that System::Call can be compiled on Linux and other non-Windows operating systems.
http://bugs.debian.org/cgi-bin/bugre...?bug=319999#40
pabs
28th October 2008 01:15 UTC
full System::Call support on Linux, testing needed
Hi all, I've received a patch for full System::Call support on Linux. It changes how System.dll is compiled on Windows and therefore needs testing on Windows too. Please test gcc-system-call-2.patch from here:
http://sf.net/support/tracker.php?aid=2193442
Those of you who build NSIS on Windows using the scons build scripts, I'd be grateful if you could test it. Please also test any installers you can create with it too. The example nsi files from NSIS work fine with it, but it might break some other installer and I don't want any regressions.
pabs
7th November 2008 02:59 UTC
BUMP!
Someone, anyone, please test the latest version of the patch (gcc-system-call-3.patch).
kichik
7th November 2008 22:59 UTC
Builds fine and the example seems to work fine.
pabs
8th November 2008 00:49 UTC
Cool, thanks for testing.
Did you want to review the patch before I commit it?
kichik
8th November 2008 12:02 UTC
I want to give it a very good look before it's committed.
kichik
29th November 2008 22:35 UTC
Committed and will be included in the next version - 2.42.