public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC and NT DDK - still problems
@ 1999-09-13  0:40 Pavel Pisa;research student
  1999-09-13  8:52 ` Rask Ingemann Lambertsen
  1999-09-30 18:02 ` Pavel Pisa;research student
  0 siblings, 2 replies; 4+ messages in thread
From: Pavel Pisa;research student @ 1999-09-13  0:40 UTC (permalink / raw)
  To: gcc

Hello everybody,

I am developing GPLed RS-485 9-bit driver for Linux and NT.
It works OK under both OS, but I like to compile
it by GCC under NT in future.

GCC team helped me some time ago with anonymous
structs and unions. Latest versions of MinGW32 port
of GCC can parse and compile my patched vesions of NTDDK.H
and NTDEF.H. If somebody have interrest I can send diffs.

But I have stuck on "fastcall" calling convention.
It is register calling convention used in VC 6.0
and NT Kernel. It is similar to attrib((regparms(2)))
but uses another order of registers.

GCC : EAX, EDX, ECX
VC  : ECX, EDX

I have looked at GCC source, but it seems, that
registers for parameters are used in hardcoded order
based on registers numbering in GCC. I do not like
to change numbering => it leads to many other
problems.

It would be great, if allocation order of registers
used for parameters can be described same way as
allocation order of registers for local parameters.

There is second problem, function names of "fastcall"
functions are decorated such way, that they begin
with "@" instead of "_". GCC doesnot use this.
It makes problems to binutils too.

I have some more points to binutils. They are related
to above, so I hope, that I can add them to GCC list.

I have problems with binutils-2.9x and empty libraries.
It leads to SIGSEGV. 2.8x was OK. Repair is there

binutils-empty-ar-patch
-------------------------------------------------------
--- ldfile.c.orig	Sat Jul 10 15:57:03 1999
+++ ldfile.c	Fri Aug  6 09:44:02 1999
@@ -143,11 +143,18 @@
       else
 	check = entry->the_bfd;
 
+      if(! check)
+        {
+	  einfo (_("%P: openning empty archive %s when searching for %s\n"),
+		 attempt, entry->local_sym_name);
+	  return true;
+        }
+
       if (! bfd_check_format (check, bfd_object))
 	return true;
       if (bfd_arch_get_compatible (check, output_bfd) == NULL)
 	{
-	  einfo (_("%P: skipping incompatible %s when searching for %s"),
+	  einfo (_("%P: skipping incompatible %s when searching for %s\n"),
 		 attempt, entry->local_sym_name);
 	  bfd_close (entry->the_bfd);
 	  entry->the_bfd = NULL;
-------------------------------------------------------

I have written program, which is able to parse MS import libraries.
Output is DEF file, but there are problems with "@" in front again.
I can send my source on request.

Best regards and thanks for attention

                        Pavel Pisa
                        pisa@cmp.felk.cvut.cz
                        http://cmp.felk.cvut.cz/~pisa

PS: I will be pleased, if you can CC directly to me



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC and NT DDK - still problems
  1999-09-13  0:40 GCC and NT DDK - still problems Pavel Pisa;research student
@ 1999-09-13  8:52 ` Rask Ingemann Lambertsen
  1999-09-30 18:02   ` Rask Ingemann Lambertsen
  1999-09-30 18:02 ` Pavel Pisa;research student
  1 sibling, 1 reply; 4+ messages in thread
From: Rask Ingemann Lambertsen @ 1999-09-13  8:52 UTC (permalink / raw)
  To: GCC mailing list

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1472 bytes --]

Den 13-Sep-99 08:37:26 skrev Pavel Pisa;research student følgende om "GCC and NT DDK - still problems":

> But I have stuck on "fastcall" calling convention.
> It is register calling convention used in VC 6.0
> and NT Kernel. It is similar to attrib((regparms(2)))
> but uses another order of registers.

   You are not alone with that sort of problem. There are similiar problems
calling AmigaOS system (and shared library) functions from GCC. Over time,
the following three solutions have been used (in cronologic order):

1. A link library of stub functions (written in assembler languague or
generated by other means) which convert between the calling conventions.

2. Header files defining inline functions with inline assembler code.

3. Header files defining preprocessor macros which expand to local
functions (a GCC extension) containing inline assembler code.

Regards,

/¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯T¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\
| Rask Ingemann Lambertsen       | E-mail: mailto:rask@kampsax.k-net.dk  |
| Registered Phase5 developer    | WWW: http://www.gbar.dtu.dk/~c948374/ |
| A4000, 866 kkeys/s (RC5-64)    | "ThrustMe" on XPilot, ARCnet and IRC  |
|   To err is human, but to really mess things up you need a computer.   |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* GCC and NT DDK - still problems
  1999-09-13  0:40 GCC and NT DDK - still problems Pavel Pisa;research student
  1999-09-13  8:52 ` Rask Ingemann Lambertsen
@ 1999-09-30 18:02 ` Pavel Pisa;research student
  1 sibling, 0 replies; 4+ messages in thread
From: Pavel Pisa;research student @ 1999-09-30 18:02 UTC (permalink / raw)
  To: gcc

Hello everybody,

I am developing GPLed RS-485 9-bit driver for Linux and NT.
It works OK under both OS, but I like to compile
it by GCC under NT in future.

GCC team helped me some time ago with anonymous
structs and unions. Latest versions of MinGW32 port
of GCC can parse and compile my patched vesions of NTDDK.H
and NTDEF.H. If somebody have interrest I can send diffs.

But I have stuck on "fastcall" calling convention.
It is register calling convention used in VC 6.0
and NT Kernel. It is similar to attrib((regparms(2)))
but uses another order of registers.

GCC : EAX, EDX, ECX
VC  : ECX, EDX

I have looked at GCC source, but it seems, that
registers for parameters are used in hardcoded order
based on registers numbering in GCC. I do not like
to change numbering => it leads to many other
problems.

It would be great, if allocation order of registers
used for parameters can be described same way as
allocation order of registers for local parameters.

There is second problem, function names of "fastcall"
functions are decorated such way, that they begin
with "@" instead of "_". GCC doesnot use this.
It makes problems to binutils too.

I have some more points to binutils. They are related
to above, so I hope, that I can add them to GCC list.

I have problems with binutils-2.9x and empty libraries.
It leads to SIGSEGV. 2.8x was OK. Repair is there

binutils-empty-ar-patch
-------------------------------------------------------
--- ldfile.c.orig	Sat Jul 10 15:57:03 1999
+++ ldfile.c	Fri Aug  6 09:44:02 1999
@@ -143,11 +143,18 @@
       else
 	check = entry->the_bfd;
 
+      if(! check)
+        {
+	  einfo (_("%P: openning empty archive %s when searching for %s\n"),
+		 attempt, entry->local_sym_name);
+	  return true;
+        }
+
       if (! bfd_check_format (check, bfd_object))
 	return true;
       if (bfd_arch_get_compatible (check, output_bfd) == NULL)
 	{
-	  einfo (_("%P: skipping incompatible %s when searching for %s"),
+	  einfo (_("%P: skipping incompatible %s when searching for %s\n"),
 		 attempt, entry->local_sym_name);
 	  bfd_close (entry->the_bfd);
 	  entry->the_bfd = NULL;
-------------------------------------------------------

I have written program, which is able to parse MS import libraries.
Output is DEF file, but there are problems with "@" in front again.
I can send my source on request.

Best regards and thanks for attention

                        Pavel Pisa
                        pisa@cmp.felk.cvut.cz
                        http://cmp.felk.cvut.cz/~pisa

PS: I will be pleased, if you can CC directly to me



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC and NT DDK - still problems
  1999-09-13  8:52 ` Rask Ingemann Lambertsen
@ 1999-09-30 18:02   ` Rask Ingemann Lambertsen
  0 siblings, 0 replies; 4+ messages in thread
From: Rask Ingemann Lambertsen @ 1999-09-30 18:02 UTC (permalink / raw)
  To: GCC mailing list

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1472 bytes --]

Den 13-Sep-99 08:37:26 skrev Pavel Pisa;research student følgende om "GCC and NT DDK - still problems":

> But I have stuck on "fastcall" calling convention.
> It is register calling convention used in VC 6.0
> and NT Kernel. It is similar to attrib((regparms(2)))
> but uses another order of registers.

   You are not alone with that sort of problem. There are similiar problems
calling AmigaOS system (and shared library) functions from GCC. Over time,
the following three solutions have been used (in cronologic order):

1. A link library of stub functions (written in assembler languague or
generated by other means) which convert between the calling conventions.

2. Header files defining inline functions with inline assembler code.

3. Header files defining preprocessor macros which expand to local
functions (a GCC extension) containing inline assembler code.

Regards,

/¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯T¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\
| Rask Ingemann Lambertsen       | E-mail: mailto:rask@kampsax.k-net.dk  |
| Registered Phase5 developer    | WWW: http://www.gbar.dtu.dk/~c948374/ |
| A4000, 866 kkeys/s (RC5-64)    | "ThrustMe" on XPilot, ARCnet and IRC  |
|   To err is human, but to really mess things up you need a computer.   |

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-09-30 18:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-13  0:40 GCC and NT DDK - still problems Pavel Pisa;research student
1999-09-13  8:52 ` Rask Ingemann Lambertsen
1999-09-30 18:02   ` Rask Ingemann Lambertsen
1999-09-30 18:02 ` Pavel Pisa;research student

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).