Discussion:
[PATCH] r600: include libelf headers only as needed
(too old to reply)
Emil Velikov
2017-06-17 10:43:11 UTC
Permalink
Raw Message
From: Emil Velikov <***@collabora.com>

Headers are required only when building with OpenCL. As we're building
w/o it libelf may be missing, hence we'll error out as below:

src/gallium/drivers/r600/evergreen_compute.c:27:10:
fatal error: 'gelf.h' file not found
^
1 error generated.

Cc: Jan Vesely <***@rutgers.edu>
Cc: Mauro Rossi <***@gmail.com>
Reported-by: Mauro Rossi <***@gmail.com>
Fixes: d96a210842 ("r600g,compute: provide local copy of functions from
ac_binary.c")
Signed-off-by: Emil Velikov <***@gmail.com>
---
src/gallium/drivers/r600/evergreen_compute.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index 37cfed4497b..6e87539cfe7 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -24,8 +24,10 @@
* Adam Rak <***@streamnovation.com>
*/

+#ifdef HAVE_OPENCL
#include <gelf.h>
#include <libelf.h>
+#endif
#include <stdio.h>
#include <errno.h>
#include "pipe/p_defines.h"
--
2.13.0
Jan Vesely
2017-06-17 11:45:23 UTC
Permalink
Raw Message
Post by Emil Velikov
Headers are required only when building with OpenCL. As we're building
fatal error: 'gelf.h' file not found
^
1 error generated.
Fixes: d96a210842 ("r600g,compute: provide local copy of functions from
ac_binary.c")
Assuming it fixes Mauro's problem, LGTM.
Reviewed-by: Jan Vesely <***@rutgers.edu>

Jan
Post by Emil Velikov
---
src/gallium/drivers/r600/evergreen_compute.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index 37cfed4497b..6e87539cfe7 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -24,8 +24,10 @@
*/
+#ifdef HAVE_OPENCL
#include <gelf.h>
#include <libelf.h>
+#endif
#include <stdio.h>
#include <errno.h>
#include "pipe/p_defines.h"
--
Jan Vesely <***@rutgers.edu>
Mauro Rossi
2017-06-17 12:14:37 UTC
Permalink
Raw Message
Post by Jan Vesely
Post by Emil Velikov
Headers are required only when building with OpenCL. As we're building
fatal error: 'gelf.h' file not found
^
1 error generated.
Fixes: d96a210842 ("r600g,compute: provide local copy of functions from
ac_binary.c")
Assuming it fixes Mauro's problem, LGTM.
Jan
Confirmed, nougat-x86 builds correctly
Thanks

Mauro
Post by Jan Vesely
Post by Emil Velikov
---
src/gallium/drivers/r600/evergreen_compute.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index 37cfed4497b..6e87539cfe7 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -24,8 +24,10 @@
*/
+#ifdef HAVE_OPENCL
#include <gelf.h>
#include <libelf.h>
+#endif
#include <stdio.h>
#include <errno.h>
#include "pipe/p_defines.h"
--
Emil Velikov
2017-06-17 16:01:03 UTC
Permalink
Raw Message
Post by Mauro Rossi
Post by Jan Vesely
Post by Emil Velikov
Headers are required only when building with OpenCL. As we're building
fatal error: 'gelf.h' file not found
^
1 error generated.
Fixes: d96a210842 ("r600g,compute: provide local copy of functions from
ac_binary.c")
Assuming it fixes Mauro's problem, LGTM.
Jan
Confirmed, nougat-x86 builds correctly
And pushed to master. Thanks gents!

-Emil

Loading...