public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Iain Sandoe <idsandoe@googlemail.com>
Cc: Pierre-Marie de Rodat <derodat@adacore.com>,
	gcc-patches@gcc.gnu.org,
	       Olivier Hainque <hainque@adacore.com>
Subject: Re: [Ada] Fix 32/64bit mistake on SYSTEM_INFO component in s-win32
Date: Fri, 20 Sep 2019 12:57:00 -0000	[thread overview]
Message-ID: <yddtv97m8gf.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <54C6899E-E8CA-464E-93A9-F45E284E8B29@googlemail.com> (Iain	Sandoe's message of "Thu, 19 Sep 2019 16:02:20 +0100")

Hi Iain,

>> On 19 Sep 2019, at 15:51, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
>> 
>
>>>> On 18 Sep 2019, at 09:39, Pierre-Marie de Rodat <derodat@adacore.com> wrote:
>>>> 
>>> 
>>>> gcc/testsuite/
>>>> 
>>>> 	* gnat.dg/system_info1.adb: New testcase.<patch.diff>
>>> 
>>> This new test fails everywhere on Darwin, which doesn’t have an
>>> implementation for
>>> System.Task_Info.Number_Of_Processors
>>> 
>>> Given 
>>> "pragma Obsolescent (Task_Info, "use System.Multiprocessors and CPU
>>> aspect”);”
>>> 
>>> is it worth me trying to implement the Task_Info stuff?
>> 
>> I'm seeing the same on Solaris (will be every non-Linux/MinGW target).
>> I've implemented Number_Of_Processors using
>> sysconf(__SC_NPROCESSORS_ONLN), which is also available on Darwin.  Will
>> submit the patch tomorrow once testing has finished…
>
> OK. it’s likely that the same (almost) patch will work for Darwin which
> also has that Posix call.
>
> I’ll look at your patch and adapt it for Darwin then,
>
> I don’t *think* we can make:
>
> s-tasinf__posix.ad? 
>
> using that since  I think __SC_NPROCESSORS_ONLN is an optional addition? 
> (but ICBW about that)

there are two issues here:

* _SC_NPROCESSORS_ONLN is not in XPG7 according to
  https://pubs.opengroup.org/onlinepubs/9699919799/.  gnulib
  (lib/nproc.c) lists it as an addition in glibc,
  Mac OS X 10.5, FreeBSD, AIX, OSF/1, Solaris, Cygwin, Haiku.

* In theory, one could at least move the sysconf declaration to a common
  s-osinte__posix.ads since that function *is* part of XPG7.  In fact,
  we already have a couple of duplicate declarations in
  s-osinte__android.ads, s-osinte__kfreebsd-gnu.ads,
  s-osinte__lynxos178.adb, s-osinte__linux.ads, and
  s-taprop__solaris.adb (with a different return type).  While it would
  be good to unify them to avoid the duplication, I don't see how to do
  so: s-osinte.ads is already linked to one of several different
  target-specific versions.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

      parent reply	other threads:[~2019-09-20 12:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18  8:40 Pierre-Marie de Rodat
2019-09-19 14:41 ` Iain Sandoe
2019-09-19 14:56   ` Rainer Orth
2019-09-19 15:02     ` Iain Sandoe
2019-09-19 16:40       ` Olivier Hainque
2019-09-20 12:21         ` Olivier Hainque
2019-09-20 13:02           ` Rainer Orth
2019-09-20 14:12             ` Arnaud Charlet
2019-09-23 10:12               ` Rainer Orth
2019-09-20 12:57       ` Rainer Orth [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yddtv97m8gf.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=derodat@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hainque@adacore.com \
    --cc=idsandoe@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).