comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Help: Ada in NetBSD
Date: Sun, 29 Aug 2021 19:25:05 +0100	[thread overview]
Message-ID: <lyzgt0ds72.fsf@pushface.org> (raw)
In-Reply-To: sggier$gb2$1@gioia.aioe.org

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).

  reply	other threads:[~2021-08-29 18:25 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-29 11:06 Help: Ada in NetBSD Fernando Oleo Blanco
2021-08-29 13:19 ` Stephane Carrez
2021-08-29 18:08   ` Fernando Oleo Blanco
2021-08-29 18:25     ` Simon Wright [this message]
2021-08-29 20:36       ` Fernando Oleo Blanco
2021-08-29 22:08         ` Stephane Carrez
2021-08-30  7:37           ` Simon Wright
2021-08-30  8:14           ` Fernando Oleo Blanco
2021-08-30 10:24             ` Fernando Oleo Blanco
2021-08-30 12:15               ` Fernando Oleo Blanco
2021-08-30 18:49                 ` Fernando Oleo Blanco
2021-08-30 19:23                   ` Simon Wright
2021-09-01  9:44                     ` Fernando Oleo Blanco
2021-09-01 21:41                       ` Simon Wright
2021-09-02 22:16                       ` Randy Brukardt
2021-09-03 20:18                         ` Simon Wright
2021-08-29 17:34 ` Simon Wright
2021-08-29 17:45   ` Fernando Oleo Blanco
2021-09-01 13:28 ` John R. Marino
2021-09-01 14:58   ` Fernando Oleo Blanco
2021-09-17 17:36     ` Fernando Oleo Blanco
2021-09-18 16:39       ` Fernando Oleo Blanco
2021-09-22 20:05         ` Fernando Oleo Blanco
2021-09-22 20:57           ` Simon Wright
2021-09-23  8:04           ` Luke A. Guest
2021-09-23 10:48             ` Kevin Chadwick
2021-09-23 17:01               ` Fernando Oleo Blanco
2021-09-23 17:04             ` Fernando Oleo Blanco
2021-09-23 19:53           ` Fernando Oleo Blanco
2021-09-24  7:48             ` Simon Wright
2021-09-24  9:44               ` Fernando Oleo Blanco
2021-09-13 18:49   ` Fernando Oleo Blanco
2021-09-13 22:24     ` Dennis Lee Bieber
2021-09-17 17:19       ` Fernando Oleo Blanco
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox