Hi Iain, >> On 19 Sep 2019, at 15:51, Rainer Orth <r...@cebitec.uni-bielefeld.de> wrote: >> > >>>> On 18 Sep 2019, at 09:39, Pierre-Marie de Rodat <dero...@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