Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Any sufficiently advanced technology is indistinguishable from magic. -- Arthur C. Clarke


devel / comp.lang.ada / Help: Ada in NetBSD

SubjectAuthor
* Help: Ada in NetBSDFernando Oleo Blanco
+* Re: Help: Ada in NetBSDStephane Carrez
|`* Re: Help: Ada in NetBSDFernando Oleo Blanco
| `* Re: Help: Ada in NetBSDSimon Wright
|  `* Re: Help: Ada in NetBSDFernando Oleo Blanco
|   `* Re: Help: Ada in NetBSDStephane Carrez
|    +- Re: Help: Ada in NetBSDSimon Wright
|    `* Re: Help: Ada in NetBSDFernando Oleo Blanco
|     `* Re: Help: Ada in NetBSDFernando Oleo Blanco
|      `* Re: Help: Ada in NetBSDFernando Oleo Blanco
|       `* Re: Help: Ada in NetBSDFernando Oleo Blanco
|        `* Re: Help: Ada in NetBSDSimon Wright
|         `* Re: Help: Ada in NetBSDFernando Oleo Blanco
|          +- Re: Help: Ada in NetBSDSimon Wright
|          `* Re: Help: Ada in NetBSDRandy Brukardt
|           `- Re: Help: Ada in NetBSDSimon Wright
+* Re: Help: Ada in NetBSDSimon Wright
|`- Re: Help: Ada in NetBSDFernando Oleo Blanco
`* Re: Help: Ada in NetBSDJohn R. Marino
 +* Re: Help: Ada in NetBSDFernando Oleo Blanco
 |`* Re: Help: Ada in NetBSDFernando Oleo Blanco
 | `* Re: Help: Ada in NetBSDFernando Oleo Blanco
 |  `* Re: Help: Ada in NetBSDFernando Oleo Blanco
 |   +- Re: Help: Ada in NetBSDSimon Wright
 |   +* Re: Help: Ada in NetBSDLuke A. Guest
 |   |+* Re: Help: Ada in NetBSDKevin Chadwick
 |   ||`- Re: Help: Ada in NetBSDFernando Oleo Blanco
 |   |`- Re: Help: Ada in NetBSDFernando Oleo Blanco
 |   `* Re: Help: Ada in NetBSDFernando Oleo Blanco
 |    `* Re: Help: Ada in NetBSDSimon Wright
 |     `- Re: Help: Ada in NetBSDFernando Oleo Blanco
 `* Re: Help: Ada in NetBSDFernando Oleo Blanco
  `* Re: Help: Ada in NetBSDDennis Lee Bieber
   `- Re: Help: Ada in NetBSDFernando Oleo Blanco

Pages:12
Help: Ada in NetBSD

<sgfpod$19sl$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5750&group=comp.lang.ada#5750

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Help: Ada in NetBSD
Date: Sun, 29 Aug 2021 13:06:53 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sgfpod$19sl$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="42901"; 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.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Fernando Oleo Blanco - Sun, 29 Aug 2021 11:06 UTC

Dear All,

I have been trying for the past few months to make GCC/Ada work in
NetBSD. I am writing this message to you since I have been stuck in a
roadblock for far too long and without concrete answers.

Long story short: JMarino, within the Aurora project, already ported
GCC/Ada to a lot of systems, namely FreeBSD, DragonflyBSD, NetBSD and
Solaris. The last version that works without friction in NetBSD/pkgsrc
is GCC v6. I wanted to update GCC to v10 (10.3.0).

So, one can compile GCC v10 with C, C++ and Ada support with v6 without
any issues. The biggest problem is that the RT (RunTime Files) had no
configuration for NetBSD (see the original Makefile.rtl in the gcc/ada
directory). I fixed it by copying the FreeBSD support files and
modifying a imported C function to be POSIX compilant, since NetBSD did
not had the function that FreeBSD used (related to pthreads).

The results of compiling GCC v10 with this "small" change are documented
in a blog entry I did:
https://www.irvise.xyz/Projects%20&%20Engineering/updating-gcc-ada-pkgsrc.html

TL;DR: GCC v10 compiles and can generate binaries!!! :D But...

The tasking system is not working correctly (I have been testing the
compiler with the ACATS test suite provided by Simon). The linker
complains about some C functions not being correctly imported within Ada
files. And the programs where the linker complains, once compiled, tend
to get blocked or die. Here is one such example:

/usr/bin/ld:
/home/fernando/mysandboxfolder/usr/pkg/gcc10/lib/gcc/x86_64--netbsd/10.3.0/adalib/libgnat.a(s-osprim.o):
in function `system__os_primitives__clock':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/s-osprim.adb:91:
warning: warning: reference to compatibility gettimeofday(); include
<sys/time.h> to generate correct reference

As you can see, the linker says that, in this case, gettimeofday() is
not correctly referenced and that I should include <sys/time.h>. Notice,
it is complaining that the file s-osprim.adb, and Ada file, is at fault
here. This happens to all files that use the tasking system in one way
or another, so, in summary, all large projects, such as GPRBuild.

I thought that an #include <sys/time.h> may have been missing from a C
source file that is required to build the Ada compiler. After all, there
were some defined (__NetBSD__) missing from the Ada sources.

I added those. Nothing. I took a really good look at JMarino's patches:
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/gcc6-aux/files/diff-ada?rev=1.1&content-type=text/x-cvsweb-markup
I applied some extra changes (the configure/configure.ac patches are
failing to apply). Still nothing, it keeps failing.

I have been looking for the "missing" #include files, they are <time.h>,
<sys/time.h> and <signal.h>. I searched through the code, there are few
occurrences of them and, for example, <sys/time.h> only appears in a
legacy system.

I checked the C signature files to make sure that they were also correct
in the Ada sources, and they seem to match.

I am out of ideas.

How come the linker complains about those functions and not the other
imported C ones? These files are automatically included with -lc.
How could I go about fixing this issue? Any ideas, pointers?

Below are the patches that I have created.

If you are wondering why am I doing this: I like alternative systems,
Ada is portable on paper, but what about in reality? And my end goal
would be to see Ada everywhere and upstream these fixes to GCC.

Thank you for your time,

-------

--- gcc/ada/adaint.c.orig 2021-08-28 18:39:27.509714592 +0000
+++ gcc/ada/adaint.c 2021-08-28 18:40:44.190149364 +0000
@@ -817,7 +817,8 @@
}

#if defined (_WIN32) || defined (__linux__) || defined (__sun__) \
- || defined (__FreeBSD__) || defined(__DragonFly__) || defined (__QNX__)
+ || defined (__FreeBSD__) || defined(__DragonFly__) || defined (__QNX__) \
+ || defined (__NetBSD__)
#define HAS_TARGET_WCHAR_T
#endif

--- gcc/ada/cstreams.c.orig 2021-08-28 18:42:21.323680378 +0000
+++ gcc/ada/cstreams.c 2021-08-28 18:43:48.045445919 +0000
@@ -188,7 +188,8 @@
*p = '\\';
}

-#elif defined (__FreeBSD__) || defined (__DragonFly__) || defined
(__OpenBSD__)
+#elif defined (__FreeBSD__) || defined (__DragonFly__) \
+ || defined (__OpenBSD__) || defined (__NetBSD__)

/* Use realpath function which resolves links and references to . and ..
on those Unix systems that support it. Note that GNU/Linux
provides it but
@@ -270,7 +271,7 @@
}

#elif defined (__linux__) || defined (__sun__) || defined (__FreeBSD__) \
- || defined (__APPLE__)
+ || defined (__APPLE__) || defined (__NetBSD__)
/* section for platforms having ftello/fseeko */

__int64

--- gcc/ada/init.c.orig 2021-08-28 20:28:13.261558335 +0000
+++ gcc/ada/init.c 2021-08-28 20:29:48.573288829 +0000
@@ -2183,6 +2183,8 @@

#include <signal.h>
#include <unistd.h>
+#include <time.h>
+#include <sys/time.h>

static void
__gnat_error_handler (int sig)

--- gcc/ada/s-oscons-tmplt.c.orig 2021-08-28 18:50:50.086632028 +0000
+++ gcc/ada/s-oscons-tmplt.c 2021-08-28 18:53:35.037358487 +0000
@@ -406,9 +406,11 @@

*/

-/* ioctl(2) requests are "int" in UNIX, but "unsigned long" on FreeBSD */
+/* ioctl(2) requests are "int" in UNIX, but "unsigned long" on FreeBSD
+ and NetBSD
+*/

-#if defined (__FreeBSD__) || defined (__DragonFly__)
+#if defined (__FreeBSD__) || defined (__DragonFly__) || defined
(__NetBSD__)
# define CNI CNU
# define IOCTL_Req_T "Interfaces.C.unsigned"
#else
@@ -1020,7 +1022,8 @@

*/

-#if defined (__FreeBSD__) || defined (__linux__) || defined (__DragonFly__)
+#if defined (__FreeBSD__) || defined (__linux__) || defined
(__DragonFly__) \
+ || defined (__NetBSD__)
# define PTY_Library "-lutil"
#else
# define PTY_Library ""
@@ -1833,7 +1836,8 @@

#if defined(__linux__) || defined(__FreeBSD__) \
|| (defined(_AIX) && defined(_AIXVERSION_530)) \
- || defined(__DragonFly__) || defined(__QNX__)
+ || defined(__DragonFly__) || defined(__QNX__) \
+ || defined (__NetBSD__)
/** On these platforms use system provided monotonic clock instead of
** the default CLOCK_REALTIME. We then need to set up cond var attributes
** appropriately (see thread.c).

--- gcc/ada/sysdep.c.orig 2021-08-28 13:11:25.681014624 +0000
+++ gcc/ada/sysdep.c 2021-08-28 13:21:14.748176113 +0000
@@ -320,7 +320,7 @@
|| (defined (__svr4__) && defined (__i386__)) || defined (__Lynx__) \
|| defined (__CYGWIN__) || defined (__FreeBSD__) || defined
(__OpenBSD__) \
|| defined (__GLIBC__) || defined (__APPLE__) || defined
(__DragonFly__) \
- || defined (__QNX__)
+ || defined (__QNX__) || defined (__NetBSD__)

# ifdef __MINGW32__
# if OLD_MINGW
@@ -373,7 +373,7 @@
|| defined (_AIX) || (defined (__svr4__) && defined (__i386__)) \
|| defined (__Lynx__) || defined (__FreeBSD__) || defined
(__OpenBSD__) \
|| defined (__GLIBC__) || defined (__APPLE__) || defined
(__DragonFly__) \
- || defined (__QNX__)
+ || defined (__QNX__) || defined (__NetBSD__)
char c;
int nread;
int good_one = 0;
@@ -394,7 +394,7 @@
|| defined (_AIX) || (defined (__svr4__) && defined (__i386__)) \
|| defined (__Lynx__) || defined (__FreeBSD__) || defined
(__OpenBSD__) \
|| defined (__GLIBC__) || defined (__APPLE__) || defined
(__DragonFly__) \
- || defined (__QNX__)
+ || defined (__QNX__) || defined (__NetBSD__)
eof_ch = termios_rec.c_cc[VEOF];

/* If waiting (i.e. Get_Immediate (Char)), set MIN = 1 and wait for
@@ -831,7 +831,7 @@

#elif defined (__APPLE__) || defined (__FreeBSD__) || defined
(__linux__) \
|| defined (__GLIBC__) || defined (__DragonFly__) || defined
(__OpenBSD__) \
- || defined (__DJGPP__) || defined (__QNX__)
+ || defined (__DJGPP__) || defined (__QNX__) || defined (__NetBSD__)
{
localtime_r (timer, &tp);
*off = tp.tm_gmtoff;

-------

--
Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5751&group=comp.lang.ada#5751

 copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:1a9b:: with SMTP id s27mr16383590qtc.165.1630243198309;
Sun, 29 Aug 2021 06:19:58 -0700 (PDT)
X-Received: by 2002:a25:1257:: with SMTP id 84mr16423460ybs.363.1630243197977;
Sun, 29 Aug 2021 06:19:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 29 Aug 2021 06:19:57 -0700 (PDT)
In-Reply-To: <sgfpod$19sl$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=5.51.16.193; posting-account=lzjH_AoAAABq5H4FTxZ1AkonVQLbXoxB
NNTP-Posting-Host: 5.51.16.193
References: <sgfpod$19sl$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
Subject: Re: Help: Ada in NetBSD
From: stephane...@gmail.com (Stephane Carrez)
Injection-Date: Sun, 29 Aug 2021 13:19:58 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Stephane Carrez - Sun, 29 Aug 2021 13:19 UTC

Hi!

On NetBSD there are several symbols that are replaced by the virtue of including a C header.
If you include correctly the C header, the correct symbol is used and you don't get the linker warning.

For gettimeofday the symbol is replaced by __gettimeofday50.
These symbols are marked with __RENAME(XXX) macros in the C headers.

I would suggest to have a look at the .o files to find out the one that has the `gettimeofday` symbol that is not replaced.

By the way, I'm intertested by your work as I'm still stuck on gcc 6 for my NetBSD machines.
20 years ago I wrote the 68HC11 port that was integrated in GCC 3.3 so I have some past experience in working with GCC.
Despite my very limited spare time, I could have a look if you provide me the sources of your port :-)

Best regards,

Stephane

Re: Help: Ada in NetBSD

<ly4kb8f939.fsf@pushface.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5752&group=comp.lang.ada#5752

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!RKN7TKnHC01q0gdg6EhkbQ.user.46.165.242.75.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Sun, 29 Aug 2021 18:34:50 +0100
Organization: Aioe.org NNTP Server
Message-ID: <ly4kb8f939.fsf@pushface.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="52475"; posting-host="RKN7TKnHC01q0gdg6EhkbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)
Cancel-Lock: sha1:o1F/u0nFW6ianto/slvvtvah5ts=
X-Notice: Filtered by postfilter v. 0.9.2
 by: Simon Wright - Sun, 29 Aug 2021 17:34 UTC

Fernando Oleo Blanco <irvise_ml@irvise.xyz> writes:

> The tasking system is not working correctly (I have been testing the
> compiler with the ACATS test suite provided by Simon).

There are several tasking-related (CXD) tests in ACATS that few if any
desktop OSs are expected to support; mainly, I think, priority-related.

On macOS, I get (with latest ACATS 4.1W, not yet pushed, & FSF GCC 11.1.0)

PASS: cxd1001
PASS: cxd1002
FAIL: cxd1003
FAIL: cxd1004
FAIL: cxd1005
PASS: cxd1006
PASS: cxd1007
PASS: cxd1008
UNSUPPORTED: cxd2001 (no multiprocessing)
UNSUPPORTED: cxd2002 ( " )
UNSUPPORTED: cxd2003 ( " )
UNSUPPORTED: cxd2004 ( " )
FAIL: cxd2006
UNSUPPORTED: cxd2007 (no async task control)
UNSUPPORTED: cxd2008 ( " )
FAIL: cxd3001
FAIL: cxd3002
PASS: cxd3003
PASS: cxd4001
PASS: cxd4002
PASS: cxd4003
PASS: cxd4004
PASS: cxd4005
PASS: cxd4006
PASS: cxd4007
PASS: cxd4008
PASS: cxd4009
PASS: cxd4010
PASS: cxd5001
UNSUPPORTED: cxd6001 (no multiprocessing)
UNSUPPORTED: cxd6002 ( " )
UNSUPPORTED: cxd6003 ( " )
PASS: cxd8001
PASS: cxd8002
PASS: cxd8003
PASS: cxd9001
PASS: cxda001
PASS: cxda002
PASS: cxda003
PASS: cxda004
UNSUPPORTED: cxdb001 (no async task control)
UNSUPPORTED: cxdb002 ( " )
UNSUPPORTED: cxdb003 ( " )
UNSUPPORTED: cxdb004 ( " )

Re: Help: Ada in NetBSD

<sggh3j$1r0p$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5753&group=comp.lang.ada#5753

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Sun, 29 Aug 2021 19:45:23 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sggh3j$1r0p$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org> <ly4kb8f939.fsf@pushface.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="60441"; 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
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Fernando Oleo Blanco - Sun, 29 Aug 2021 17:45 UTC

Thanks Simon, I will take into account this failures when I get to the
final testing round.

Regards,

--
Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<sggier$gb2$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5754&group=comp.lang.ada#5754

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Sun, 29 Aug 2021 20:08:27 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sggier$gb2$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@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="16738"; 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
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Fernando Oleo Blanco - Sun, 29 Aug 2021 18:08 UTC

On 29.08.21 15:19, Stephane Carrez wrote:
> Hi!
>
> On NetBSD there are several symbols that are replaced by the virtue of including a C header.
> If you include correctly the C header, the correct symbol is used and you don't get the linker warning.

That is what I did by adding the indicated header files to the NetBSD
section of the init.c file. No other systems have them there (or
anywhere in some cases). I expected that to fix the issue, but it did not.

> For gettimeofday the symbol is replaced by __gettimeofday50.
> These symbols are marked with __RENAME(XXX) macros in the C headers.

I saw a few of those... So that is what they do... I never got to the
bottom of that rabbit hole.

> I would suggest to have a look at the .o files to find out the one that has the `gettimeofday` symbol that is not replaced.

I am doing it right now, lets see what I can find... However, as I said,
the headers should have been already included. The linker does not
complain during the compilation of gcc. Only when I try to build things
with the newly created toolchain. Maybe that is a clue...

> By the way, I'm intertested by your work as I'm still stuck on gcc 6 for my NetBSD machines.
> 20 years ago I wrote the 68HC11 port that was integrated in GCC 3.3 so I have some past experience in working with GCC.
> Despite my very limited spare time, I could have a look if you provide me the sources of your port :-)

I am working directly on pkgsrc/wip. This way I hope to be able to
upstream everything as quickly as possible. Jay Patelani already
uploaded the patches from the initial blog post. You can find them here:
https://github.com/NetBSD/pkgsrc-wip/tree/c550eafe889691af212379590974944e1359e180/gcc10_aux

It is basically the gcc10 entry with the patch-ada* file in patches and
Ada added to the USE_LANGUAGES variable (is has to be hardcoded, it
cannot be set via options). It is not a clean snapshot, some dirty files
were pulled, but it should work as first order approximation. The
previous email contains some extra patches (though you would have to
update the distinfo file manually). I was lucky that the pkgsrc got
changed a few months back to make gcc6-aux the default, instead of gcc5-aux.

I will ask you to take a look if I need to. However, this is "my
personal project" I want to do this myself, so for the time being, no
need for that :) I would like to see Ada running on as many systems and
package managers as possible ;)

P.S: I am yet to try your AWA, I am looking forwards to it.

Regards,

--
Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<lyzgt0ds72.fsf@pushface.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5755&group=comp.lang.ada#5755

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!RKN7TKnHC01q0gdg6EhkbQ.user.46.165.242.75.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Sun, 29 Aug 2021 19:25:05 +0100
Organization: Aioe.org NNTP Server
Message-ID: <lyzgt0ds72.fsf@pushface.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="31700"; posting-host="RKN7TKnHC01q0gdg6EhkbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)
Cancel-Lock: sha1:/7O40wzVKt1p9XS3LiawhpYXrzs=
X-Notice: Filtered by postfilter v. 0.9.2
 by: Simon Wright - Sun, 29 Aug 2021 18:25 UTC

Fernando Oleo Blanco <irvise_ml@irvise.xyz> writes:

>> On NetBSD there are several symbols that are replaced by the virtue
>> of including a C header.
>> If you include correctly the C header, the correct symbol is used
>> and you don't get the linker warning.
>
> That is what I did by adding the indicated header files to the NetBSD
> section of the init.c file. No other systems have them there (or
> anywhere in some cases). I expected that to fix the issue, but it did not.

The problem can't be fixed by including C headers, because ...

>> For gettimeofday the symbol is replaced by __gettimeofday50.
>> These symbols are marked with __RENAME(XXX) macros in the C headers.

The C header is (I got this from the net, so beware)

int gettimeofday(struct timeval * __restrict, void *__restrict)
__RENAME(__gettimeofday50);

so when you say, in Ada,

function gettimeofday
(tv : not null access struct_timeval;
tz : struct_timezone_ptr) return Integer;
pragma Import (C, gettimeofday, "gettimeofday");

the linker looks for a symbol gettimeofday (or maybe _gettimeofday) and
gives you the warning that you report. Since it's just a warning, it may
actually work - for the moment, anyway.

The Ada needs to change to

function gettimeofday
(tv : not null access struct_timeval;
tz : struct_timezone_ptr) return Integer;
pragma Import (C, gettimeofday, "gettimeofday50");

(or maybe "_gettimeofday50", or even "__gettimeofday50" - nm will be
your friend).

Re: Help: Ada in NetBSD

<sggr4p$gta$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5757&group=comp.lang.ada#5757

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Sun, 29 Aug 2021 22:36:41 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sggr4p$gta$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="17322"; 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
 by: Fernando Oleo Blanco - Sun, 29 Aug 2021 20:36 UTC

On 29.08.21 20:25, Simon Wright wrote:
> The problem can't be fixed by including C headers, because ...
>
>>> For gettimeofday the symbol is replaced by __gettimeofday50.
>>> These symbols are marked with __RENAME(XXX) macros in the C headers.
>
> The C header is (I got this from the net, so beware)
>
> int gettimeofday(struct timeval * __restrict, void *__restrict)
> __RENAME(__gettimeofday50);

That is correct. I do not know exactly how the __RENAME() statement
works, however, I can take a guess. The symbol gettimeofday should still
be defined and just call the __RENAME directly. The NetBSD people cannot
expect everybody to rename their functions just for them. There are very
many more functions that are also __RENAME d

> The Ada needs to change to
>
> function gettimeofday
> (tv : not null access struct_timeval;
> tz : struct_timezone_ptr) return Integer;
> pragma Import (C, gettimeofday, "gettimeofday50");
>
> (or maybe "_gettimeofday50", or even "__gettimeofday50" - nm will be
> your friend).

This is exactly what I want to avoid. I took a look at FreeBSD's libc
and glibc. None __RENAME their functions (at the very least the ones I
am interested)... I need to interrogate some developers in IRC.

I will update the thread if I find anything relevant.

Regards,
--
Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<7b5879f1-6d8a-46d7-b761-82c9cf483984n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5758&group=comp.lang.ada#5758

 copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:135c:: with SMTP id c28mr19343246qkl.18.1630274908169;
Sun, 29 Aug 2021 15:08:28 -0700 (PDT)
X-Received: by 2002:a25:5556:: with SMTP id j83mr19335006ybb.309.1630274907868;
Sun, 29 Aug 2021 15:08:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 29 Aug 2021 15:08:27 -0700 (PDT)
In-Reply-To: <sggr4p$gta$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=5.51.16.193; posting-account=lzjH_AoAAABq5H4FTxZ1AkonVQLbXoxB
NNTP-Posting-Host: 5.51.16.193
References: <sgfpod$19sl$1@gioia.aioe.org> <16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org> <sggr4p$gta$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7b5879f1-6d8a-46d7-b761-82c9cf483984n@googlegroups.com>
Subject: Re: Help: Ada in NetBSD
From: stephane...@gmail.com (Stephane Carrez)
Injection-Date: Sun, 29 Aug 2021 22:08:28 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Stephane Carrez - Sun, 29 Aug 2021 22:08 UTC

Hi!

Simon is right, the symbol used by the Ada import statement must be renamed.

The reason for the symbol change is some NetBSD libc change in the signature of some system calls.
Some information in: http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/lib/libc/README

The __gettimeofday50 is the new function signature while _gettimeofday is the old one.
The gettimeofday is the weak alias to _gettimeofday and produces the warning.

Beware that the symbol name that you specify for some import statement is platform specific.
Having a different symbol names for NetBSD is quite common.

FreeBSD is different than NetBSD, likewise for OpenBSD :-)

Thanks for the link to the NetBSD git sources, I'm trying to build and keep you informed in my progress :-)

Stephane

Re: Help: Ada in NetBSD

<lypmtve625.fsf@pushface.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5759&group=comp.lang.ada#5759

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!RKN7TKnHC01q0gdg6EhkbQ.user.46.165.242.75.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Mon, 30 Aug 2021 08:37:54 +0100
Organization: Aioe.org NNTP Server
Message-ID: <lypmtve625.fsf@pushface.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org>
<sggr4p$gta$1@gioia.aioe.org>
<7b5879f1-6d8a-46d7-b761-82c9cf483984n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="29104"; posting-host="RKN7TKnHC01q0gdg6EhkbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:JhxY7EPfeAAWhnsUzLQUzEBPI58=
 by: Simon Wright - Mon, 30 Aug 2021 07:37 UTC

Stephane Carrez <stephane.carrez@gmail.com> writes:

> Simon is right, the symbol used by the Ada import statement must be
> renamed.

One possibility, with ample precedent, would be to create
e.g. __gnat_gettimeofday() in gcc/ada/adaint.[ch] and reference that in
the Ada import statement.

Re: Help: Ada in NetBSD

<sgi40d$1red$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5761&group=comp.lang.ada#5761

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Mon, 30 Aug 2021 10:14:05 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sgi40d$1red$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org>
<sggr4p$gta$1@gioia.aioe.org>
<7b5879f1-6d8a-46d7-b761-82c9cf483984n@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="60877"; 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
 by: Fernando Oleo Blanco - Mon, 30 Aug 2021 08:14 UTC

On 30.08.21 00:08, Stephane Carrez wrote:
> Hi!
>
> The reason for the symbol change is some NetBSD libc change in the signature of some system calls.
> Some information in: http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/lib/libc/README

Thank you very much for the link. It does explain quite a few things

> Simon is right, the symbol used by the Ada import statement must be
renamed.

> The __gettimeofday50 is the new function signature while _gettimeofday is the old one.
> The gettimeofday is the weak alias to _gettimeofday and produces the warning.
>
> Beware that the symbol name that you specify for some import statement is platform specific.
> Having a different symbol names for NetBSD is quite common.

However, I still would say that is not right. Here is my
reasoning/arguments:

- All programs would have to be corrected just for NetBSD if the linker
does not do the alias translation automatically.

- I think the linker is doing the aliasing correctly, meaning, that any
program that references such functions directly, get linked correctly to
the actual implementation. After all, the alias is just another
identifier for the actual function.

- The linker does not complain when linking these files during the
compilation of GCC.

- JMarino's gcc6-aux does not use an special identifier. It also uses
the "normal" function name directly and it compiles and works. See:
https://github.com/NetBSD/pkgsrc/blob/27a8f94efc02f33007d20a4ba6a8aaa369361b95/lang/gcc6-aux/files/diff-ada#L1584
for another function that gets "renamed". It just works.

The last point is what makes me _very_ hesitant about this issue. Why
would it work for JMarino's gcc and not mine? I have compiled JMarino's
port in the same system.

I may be missing some other fix in some other part...

Anyhow, for the time being, I want to get this working. I will try this
fix and see if it solves the issue.

> Thanks for the link to the NetBSD git sources, I'm trying to build and keep you informed in my progress :-)
>
> Stephane
>

Great!

Regards,
--
Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<sgibli$1qp5$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5763&group=comp.lang.ada#5763

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Mon, 30 Aug 2021 12:24:49 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sgibli$1qp5$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org>
<sggr4p$gta$1@gioia.aioe.org>
<7b5879f1-6d8a-46d7-b761-82c9cf483984n@googlegroups.com>
<sgi40d$1red$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="60197"; 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
 by: Fernando Oleo Blanco - Mon, 30 Aug 2021 10:24 UTC

Actually, I am wrong about the compiler not complaining.

In the last stage of building GCC I get:

..o \
-Wl,-soname,libgnat-10.so \
-lutil -lm
/usr/bin/ld: s-osprim.o: in function `system__os_primitives__timed_delay':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/s-optide.adb:75:
warning: warning: reference to compatibility nanosleep(); include
<time.h> to generate correct reference
/usr/bin/ld: g-socket.o: in function `gnat__sockets__check_selector__2':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/g-socket.adb:566:
warning: warning: reference to compatibility select(); include
<sys/select.h> to generate correct reference
/usr/bin/ld: g-socthi.o: in function `gnat__sockets__thin__c_socket':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/g-socthi.adb:388:
warning: warning: reference to compatibility socket(); include
<sys/socket.h> for correct reference
/usr/bin/ld: s-osprim.o: in function `system__os_primitives__clock':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/s-osprim.adb:91:
warning: warning: reference to compatibility gettimeofday(); include
<sys/time.h> to generate correct reference
cd rts; `echo "/usr/pkgsrc/wip/gcc10-aux/work/build/./gcc/xgcc
-B/usr/pkgsrc/wip/gcc10-aux/work/build/./gcc/
-B/usr/pkg/gcc10/x86_64--netbsd/bin/
-B/usr/pkg/gcc10/x86_64--netbsd/lib/ -isystem
/usr/pkg/gcc10/x86_64--netbsd/include -isystem
/usr/pkg/gcc10/x86_64--netbsd/sys-include " \
| sed -e 's,\./xgcc,../../xgcc,' -e
's,-B\./,-B../../,'` -shared -g -O2 \
-fpic \
-o libgnarl-10.so \
a-dispat.o a-dynpri.o a-interr.o a-intnam.o a-reatim.o
a-retide.o a-rttiev.o a-synbar.o a-sytaco.o a-tasatt.o a-taside.o
a-taster.o g-boubuf.o g-boumai.o g-semaph.o g-signal.o g-tastus.o
g-thread.o s-inmaop.o s-interr.o s-intman.o s-mudido.o s-osinte.o
s-proinf.o s-solita.o s-stusta.o s-taenca.o s-taprob.o s-taprop.o
s-tarest.o s-tasdeb.o s-tasinf.o s-tasini.o s-taskin.o s-taspri.o
s-tasque.o s-tasres.o s-tasren.o s-tassta.o s-tasuti.o s-taasde.o
s-tadeca.o s-tadert.o s-tataat.o s-tpinop.o s-tpoben.o s-tpobop.o
s-tposen.o thread.o \
-Wl,-soname,libgnarl-10.so \
-lpthread -lrt
/usr/bin/ld: s-inmaop.o: in function
`system__interrupt_management__operations___elabb':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/s-inmaop.adb:280:
warning: warning: reference to compatibility sigaction(); include
<signal.h> for correct reference
/usr/bin/ld: s-taprop.o: in function
`system__task_primitives__operations__monotonic__monotonic_clockXnn':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/s-tpopmo.adb:60:
warning: warning: reference to compatibility clock_gettime(); include
<time.h> to generate correct reference
/usr/bin/ld: s-taprop.o: in function
`system__task_primitives__operations__monotonic__rt_resolutionXnn':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/s-tpopmo.adb:76:
warning: warning: reference to compatibility clock_getres(); include
<time.h> to generate correct reference
/usr/bin/ld: s-inmaop.o: in function
`system__interrupt_management__operations__thread_block_interrupt':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/s-inmaop.adb:70:
warning: warning: reference to compatibility sigaddset(); include
<signal.h> for correct reference
/usr/bin/ld: s-inmaop.o: in function
`system__interrupt_management__operations___elabb':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/s-inmaop.adb:314:
warning: warning: reference to compatibility sigdelset(); include
<signal.h> for correct reference
/usr/bin/ld: s-inmaop.o: in function
`system__interrupt_management__operations__thread_block_interrupt':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/s-inmaop.adb:68:
warning: warning: reference to compatibility sigemptyset(); include
<signal.h> for correct reference
/usr/bin/ld: s-inmaop.o: in function
`system__interrupt_management__operations___elabb':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/s-inmaop.adb:295:
warning: warning: reference to compatibility sigfillset(); include
<signal.h> for correct reference
/usr/bin/ld: s-inmaop.o: in function
`system__interrupt_management__operations__is_member':
/usr/pkgsrc/wip/gcc10-aux/work/build/gcc/ada/rts/s-inmaop.adb:230:
warning: warning: reference to compatibility sigismember(); include
<signal.h> for correct reference

when GCC tries to compile libgnarl... So... lets get to renaming these
symbols! And there are noticeable many more failures here that during
ACATS. Maybe I did not get to see all the failures that ACATS was
generating. However, I do not expect any more warnings than these ones,
since this the linking of libgnarl from ALL the object files.

Regards,
--
Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<sgii4n$145i$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5764&group=comp.lang.ada#5764

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Mon, 30 Aug 2021 14:15:18 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sgii4n$145i$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org>
<sggr4p$gta$1@gioia.aioe.org>
<7b5879f1-6d8a-46d7-b761-82c9cf483984n@googlegroups.com>
<sgi40d$1red$1@gioia.aioe.org> <sgibli$1qp5$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="37042"; 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
 by: Fernando Oleo Blanco - Mon, 30 Aug 2021 12:15 UTC

Okay. I have a much much clearer picture now.

I have spoken with a couple of people in the NetBSD IRC. NetBSD has been
revamping their ABI, see for example, the UNIX time.

Some things were going to break. In the case of some of the "standard"
functions, they created a RENAME macro to hide this changes. It leaves a
weak symbol reference that is empty and not resolved by the linker.

After taking a much closer look into the patch set of JMarino, I
realised that he had already dealt with this issue. For example, see:
https://github.com/NetBSD/pkgsrc/blob/27a8f94efc02f33007d20a4ba6a8aaa369361b95/lang/gcc6-aux/files/diff-ada#L1685

I think I am going to use the strategy that Simon pointed out. Since
that would be the most maintainable way for the future... The patching
is going to be much longer than I expected.

Regards,

--
Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<sgj97m$1f65$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5765&group=comp.lang.ada#5765

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Mon, 30 Aug 2021 20:49:26 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sgj97m$1f65$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org>
<sggr4p$gta$1@gioia.aioe.org>
<7b5879f1-6d8a-46d7-b761-82c9cf483984n@googlegroups.com>
<sgi40d$1red$1@gioia.aioe.org> <sgibli$1qp5$1@gioia.aioe.org>
<sgii4n$145i$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="48325"; 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
 by: Fernando Oleo Blanco - Mon, 30 Aug 2021 18:49 UTC

I have good news and bad news.

The good news is that there are no more linker warnings in the RTS!!! :D

The bad news:

1. There are still some symbols missing, but I think they are only
present within the GNAT libraries. This has to be fixed, but it is not a
priority now.

2. The patches are the most horrible fix anybody ever came with.
Basically I just modified the __posix files directly to make it work.
Not very upstream friendly lets say.

3. Finally, and this is killing me. While running the ACATS test suit, I
am getting stalled tests. This has happened in the past, where some
tests just stall and block everything. "No problem" just kill a couple
of tests.
However, for the past day, a lot of tests are stalling. Like 1 every 5.
Heck, some tests that are stalling are compilation tests, meaning that
one it compiles, it basically does nothing and it doing nothing is
considered a PASS, for example test

,.,. A83A02B ACATS 4.1 21-08-30 18:26:03
---- A83A02B CHECK THAT A LABEL IN A NESTED TASK CAN BE IDENTICAL TO A
LABEL OUTSIDE THE TASK.
==== A83A02B PASSED ============================.
PASS: a83a02b

passed when I killed it. Some are failures when I kill them, others that
are/seem stuck are not. But I think they are all related to the tasking
system.

The worst part is that if I leave some tests running indefinitely, such
as the example test above, my NetBSD VM dies. I increased the memory
from 4Gb to 7Gb. Some tests, when left to run, kill the machine.

Since this behaviour is rather recent, I am inclined to believe it is
some other patch that I applied that is not screwing with GCC/Tests. A
lot of these tests used to PASS without issue, even with the linking
problem.

Simon, have you seen this behaviour? Any tips?

Regards,
--
Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<lyh7f6enyp.fsf@pushface.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5766&group=comp.lang.ada#5766

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!RKN7TKnHC01q0gdg6EhkbQ.user.46.165.242.75.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Mon, 30 Aug 2021 20:23:26 +0100
Organization: Aioe.org NNTP Server
Message-ID: <lyh7f6enyp.fsf@pushface.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org>
<sggr4p$gta$1@gioia.aioe.org>
<7b5879f1-6d8a-46d7-b761-82c9cf483984n@googlegroups.com>
<sgi40d$1red$1@gioia.aioe.org> <sgibli$1qp5$1@gioia.aioe.org>
<sgii4n$145i$1@gioia.aioe.org> <sgj97m$1f65$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="16527"; posting-host="RKN7TKnHC01q0gdg6EhkbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:L5FHfQH55FW2UiP/lFbR9pK9WMU=
 by: Simon Wright - Mon, 30 Aug 2021 19:23 UTC

Fernando Oleo Blanco <irvise_ml@irvise.xyz> writes:

> I have good news and bad news.
>
> The good news is that there are no more linker warnings in the RTS!!! :D
>
> The bad news:
[...]
> 3. Finally, and this is killing me. While running the ACATS test suit,
> I am getting stalled tests. This has happened in the past, where some
> tests just stall and block everything. "No problem" just kill a couple
> of tests.
> However, for the past day, a lot of tests are stalling. Like 1 every
> 5.
[...]
> Simon, have you seen this behaviour? Any tips?

No, very sorry (there was one test which stalled, c425-something I
think, but only the one, and that was a while ago)

Re: Help: Ada in NetBSD

<sgni2a$1ggh$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5772&group=comp.lang.ada#5772

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Wed, 1 Sep 2021 11:44:42 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sgni2a$1ggh$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org>
<sggr4p$gta$1@gioia.aioe.org>
<7b5879f1-6d8a-46d7-b761-82c9cf483984n@googlegroups.com>
<sgi40d$1red$1@gioia.aioe.org> <sgibli$1qp5$1@gioia.aioe.org>
<sgii4n$145i$1@gioia.aioe.org> <sgj97m$1f65$1@gioia.aioe.org>
<lyh7f6enyp.fsf@pushface.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="49681"; 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
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Fernando Oleo Blanco - Wed, 1 Sep 2021 09:44 UTC

Here is an update. With more good news than bad ones.

Short summary:

- Personal reminder, do not run ACATS as root.
- Lower the timeout of the tests to 30s setting the global environment
varialbe DEJAGNU_TIMEOUT to 30 (seconds). Some tests will take nearly a
minute to time out, but it is much better than the 300 seconds default.
- Increase the stack size (ulimit -s) of the NetBSD x86_64 machine from
4Mb to 16Mb.
- I ran ACATS twice. One with the default timeout and the other one with
a 30 second timeout.

So, what did I get?

The bad news is that I am getting 411 unexpected failures. All of the
failures can be reproduced up until the middle of the C9 section. The
reason for the "middle of the C9 section" is that I killed the ACATS
running with the default timeout after more than 18h of running.

What is the cause of failure? 95% is timeout.
What about the tests that did not fail because of timeout? One I had to
kill because gcc got stuck. It was indeed a C* test. To be more
specific, it was C452003.

On 30.08.21 21:23, Simon Wright wrote:

> No, very sorry (there was one test which stalled, c425-something I
> think, but only the one, and that was a while ago)

There were a couple other tests that simply just failed: tests c350a01,
c452005, c452006, c611A04, c760a03, just failed "normally".

Same for c3a0018, but that one is strange, since it did not print what
that test is trying to test. It just compiles and fail, no information
about when it got started (time) and the goal of that test. Test c460015
does the same thing.

Test c52103x failed with a r "raised STORAGE_ERROR: stack overflow or
erroneous memory access". So I guess it succeeded? Its definition says:

```
,.,. C52103X ACATS 4.1 21-08-31 09:31:05
---- C52103X CHECK THAT IN ARRAY ASSIGNMENTS AND IN SLICE ASSIGNMENTS,
THE LENGTHS MUST MATCH; ALSO CHECK WHETHER
CONSTRAINT_ERROR OR STORAGE_ERROR ARE RAISED FOR LARGE
ARRAYS.
- C52103X NO CONSTRAINT_ERROR FOR TYPE WITH 'LENGTH = INTEGER'LAST +
3.

raised STORAGE_ERROR : stack overflow or erroneous memory access
FAIL: c52103x
```
Same error failure for c52104x, c52104y, c650b04 and c93007a. But their
description leads me to believe they should not fail that way.

Tests cb1010c, cb1010d, should fail with a STORAGE_ERROR and they do,
but they are flagged as FAIL.

cdd2b04, cxaib05, cxaib06 and cxaib08 fail because of a compilation error:
```
cdd2b04.adb:116:12: stream size for elementary type must be a power of 2
and at least 8
gnatmake: "cdd2b04.adb" compilation error
FAIL: cdd2b04
```
```
cxaib05_data.ads:70:04: private object not allowed in preelaborated unit
cxaib05_data.ads:70:04: would be legal if pragma
Preelaborable_Initialization give
n for "Map" at a-coorma.ads:54, instance at line 66
cxaib05_data.ads:77:04: private object not allowed in preelaborated unit
cxaib05_data.ads:77:04: would be legal if pragma
Preelaborable_Initialization give
n for "Map" at a-coorma.ads:54, instance at line 72
gnatmake: "cxaib05.adb" compilation error
FAIL: cxaib05
```
```
cxaib06_data.ads:69:04: instantiation error at a-cborma.ads:351
cxaib06_data.ads:69:04: object in preelaborated unit has non-static
default at a-crbltr.ads:74, instance at a-cborma.ads:245, instance at
line 69
cxaib06_data.ads:75:04: instantiation error at a-cborma.ads:351
cxaib06_data.ads:75:04: object in preelaborated unit has non-static
default at a-crbltr.ads:74, instance at a-cborma.ads:245, instance at
line 75
gnatmake: "cxaib06.adb" compilation error
FAIL: cxaib06
```
```
cxaib08_data.ads:69:04: instantiation error at a-cbhama.ads:450
cxaib08_data.ads:69:04: object in preelaborated unit has non-static
default at a-cohata.ads:75, instance at a-cbhama.ads:337, instance at
line 69
cxaib08_data.ads:77:04: instantiation error at a-cbhama.ads:450
cxaib08_data.ads:77:04: object in preelaborated unit has non-static
default at a-cohata.ads:75, instance at a-cbhama.ads:337, instance at
line 77
gnatmake: "cxaib08.adb" compilation error
FAIL: cxaib08
```

ALSO! I get this error at the very beginning:
```
cannot generate code for file b~impbit.ads (package spec)
gnatmake: "b~impbit.ads" compilation error
```

But then the actual body gets compiled:
```
gcc -c -gnatws -g -O2 -gnato -gnatE b~impbit.adb
```

Okay, too much text and very little insight. So what is the insight?

I guess that there must be a couple of bad things either in the code or
in my system that just make about 400 fail because of timeout... I will
keep on digging. The vast majority of failures take place in the C9
section. As per
http://www.ada-auth.org/acats-files/4.1/docs/ACATS-UG.PDF it should be
about section 9 of the RM. Section 9 is about... You guess it! Tasks and
Synchronization!

So I now know where to look. However, I may need some pointers/extra tests.

So, Simon, Stephane, here I am leaving you with some goodies, should you
want to take a look:

The pkgsrc recipe for gcc10-aux as I currently have it. Maybe the
tasking errors only happen on my system. You may want to test this
Stephane: https://irvise.xyz/gcc10-aux.tar.gz

The ACATS log: https://irvise.xyz/acats.tar.gz

I will keep on digging. Regards,
--
Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<646f270d-0e65-46a5-b40a-02afab608f1en@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5773&group=comp.lang.ada#5773

 copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:1189:: with SMTP id b9mr8507462qkk.100.1630502926397; Wed, 01 Sep 2021 06:28:46 -0700 (PDT)
X-Received: by 2002:a25:448b:: with SMTP id r133mr39314530yba.303.1630502923334; Wed, 01 Sep 2021 06:28:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 1 Sep 2021 06:28:43 -0700 (PDT)
In-Reply-To: <sgfpod$19sl$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=167.224.180.211; posting-account=Sb6xTwoAAACjFNT1P2nKuvcf0tSkJUed
NNTP-Posting-Host: 167.224.180.211
References: <sgfpod$19sl$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <646f270d-0e65-46a5-b40a-02afab608f1en@googlegroups.com>
Subject: Re: Help: Ada in NetBSD
From: mfl-comm...@marino.st (John R. Marino)
Injection-Date: Wed, 01 Sep 2021 13:28:46 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 26
 by: John R. Marino - Wed, 1 Sep 2021 13:28 UTC

Fernando,
Maybe you are in luck.
A friend of mine needs Ravenports (http://www.ravenports.com/) to support NetBSD. Ravenports has the same base compiler for all supported systems. It was GCC 9.3 but I'm the process of completing the transition to GCC 11.2.0. This base compiler has to support Ada among other languages.
Which is a long way of saying I have polish my netbsd patches for that compiler and re-bootstrap it back to NetBSD.
So I'll be working on this separately (for GCC 11.2, not 10.x).
My process will be different.
I cross-compile it on another host, then bring it over to NetBSD and eventfully it builds itself natively.
I'm awaiting an SSD to arrive which I'll install the latest NetBSD on.
My gcc6-aux work has been living on: https://github.com/jrmarino/draco
While the patches are current for FreeBSD, DragonFly, Linux, Solaris and probably Android, I did let OpenBSD and NetBSD support slip.
But I'm not starting from scratch.

I'll look over your work.
And with regard to the test suite, I got all the tests to pass back then:
http://www.dragonlace.net/gnataux/netbsd64/

Which reminds me: I'd only do this for x86_64 platform.
Regards,
John

Re: Help: Ada in NetBSD

<sgo4f7$lri$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5774&group=comp.lang.ada#5774

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (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: <sgo4f7$lri$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<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
 by: Fernando Oleo Blanco - Wed, 1 Sep 2021 14:58 UTC

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

Re: Help: Ada in NetBSD

<ly5yvkdldp.fsf@pushface.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5780&group=comp.lang.ada#5780

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!RKN7TKnHC01q0gdg6EhkbQ.user.46.165.242.75.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Wed, 01 Sep 2021 22:41:22 +0100
Organization: Aioe.org NNTP Server
Message-ID: <ly5yvkdldp.fsf@pushface.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org>
<sggr4p$gta$1@gioia.aioe.org>
<7b5879f1-6d8a-46d7-b761-82c9cf483984n@googlegroups.com>
<sgi40d$1red$1@gioia.aioe.org> <sgibli$1qp5$1@gioia.aioe.org>
<sgii4n$145i$1@gioia.aioe.org> <sgj97m$1f65$1@gioia.aioe.org>
<lyh7f6enyp.fsf@pushface.org> <sgni2a$1ggh$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="51604"; posting-host="RKN7TKnHC01q0gdg6EhkbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:j1NhZDGKvw4dW07QUe8BuxU9SdQ=
 by: Simon Wright - Wed, 1 Sep 2021 21:41 UTC

Fernando Oleo Blanco <irvise_ml@irvise.xyz> writes:

[failing tests, log output ...]

With 10.1.0, I see

*** FAILURES: c250002 c324006 c350a01 c452003 c452005 c452006 c611a04
c650b04 c760a02 cdd2b03 cdd2b04 cxai001 cxai010 cxaia01 cxaib05
cxaib06 cxaib08 cxd1003 cxd1004 cxd1005 cxd2006 cxd3001 cxd3002

(and c452003 was the one whose compilation I had to kill)

> ALSO! I get this error at the very beginning:
> ```
> cannot generate code for file b~impbit.ads (package spec)
> gnatmake: "b~impbit.ads" compilation error
> ```

Yes, this is an error in my ACATS (attempts to compile specs, fails on
the first one). Also, should really clear up the b~ files (part of
executable build).

> So, Simon, Stephane, here I am leaving you with some goodies, should
> you want to take a look:

Sounds as though John can give you a better steer than I can.

> The ACATS log: https://irvise.xyz/acats.tar.gz

Thanks.

Re: Help: Ada in NetBSD

<sgrif8$acj$1@franka.jacob-sparre.dk>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5789&group=comp.lang.ada#5789

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.swapon.de!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Thu, 2 Sep 2021 17:16:07 -0500
Organization: JSA Research & Innovation
Lines: 18
Message-ID: <sgrif8$acj$1@franka.jacob-sparre.dk>
References: <sgfpod$19sl$1@gioia.aioe.org> <16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com> <sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org> <sggr4p$gta$1@gioia.aioe.org> <7b5879f1-6d8a-46d7-b761-82c9cf483984n@googlegroups.com> <sgi40d$1red$1@gioia.aioe.org> <sgibli$1qp5$1@gioia.aioe.org> <sgii4n$145i$1@gioia.aioe.org> <sgj97m$1f65$1@gioia.aioe.org> <lyh7f6enyp.fsf@pushface.org> <sgni2a$1ggh$1@gioia.aioe.org>
Injection-Date: Thu, 2 Sep 2021 22:16:08 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="10643"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Thu, 2 Sep 2021 22:16 UTC

"Fernando Oleo Blanco" <irvise_ml@irvise.xyz> wrote in message
news:sgni2a$1ggh$1@gioia.aioe.org...
....
> What is the cause of failure? 95% is timeout.
> What about the tests that did not fail because of timeout? One I had to
> kill because gcc got stuck. It was indeed a C* test. To be more specific,
> it was C452003.

Some GNAT versions have bugs with some newer tests. I believe that is one of
them that hangs GNAT. You have to kill GNAT if that happens (yes, it is a
pain if you are using a script that runs everything). I believe that this
hang is fixed in the newest versions of GNAT, but that may not be the one
that you are running.

Randy.

Re: Help: Ada in NetBSD

<ly1r65e7lt.fsf@pushface.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5802&group=comp.lang.ada#5802

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!RKN7TKnHC01q0gdg6EhkbQ.user.46.165.242.75.POSTED!not-for-mail
From: sim...@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Fri, 03 Sep 2021 21:18:06 +0100
Organization: Aioe.org NNTP Server
Message-ID: <ly1r65e7lt.fsf@pushface.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com>
<sggier$gb2$1@gioia.aioe.org> <lyzgt0ds72.fsf@pushface.org>
<sggr4p$gta$1@gioia.aioe.org>
<7b5879f1-6d8a-46d7-b761-82c9cf483984n@googlegroups.com>
<sgi40d$1red$1@gioia.aioe.org> <sgibli$1qp5$1@gioia.aioe.org>
<sgii4n$145i$1@gioia.aioe.org> <sgj97m$1f65$1@gioia.aioe.org>
<lyh7f6enyp.fsf@pushface.org> <sgni2a$1ggh$1@gioia.aioe.org>
<sgrif8$acj$1@franka.jacob-sparre.dk>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="40739"; posting-host="RKN7TKnHC01q0gdg6EhkbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:m2jR75inWOOIj1UGlAGFiaTy2rs=
 by: Simon Wright - Fri, 3 Sep 2021 20:18 UTC

"Randy Brukardt" <randy@rrsoftware.com> writes:

> "Fernando Oleo Blanco" <irvise_ml@irvise.xyz> wrote in message
> news:sgni2a$1ggh$1@gioia.aioe.org...
> ...
>> What is the cause of failure? 95% is timeout.
>> What about the tests that did not fail because of timeout? One I had to
>> kill because gcc got stuck. It was indeed a C* test. To be more specific,
>> it was C452003.
>
> Some GNAT versions have bugs with some newer tests. I believe that is one of
> them that hangs GNAT. You have to kill GNAT if that happens (yes, it is a
> pain if you are using a script that runs everything). I believe that this
> hang is fixed in the newest versions of GNAT, but that may not be the one
> that you are running.

Fernando is running 10.3, I think: c452003 hangs in 10.1, OK in 11.1.

Re: Help: Ada in NetBSD

<sho6et$lgq$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5902&group=comp.lang.ada#5902

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!dGELjPO44lRgUjmZYA5/xw.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Mon, 13 Sep 2021 20:49:01 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sho6et$lgq$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<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="22042"; posting-host="dGELjPO44lRgUjmZYA5/xw.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.1.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Fernando Oleo Blanco - Mon, 13 Sep 2021 18:49 UTC

On 01.09.21 15:28, John R. Marino wrote:
> Which reminds me: I'd only do this for x86_64 platform.
> Regards,
> John

An update on my side. I have not done any more work on the port.

However, I have managed to get a Raspberry Pi 3 (aarch64). This would
allow me (in theory) to test NetBSD, FreeBSD and OpenBSD on the board
with different architectures. I have NetBSD-earmv6hf "intalled". I could
try in the future v7 and aarch64. Same for FreeBSD (aarch64/arm{6?,7})
and OpenBSD (aarch64).

I wanted to ask you a question John, maybe you can answer it.

In the Makefile.rtl, there are OS/architecture pairs. For example, there
is an entry for FreeBSD-x86 and FreeBSD-x86_64. My basic question is,
why not just have an entry per OS?

I can already answer that question, some architectures have more support
that others and the files that they use are different. Okay, I get that.
But for the previous example with FreeBSD, as far as I can recall, the
Makefile.rtl entries were exactly the same (minus the arch matching
mechanism). If the arch is dropped, then, in theory, the OS would be
able to compile on any arch without the need of patching. This is
important if I want to run FreeBSD on arm, for example.

And the differences I have seen regarding different architectures for
different OSes, is mostly due to some advance features that the OS
probably can already expose, so I am a bit surprised. After all, the OS
is supposed to "hide" the hardware away.

Anyhow. Regards,

Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<p9jvjgd6gju9dk4l2d3upev4bb9u3q6c93@4ax.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5904&group=comp.lang.ada#5904

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 13 Sep 2021 17:24:04 -0500
From: wlfr...@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Mon, 13 Sep 2021 18:24:04 -0400
Organization: IISS Elusive Unicorn
Message-ID: <p9jvjgd6gju9dk4l2d3upev4bb9u3q6c93@4ax.com>
References: <sgfpod$19sl$1@gioia.aioe.org> <646f270d-0e65-46a5-b40a-02afab608f1en@googlegroups.com> <sho6et$lgq$1@gioia.aioe.org>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 25
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-G62nH1U7Kl7RH6a7drzWeTOoRK2fdSg7TzJ67w8QMj6lPWVcOTkbLBJmiL1wOj33spOZOw3x9hp5jOg!kS/5mmniHwJR70HnkMXoYZoA8vjAtgLs/0uZTTlrzStNbYKVA+pun6af1sBF+wkHCxfkXUyg
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2145
 by: Dennis Lee Bieber - Mon, 13 Sep 2021 22:24 UTC

On Mon, 13 Sep 2021 20:49:01 +0200, Fernando Oleo Blanco
<irvise_ml@irvise.xyz> declaimed the following:

>
>In the Makefile.rtl, there are OS/architecture pairs. For example, there
>is an entry for FreeBSD-x86 and FreeBSD-x86_64. My basic question is,
>why not just have an entry per OS?
>
In typical usage, x86 is 32-bit only, x86_64 is 64-bit with support for
running 32-bit applications.

ARM 64-bit should support running 32-bit applications, but may not
support the 16-bit "Thumb" instructions which are available in many of the
32-bit models. There is also the question of hardware floating point (which
may only be 32-bit).

The difference between 32 and 64 bit is significant when compiling
code, as it determines if the code does native 64-bit "long integers" or
requires software emulation for such data lengths.

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: Help: Ada in NetBSD

<si2inq$11pn$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5938&group=comp.lang.ada#5938

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!dGELjPO44lRgUjmZYA5/xw.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Fri, 17 Sep 2021 19:19:54 +0200
Organization: Aioe.org NNTP Server
Message-ID: <si2inq$11pn$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<646f270d-0e65-46a5-b40a-02afab608f1en@googlegroups.com>
<sho6et$lgq$1@gioia.aioe.org> <p9jvjgd6gju9dk4l2d3upev4bb9u3q6c93@4ax.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="34615"; posting-host="dGELjPO44lRgUjmZYA5/xw.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.1.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Fernando Oleo Blanco - Fri, 17 Sep 2021 17:19 UTC

On 14.09.21 00:24, Dennis Lee Bieber wrote:
> The difference between 32 and 64 bit is significant when compiling
> code, as it determines if the code does native 64-bit "long integers" or
> requires software emulation for such data lengths.
>

While I understand that part, I still do not fully understand why do we
need _exact_ entries for the same OS but different architectures. If we
are just copypasting code, it would be cleaner, shorter, more
maintainable and concise to just match over the OS and not the arch.

And I think there are no architecture dependent bits int the (large) OS
entries in the Makefile.rtl file. I would expect the compiler to do as
you say, generate valid code for that architecture. But that would be
the task of the compiler itself, not the RTL in large OSes (Linux,
*BSDs), the RTL in those cases just simply translates the
utilities/tools that the OS provides. Once again, the entries for x86
and x86_64 of FreeBSD are a exact copy.

I am not saying that you are wrong, I am just trying to understand the
why of this multiplication of effort. I saw nothing there that would
affect the type of compilation as you describe it, like compiler directives.

Regards,
--
Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<si2jm1$1i9p$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5939&group=comp.lang.ada#5939

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.niel.me!aioe.org!dGELjPO44lRgUjmZYA5/xw.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Fri, 17 Sep 2021 19:36:01 +0200
Organization: Aioe.org NNTP Server
Message-ID: <si2jm1$1i9p$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<646f270d-0e65-46a5-b40a-02afab608f1en@googlegroups.com>
<sgo4f7$lri$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="51513"; posting-host="dGELjPO44lRgUjmZYA5/xw.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.1.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Fernando Oleo Blanco - Fri, 17 Sep 2021 17:36 UTC

Another update on my side, this time with a bit more content.

Following the help provided by Arnaud, I modified the flags with which
the ACATS's tests get compiled.

To the gnatmake command I added the -f -a -g -j0 flags.

-f to force the recompilation of all files needed with the exception of
the runtime and library files.
-a is to also force the recompilation of the library & runtime files.
Whatever is needed.
-g debugging.
-j0 ignored by the ACATS suite provided by Simon (or so says the
documentation in the shell file).

This flags make the compilation much slower, obviously, since nearly for
every test the entire Ada library needs to be recompiled. However, this
started to give me a much better insight on what was going on. Specially
since now I could debug the failing tests.

I noticed that the first test I started debugging was stuck in a loop
related to task management. This would explain why I was getting so many
tests failing with timeouts. Great, but I could only get so much insight.

Arnaud, once again came to the rescue and indicated that I should add
the -gnata flag.

-gnata is to enable assertions.

And yes, now the tests were finally failing in a meaningful manner. I
have written the assertions I have found that failed. Remember, I am
using GCC 10.3 with the patch set that is available in my website. You
can find it in one of the messages I have sent in this thread.

So, what do we get?

System.Assertions. Assert_Failure in s-tassta.adb:1643 (very common
everywhere), s-tpopmo.adb:213 (fairly common) and s-taprop.adb:463
(common in the c9 section).

Storage_Error in s-intman.adb:136

Stack overflow or erroneous memory access in a few tests. I got no
pointer on where it was happening.

And still some timeouts, but I think they are related to the first
assertion mentioned.

The "strange" (not that much) is that I have not touched any of these
files. I will see where they are used in the compiler, how they are used
and if the issues are related with how NetBSD handles some
functions/standards... The s-tassta.adb problem I know is 100% related
to POSIX Threads. Maybe the issue is in the POSIX Threads handling or
maybe not.

I will keep on digging. Regards,
--
Fernando Oleo Blanco
https://irvise.xyz

Re: Help: Ada in NetBSD

<si54o5$h7b$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5952&group=comp.lang.ada#5952

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!dGELjPO44lRgUjmZYA5/xw.user.46.165.242.75.POSTED!not-for-mail
From: irvise...@irvise.xyz (Fernando Oleo Blanco)
Newsgroups: comp.lang.ada
Subject: Re: Help: Ada in NetBSD
Date: Sat, 18 Sep 2021 18:39:33 +0200
Organization: Aioe.org NNTP Server
Message-ID: <si54o5$h7b$1@gioia.aioe.org>
References: <sgfpod$19sl$1@gioia.aioe.org>
<646f270d-0e65-46a5-b40a-02afab608f1en@googlegroups.com>
<sgo4f7$lri$1@gioia.aioe.org> <si2jm1$1i9p$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="17643"; posting-host="dGELjPO44lRgUjmZYA5/xw.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.1.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Fernando Oleo Blanco - Sat, 18 Sep 2021 16:39 UTC

Welp, I have another "major" update...

I talked to #netbsd and asked if there was anything I should be aware
when dealing with pthreads in NetBSD. I did not get any much advice, but
I was told that there were some issues with lwps that were fixed. Lwp
stands for Lightweight processes.

I went ahead and started debugging a failing test. After running the
program a few times in gdb, I got a message related to a potential issue
with the lwp (this test was using tasking).

Interesting I told myself, but I did not dig any further. Here was the
issue. I was using an installation of NetBSD that is modified, it is the
OS108 "distro". It is created by a fellow Ada lover Jay Patelani. The
thing is that OS108 as it stood when I installed, was based on a
development version of NetBSD 9.1. I decided that if there were
potential issues because of the development version, I did not want to
find out; specially after being warned about lwps.

So I updated to NetBSD 9.2, the latest stable release. And I ran the
tests once again............ And guess what. I am getting the exact same
failing tests, but, for the time being (the tests are still running),
all have failed with the same raised exception. And this exception is
"new", it was not part of the ones I named in the previous email.

It is "raised SYSTEM.ASSERTIONS.ASSERT_FAILURE : s-taprop.adb:659"
s-taprop was already raising an exception before, but in line 463 and
just in some cases. Let me repeat it once again, all tests that I have
seen so far, that fail with an exception that is not related to Storage,
are failing only with this "new" one. That is a great thing in terms of
narrowing down where the potential issue may lie. It also means that
much of my work is not really that helpful... And maybe even that it has
always been working, and I just need to recompile GCC... Oh no... That
idea just came up in my head while typing...

I will be back in about 6 hours.

Regards,
--
Fernando Oleo Blanco
https://irvise.xyz

Pages:12
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor