MSVC hook function prologue

2009-09-02 Thread Stefan Dösinger
at other changes are needed to get a functionality like this into mainline? Thank you, Stefan Dösinger Index: gcc/configure.ac === --- gcc/configure.ac (revision 151348) +++ gcc/configure.ac (working copy) @@ -3035,6 +3035,12

Re: MSVC hook function prologue

2009-09-03 Thread Stefan Dösinger
Am Thursday 03 September 2009 00:04:43 schrieb Paolo Bonzini: >> *) The stack alignment code + msvc_prologue is used by Wine on osx though. >> ... > I don't think this would prevent the patch from getting the patch in. Ok, I'll read the patch contribution guidelines again and hope for the best. I

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Thursday 03 September 2009 00:04:43 schrieb Paolo Bonzini: > (define_insn "vswapmov" > [(set (match_operand 0 "register_operand" "0") >(match_operand 1 "register_operand" "1") > (unspec_volatile [] UNSPECV_VSWAPMOV)] I ran into a problem with this: build/genattrtab doesn't like the emp

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 13:47:20 schrieb Paolo Bonzini: > > I guess the error isn't about the const_int 0, but about operand 0. Any > > ideas? > > Yes, you need this: > > [(set (match_operand:SI 0 "register_operand" "=r") >(match_operand:SI 1 "register_operand" "r")) > (u

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 14:23:39 schrieb Paolo Bonzini: > The parallel is implicit in define_insn, so it is not different. It > does not make any harm I guess, but it looks "weird" to a more familiar > eye. :-) Ok, I removed it again :-) > +#ifdef HAVE_AS_IX86_SWAP > + { "msvc_prologue", 0,

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 14:49:42 schrieb Stefan Dösinger: > I attached another version of the patch - I restarted the compile, so I > still don't know if it fully works. Seems to be working - gcc compiles fine, my test function has the right starting bytes. Wine compiles and runs

CVS/SVN binutils and gcc on MacOS X?

2009-09-04 Thread Stefan Dösinger
Hi, I tried to install binutils from CVS and the gcc SVN code on my mac to test my msvc_prologue work there, but I ran into an interesting problem: When using the SVN gcc with my own as, I cannot compile any files: Assembler messages: Fatal error: Invalid listing option `r' This can happen when

Re: CVS/SVN binutils and gcc on MacOS X?

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 23:35:55 schrieb Andreas Tobler: > No, you don't do anything wrong. It is simply not supported, the > binutils from gnu. > > You can rely on gcc being able to work with the MacOS-X 'binutils' aka: > ld, as. But don't try to build it for yourself. It's somehow like sparc

Re: CVS/SVN binutils and gcc on MacOS X?

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 23:50:11 schrieb Stefan Dösinger: > Unfortunately I need support for the swap suffix in as, so using the system > binaries is not an option. Is the only thing I can do to find the source of > the as version, backport the swap suffix and hope for the best? Ok,

Re: MSVC hook function prologue

2009-09-05 Thread Stefan Dösinger
Are there non-Microsoft DLLs that expect to be hooked this way? If so, I think the patch is interesting for gcc independent of whether it is useful for Wine. I haven't seen any so far. Its certainly possible some server apps have the 2 byte nop at the beginning of functions for a similar hot-

Re: MSVC hook function prologue

2009-09-06 Thread Stefan Dösinger
Am Saturday 05 September 2009 17:08:19 schrieb Ross Ridge: > If this patch is essentially only for one application, maybe the idea > of implementing a more generally useful naked attribute would be the > way to go. I implemented a naked attribute in my private sources to > do something similar, al

Re: MSVC hook function prologue

2009-09-08 Thread Stefan Dösinger
Ok, Alexandre hasn't changed his opinion, the function attrib is ok with him. I attached another version of the patch, this time adding some testcases. Two more questions though: *) How can I skip the tests if msvc_prologue is not available because as doesn't support the swap suffix? I think it

Re: wie kann Ich gcc herunterladen ?

2009-09-25 Thread Stefan Dösinger
Am 25.09.2009 um 07:38 schrieb gerhard gangl: hallo gcc_team suche gcc zum downloaden wer kann mir helfen ? liebe grüße u. danke im vorraus _gerhard_ gangl, reichsstr. 77, 8045 graz Fast alle Linux Distributionen bringen gcc mit, man muss ihn nur mit dem Paketmanager installieren. Ansonste

Feature request concerning opcodes in the function prolog

2009-01-07 Thread Stefan Dösinger
e has it. Does gcc attempt to detect binutils features, or does it just assume that everything it needs is there? Thanks for your help, Stefan Dösinger gcc.diff Description: Binary data

RE: Feature request concerning opcodes in the function prolog

2009-01-07 Thread Stefan Dösinger
> -Original Message- > From: H.J. Lu [mailto:hjl.to...@gmail.com] Nice to see a familiar face, or better, mail address :-) > You need to check assembler feature with autconf before using them. > See HAVE_AS_IX86_SAHF as example. Thanks! Does that look ok? It seems to detect the support

RE: Feature request concerning opcodes in the function prolog

2009-01-07 Thread Stefan Dösinger
> You can make a new instruction pattern with an UNSPEC_VOLATILE pattern. > For a quick prototype you could also use an assembler prologue, > although > if you need not experiment with different insn sequences, this will > likely > be more work in the long run if/when assembler prologues are eventu

RE: Feature request concerning opcodes in the function prolog

2009-01-07 Thread Stefan Dösinger
> An example of an unspec_volatile instruction pattern in > config/i386/i386.md > is "cld". I ran across that, your hints should give me some information to chew on for the next hours. Currently I am compiling with this code to see what happens: (define_insn "movnop" [(unspec_volatile [(const_int

RE: Feature request concerning opcodes in the function prolog

2009-01-08 Thread Stefan Dösinger
> >> But since you have to have a new gas anyway, wouldn't it be simpler > to > >> have > >> a new option for gas to instruct it to choose the opcodes that are > >> expected > >> by the win32 applications? > > This was my first idea, but Alexandre Julliard(the Wine maintainer) > disliked > > it and

RE: Feature request concerning opcodes in the function prolog

2009-01-08 Thread Stefan Dösinger
> You don't need to force the frame pointer on, it is sufficient to say > that > ebp needs restoring at the end of the function no matter if it looks > otherwise > used or not - and you have to take the frame size impact of the saved > ebp into > account. How does this fit together with the stack

RE: Feature request concerning opcodes in the function prolog

2009-01-08 Thread Stefan Dösinger
> If ebp needs to be saved because it contains a user variable, it is > better > not to pop it in the prologue - pop it in the epilogue instead, and you > don't > need to have another save/restore. Sounds reasonable. Is there any flag I can set to make the epilogue pop ebp? > This can be done wit

RE: Feature request concerning opcodes in the function prolog

2009-01-12 Thread Stefan Dösinger
Here's some code attached that actually works, but is far from perfect. The 'msvc_prologue' attribute is limited to 32 bit. None of the applications that try to place hooks are ported to Win64 yet, so it is impossible to tell what they'll need. Besides, maybe I am lucky that when they appear I can

RE: Feature request concerning opcodes in the function prolog

2009-01-12 Thread Stefan Dösinger
> Have you thought about making .s an assembler command-line flag, so > that > this flag could be passed automatically by the compiler under mingw? Yes. For my purposes it is not really suitable, because we have to make sure that the push %ebp and mov %esp, %ebp are there, no matter what the compi