From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: * X-Spam-Status: No, score=1.1 required=3.0 tests=BAYES_00,FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP,PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail From: Fernando Oleo Blanco Newsgroups: comp.lang.ada Subject: Re: Help: Ada in NetBSD Date: Wed, 1 Sep 2021 16:58:47 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <646f270d-0e65-46a5-b40a-02afab608f1en@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: gioia.aioe.org; logging-data="22386"; posting-host="tmr9BI+uueYJMT3TC5a5oA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.3 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:62595 List-Id: Hi John, continuing our chat over on IRC and repeating a few things so that you can refer to this message. My work is mostly based on your gcc6-aux port. So you will not find many new things here. So, what have I actually done? - Copied your s-osinte__netbsd.ad{s,b} patches. I initially used the patched __freebsd one. However, as you already know, NetBSD changed the symbols of some of its libc and sys/* functions. - I also ended up reproducing parts of the patches you created, such as adding defined (__NetBSD__) where it was missing. - Patched the Makefile.rtl to support NetBSD x86_64. - Patched the symbols of _nanosleep and __gettimeofday50 in s-osprim__posix.adb. This is where I am right now. Most of the ACATS tests that use Tasks, fail due to time out. Everything else pretty much "just works" (there are a few more failed tests). So, what now? I am pretty sure that since gcc6-aux came out and today, some functions have been changed, see _nanosleep and __gettimeofday50. These two functions specifically, are my suspects. Maybe the input variables/structures got changed and I have not updated them. There are also a couple of other symbols in some GNAT libraries that need updating. A few more things: - The patches I have done are of very bad quality: modifying __posix files directly so that they will work only on NetBSD, for example. - These patches and are not satisfactory. Since interfacing with the NetBSD ABI is now dependent on the C preprocessor to correctly generate the symbols, the current approach of hardcoding new symbols is fragile and a loosing battle. - I think the long term solution is the one proposed by Simon. Creating some _gnat__*** C functions that wrap the NetBSD ABI. This is better, but does not save us from future functions breaking. A complete fix would be to completely _gnat__* all the C functions, which, in my humble opinion is just too much. On 01.09.21 15:28, John R. Marino wrote: > Which reminds me: I'd only do this for x86_64 platform. > Regards, > John My goal would be to at the very least give support to ARM, ARM64 and RISC-V. To be honest with you, I would like it to work on any piece of hardware that can be currently bought. Also, not just NetBSD, also FreeBSD, DragonflyBSD (already done by you), improved OpenBSD support and Haiku. I would also like to see gcc-ada added to Guix, the GNU package manager, but that is a completely different story. Regards, -- Fernando Oleo Blanco https://irvise.xyz