Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ada > #49357

Re: Help: Ada in NetBSD

Path csiph.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!feeder1.feed.usenet.farm!feed.usenet.farm!aioe.org!RKN7TKnHC01q0gdg6EhkbQ.user.46.165.242.75.POSTED!not-for-mail
From Simon Wright <simon@pushface.org>
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> (permalink)
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
Xref csiph.com comp.lang.ada:49357

Show key headers only | View raw


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

Back to comp.lang.ada | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-29 13:06 +0200
  Re: Help: Ada in NetBSD Stephane Carrez <stephane.carrez@gmail.com> - 2021-08-29 06:19 -0700
    Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-29 20:08 +0200
      Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-08-29 19:25 +0100
        Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-29 22:36 +0200
          Re: Help: Ada in NetBSD Stephane Carrez <stephane.carrez@gmail.com> - 2021-08-29 15:08 -0700
            Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-08-30 08:37 +0100
            Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-30 10:14 +0200
              Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-30 12:24 +0200
                Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-30 14:15 +0200
                Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-30 20:49 +0200
                Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-08-30 20:23 +0100
                Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-01 11:44 +0200
                Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-09-01 22:41 +0100
                Re: Help: Ada in NetBSD "Randy Brukardt" <randy@rrsoftware.com> - 2021-09-02 17:16 -0500
                Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-09-03 21:18 +0100
  Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-08-29 18:34 +0100
    Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-29 19:45 +0200
  Re: Help: Ada in NetBSD "John R. Marino" <mfl-commissioner@marino.st> - 2021-09-01 06:28 -0700
    Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-01 16:58 +0200
      Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-17 19:36 +0200
        Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-18 18:39 +0200
          Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-22 22:05 +0200
            Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-09-22 21:57 +0100
            Re: Help: Ada in NetBSD "Luke A. Guest" <laguest@archeia.com> - 2021-09-23 09:04 +0100
              Re: Help: Ada in NetBSD Kevin Chadwick <m8il1ists@gmail.com> - 2021-09-23 03:48 -0700
                Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-23 19:01 +0200
              Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-23 19:04 +0200
            Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-23 21:53 +0200
              Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-09-24 08:48 +0100
                Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-24 11:44 +0200
    Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-13 20:49 +0200
      Re: Help: Ada in NetBSD Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2021-09-13 18:24 -0400
        Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-17 19:19 +0200

csiph-web