[fpc-devel] Haiku/x86-64 (Was: Proposal to adapt search patch under Haiku using a target specific option (-WH).)

Olivier Coursière olivier.coursiere at laposte.net
Fri Jan 4 00:06:12 CET 2019


On 03/01/2019 15:08, Karoly Balogh (Charlie/SGR) wrote:
> Hi,
> On Wed, 2 Jan 2019, Karoly Balogh (Charlie/SGR) wrote:
>>> - port/fix to 64bit
>>> With the already proposed changes to simplify the initialization part,
>>> it is probably "just" a matter of :
>>> (...)
>> Yup, that list sums it up. Also I'm not sure the do_syscall code is still
>> used in Haiku RTL at this point, but if yes, it needs to be adapted to
>> 64bit too. (Or remove if not needed.)
> It turned out, it wasn't needed. So I made a really quick hack this
> morning, and now FPC builds for and semi-works on Haiku/x86_64...
You were faster than me to check this ;-) I was not sure when i fist saw 
this message.
> Screenshot:
> https://twitter.com/chainq/status/1080826380466696192
> There seems to be something wrong with the signal setup so strace is used
> to hide a fatal error... Also file handling doesn't really work now. But
> even to get to this level in a few hours was nice.
For signal handling, my bet would be a problem in declarations of types 
used in the API. A quick check indicate that i have overlooked some 
architecture specific declarations in signal.inc. Some parts should be 
in a sighndh.inc in an arch specific directory. It was not a problem 
until now ;-)
Maybe some shared declarations contains mistakes too. You can double 
check haiku headers in 
/boot/system/develop/headers/posix/arch/x86/signal.h and 

Maybe there is a similar problem for file access functions.
> The patch is of course still a bit of a mess, especially the RTL part, but
> I can commit the "trivial" parts of it to SVN, if you have nothing against
> it? Like adding the target to the compiler at least. (This question is to
> Olivier primarily, as he's the Haiku maintainer.)
I am more the "de facto" maintainer ;-) Any help is welcome ! Committing 
all "trivial" parts would be nice (including x86_64 specific 
declarations). x86_64 version for Haiku is almost there : no need to 
delay the inevitable ;-)

For the rest, i don't know what change are required that would affect 32 
bits port but as long as the compiler can still cycle in 32 bits, it 
might be "good enough". Everything that is x86_64 do not need to be 
perfect. It is work in progress after all (and was not working at all 
until your work).


More information about the fpc-devel mailing list