[haiku-bugs] Re: [Haiku] #15636: Document ABI conventions

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Fri, 17 Jan 2020 13:58:03 -0000

#15636: Document ABI conventions
----------------------+----------------------------
   Reporter:  X512    |      Owner:  nobody
       Type:  task    |     Status:  new
   Priority:  normal  |  Milestone:  Unscheduled
  Component:  System  |    Version:  R1/Development
 Resolution:          |   Keywords:
 Blocked By:          |   Blocking:
Has a Patch:  0       |   Platform:  All
----------------------+----------------------------
Description changed by X512:

Old description:

ABI conventions used by Haiku for each architecture (x86 gcc2, x86 gcc4+,
x86_64) should be documented in some way (in web site, HaikuBook etc.).

At least following topics should be documented:
* Preserved registers, including SIMD registers etc.
* FPU state.
* Passing arguments to function and return value.
* Stack alignment including alignment origin.
* Exception handling and stack unwinding.
* Executable format.

If Haiku use some existing ABI, it should be referenced in documentation
with Haiku specific changes, if any.

I tried to port some non C/C++ compiler (target ABI: x86 gcc4+) and make
Haiku API bindings and experience various problems such as:
* Structs passed by value (such as `pattern`) are stored on stack as is,
but classes such as `BPoint` are passed by pointer.
* `StrokeLine(BPoint, BPoint, pattern)` is not working if stack is not
aligned.

New description:

 ABI conventions used by Haiku for each architecture (x86 gcc2, x86 gcc4+,
 x86_64) should be documented in some way (in web site, HaikuBook etc.).

 At least following topics should be documented:
 * Preserved registers, including SIMD registers etc.
 * FPU state.
 * Passing arguments to function and return value.
 * Stack alignment including alignment origin.
 * Exception handling and stack unwinding.
 * Executable format.

 If Haiku use some existing ABI, it should be referenced in documentation
 with Haiku specific changes, if any.

 I tried to port some non C/C++ compiler (target ABI: x86 gcc4+) and make
 Haiku API bindings and experience various problems such as:
 * Structs passed by value (such as `pattern`) are stored on stack as is,
 but classes such as `BPoint` are passed by pointer.
 * `BView::StrokeLine(BPoint, BPoint, pattern)` is not working if stack is
 not aligned.

--
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15636#comment:3>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: