Bug 99701 - loader.c:353:8: error: implicit declaration of function 'geteuid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
Summary: loader.c:353:8: error: implicit declaration of function 'geteuid' is invalid ...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Mac OS X (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords: bisected, regression
Depends on:
Blocks:
 
Reported: 2017-02-07 00:43 UTC by Vinson Lee
Modified: 2017-02-10 12:11 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
always include unistd.h (824 bytes, patch)
2017-02-07 07:45 UTC, Nicolai Hähnle
Details | Splinter Review

Description Vinson Lee 2017-02-07 00:43:23 UTC
mesa: 47ca0f537dfbc03f0eb0cb12fdee06dbe664fbc7 (master 17.1.0-devel)

  CC       libloader_la-loader.lo
loader.c:353:8: error: implicit declaration of function 'geteuid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   if (geteuid() == getuid()) {
       ^

commit 3f462050c29dc29139732987c9c9ef9a670133ab
Author: Eric Anholt <eric@anholt.net>
Date:   Fri Feb 3 11:02:59 2017 -0800

    loader: Add an environment variable to override driver name choice.
    
    My vc4 simulator has been implemented so far by having an entrypoint
    claiming to be i965, which was a bit gross.  The simulator would be a lot
    less special if we entered through the vc4 entrypoint like normal, so add
    a loader environment variable to allow the i965 fd to probe as vc4.
    
    Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
    Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Comment 1 Nicolai Hähnle 2017-02-07 07:45:46 UTC
Created attachment 129378 [details] [review]
always include unistd.h

The attached patch might fix this.

Out of curiosity, what kind of configuration are you building for?
Comment 2 Emil Velikov 2017-02-07 12:56:04 UTC
(In reply to Nicolai Hähnle from comment #1)
> Created attachment 129378 [details] [review] [review]
> always include unistd.h
> 
For the patch
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

> The attached patch might fix this.
> 
> Out of curiosity, what kind of configuration are you building for?
Second that. Vinson can you get some info about your platforms + configure permutations somewhere in a single place. Having the build log(s) would be amazing ;-)
Comment 3 Vinson Lee 2017-02-09 21:59:21 UTC
Applied attachment 129378 [details] [review]. The build still fails.

$ ./autogen.sh --disable-egl --disable-gbm --disable-dri --with-dri-drivers=swrast --with-gallium-drivers=swrast
$ make
[...]
  CC     libloader_la-loader.lo
loader.c: In function ‘loader_get_driver_for_fd’:
loader.c:355: error: implicit declaration of function ‘getenv’
Comment 4 Emil Velikov 2017-02-10 12:11:02 UTC
Should be resolved with

commit de6e6a347dd12c079a098f3f3095394eed326166
Author: Nicolai Hähnle <nicolai.haehnle@amd.com>
Date:   Tue Feb 7 08:43:09 2017 +0100

    loader: unconditionally include unistd.h and stdlib.h


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.