[Mesa-dev] [PATCH] Android: define PIPE_OS_BSD

Jonathan Gray jsg at jsg.id.au
Wed Jun 7 13:54:00 UTC 2017


On Wed, Jun 07, 2017 at 02:45:15PM +0100, Emil Velikov wrote:
> On 6 June 2017 at 07:30, Chih-Wei Huang <cwhuang at android-x86.org> wrote:
> > 2017-06-06 13:06 GMT+08:00 Chih-Wei Huang <cwhuang at android-x86.org>:
> >> 2017-06-05 21:04 GMT+08:00 Emil Velikov <emil.l.velikov at gmail.com>:
> >>> On 4 June 2017 at 04:31, Chih-Wei Huang <cwhuang at android-x86.org> wrote:
> >>>> Android bionic is derived from OpenBSD. So the logics of BSD
> >>>> almost apply to Android as well.
> >>>>
> >>> Having platform FOO define both PIPE_OS_BSD and PIPE_OS_LINUX does not
> >>> seem so obvious bth.
> >>
> >> Yeah.. but that's true.
> >> Android is a BSD-style userspace
> >> running on a Linux kernel.
> >>
> >>>> It fixes the warnings
> >>>>
> >>>> external/mesa/src/gallium/auxiliary/os/os_process.c:43:2: warning: unexpected platform in os_process.c [-W#warnings]
> >>>>  ^
> >>>> external/mesa/src/gallium/auxiliary/os/os_process.c:97:2: warning: unexpected platform in os_process.c [-W#warnings]
> >>>
> >>> These are are due to program_invocation_short_name/getprogname. How
> >>> about updating the file alike xmlconfig.c?
> >>
> >> Oh... I didn't notice that.
> >> Let me check.
> >
> > Well, I saw several BSD OSes define
> > the same context:
> >
> > #elif defined(__NetBSD__) && defined(__NetBSD_Version__) &&
> > (__NetBSD_Version__ >= 106000100)
> > #    include <stdlib.h>
> > #    define GET_PROGRAM_NAME() getprogname()
> > #elif defined(__DragonFly__)
> > #    include <stdlib.h>
> > #    define GET_PROGRAM_NAME() getprogname()
> > #elif defined(__APPLE__)
> > #    include <stdlib.h>
> > #    define GET_PROGRAM_NAME() getprogname()
> > #elif ...
> >
> > Not sure why has no OpenBSD?
> Your guess is as good as mine. Jonathan, any ideas if/who this is
> supposed to work for you guys?

I have no idea where that block comes from as the latest
src/gallium/auxiliary/os/os_process.c
is still

#elif defined(__GLIBC__) || defined(__CYGWIN__)
      name = program_invocation_short_name;
#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
      /* *BSD and OS X */
      name = getprogname();
#elif defined(PIPE_OS_HAIKU)
      image_info info;
      get_image_info(B_CURRENT_TEAM, &info);
      name = info.name;
#else
#warning unexpected platform in os_process.c
      return FALSE;
#endif

> 
> > Android definitely has getprogname().
> > (at least since Lollipop as I know)
> >
> > Should I add:
> >
> > #elif defined(__OpenBSD__) || defined(ANDROID)
> > #    include <stdlib.h>
> > #    define GET_PROGRAM_NAME() getprogname()
> > #elif...
> >
> > I either don't understand why not all the BSD OSes
> > which has getprogname() share the same if case.
> >
> It should be doable but need a bit of cleanup:
>  - doubt we're can use GLIBC earlier than v2 // not BSD related
>  - the FreeBSD/NetBSD version checks could(?) be dropped
> For each case, please check (CC) some people using the respective platform.
> Mesa git log and the respective upstream repos should have contact points.
> 
> Thanks
> Emil


More information about the mesa-dev mailing list