Misc build fixes
cover Misc build fixes
Hello all,
It's time for another Android fueled round of fixes. Mostly trivial and self explanatory patches enough to get things building (rather quietly) on Android 5, x86_64
The series can be found at in branch for-android at
https://github.com/evelikov/libdrm/
Cheers,
Emil
freedreno/Android.mk | 3 --- intel/Android.mk | 1 - libdrm.h | 2 +- nouveau/Android.mk | 3 --- radeon/Android.mk | 3 --- tests/modetest/Makefile.am | 6 +++--- tests/util/Makefile.am | 13 +++++++------ xf86drm.c | 4 ++-- 8 files changed, 13 insertions(+), 22 deletions(-)
Chih-Wei Huang (1):
android: remove duplicate libdrm in LOCAL_SHARED_LIBRARIES
Emil Velikov (5):
util: add WARN_CFLAGS, rename the c*flags vars
modetest: move includes into AM_CPPFLAGS
libdrm: fix the Android 64bit build
drmOpenDevice: silence compiler warning
drmGetStats: silence compiler warning
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/6 util: add WARN_CFLAGS, rename the c*flags vars
--- tests/util/Makefile.am | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
tests/util/Makefile.am +7 -6
@@ -1,13 +1,14 @@ include Makefile.sources -noinst_LTLIBRARIES = \ - libutil.la - -libutil_la_CPPFLAGS = \ +AM_CPPFLAGS = \ -I$(top_srcdir)/include/drm \ -I$(top_srcdir) -libutil_la_CFLAGS = \ - $(CAIRO_CFLAGS) +AM_CFLAGS = \ + $(CAIRO_CFLAGS) \ + $(WARN_CFLAGS) + +noinst_LTLIBRARIES = \ + libutil.la libutil_la_SOURCES = $(UTIL_FILES)
Signature · 6 lines
2.1.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/6 modetest: move includes into AM_CPPFLAGS
In reply to Emil Velikov--- tests/modetest/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/modetest/Makefile.am +3 -3
@@ -1,12 +1,12 @@ include Makefile.sources -AM_CFLAGS = $(filter-out -Wpointer-arith, $(WARN_CFLAGS)) - -AM_CFLAGS += \ +AM_CPPFLAGS = \ -I$(top_srcdir)/include/drm \ -I$(top_srcdir)/tests \ -I$(top_srcdir) +AM_CFLAGS = $(filter-out -Wpointer-arith, $(WARN_CFLAGS)) + if HAVE_INSTALL_TESTS bin_PROGRAMS = \ modetest
Signature · 6 lines
2.1.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/6 libdrm: fix the Android 64bit build
In reply to Emil VelikovWith 64bit bionic mmap now handles 64bit offset, thus we no longer need the __mmap2 trick.
Fix from Chih-Wei Huang, over at the google forums.
--- libdrm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libdrm.h +1 -1
@@ -45,7 +45,7 @@#include <sys/mman.h> -#if defined(ANDROID ) +#if defined(ANDROID ) && !defined(__LP64__)#include <errno.h> /* for EINVAL */ extern void *__mmap2 (void *,size_t ,int ,int ,int ,size_t );
Signature · 6 lines
2.1.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/6] libdrm: fix the Android 64bit build
Quoted 16 lines · Emil Velikov
With 64bit bionic mmap now handles 64bit offset, thus we no longer need the
__mmap2trick.Fix from Chih-Wei Huang, over at the google forums.
Cc Chih-Wei Huang <[email protected]>Signed-off-by Emil Velikov <[email protected]>--- libdrm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)libdrm.h +0
-0
libdrm.h line 51
Quoted 8 lines
libdrm.h +1
-1@@ -45,7 +45,7 @@#include <sys/mman.h> -#if defined(ANDROID ) +#if defined(ANDROID ) && !defined(__LP64__)#include <errno.h> /* for EINVAL */ extern void *__mmap2 (void *,size_t ,int ,int ,int ,size_t );
It seems like you're be better off just using mmap64 instead of __mpap2?
Stéphane
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/6] libdrm: fix the Android 64bit build
Quoted 20 lines · Stéphane Marchesin
Quoted 19 lines · Emil Velikov
With 64bit bionic mmap now handles 64bit offset, thus we no longer need the
__mmap2trick.Fix from Chih-Wei Huang, over at the google forums.
Cc Chih-Wei Huang <[email protected]>Signed-off-by Emil Velikov <[email protected]>--- libdrm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)libdrm.h +0
-0@@ -45,7 +45,7 @@#include <sys/mman.h>
Quoted 8 lines
libdrm.h line 51
Quoted 5 lines
libdrm.h +1
-1-#if defined(ANDROID ) +#if defined(ANDROID ) && !defined(__LP64__)#include <errno.h> /* for EINVAL */ extern void *__mmap2 (void *,size_t ,int ,int ,int ,size_t );It seems like you're be better off just using mmap64 instead of
__mpap2?
I was thinking about that but decided against it due to:
- For 64bit platforms - mmap64 maps directly to mmap [1].
- For other platforms (kitkat at least) mmap64 does a costly (according
to the man page) syscall (don't recall the name).
- Some systems may be lacking mmap64.
Quite a noobie on the topic so I might be completely wrong :)
Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/6 drmOpenDevice: silence compiler warning
In reply to Emil VelikovUnder 64bit Android the compiler throws a -Wsign-compare warning. Typecast the variable dev to silence the build.
--- xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xf86drm.c +1 -1
@@ -394,7 +394,7 @@ wait_for_udev:/* Check if the device node is not what we expect it to be, and recreate it * and try again if so. */ -if (st.st_rdev != dev) { +if (st.st_rdev != (dev_t )dev) {if (!isroot)return DRM_ERR_NOT_ROOT ;remove (buf);
Signature · 6 lines
2.1.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 5/6 drmGetStats: silence compiler warning
In reply to Emil Velikovdrm_stats_t::count is of type unsigned long, while i is an int. Make the latter an unsigned int.
Spotted as -Wsign-compare warning while building under Android 5.
--- xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xf86drm.c +1 -1
@@ -2213,7 +2213,7 @@ int drmGetClient(int fd, int idx, int *auth, int *pid, int *uid,int drmGetStats (int fd,drmStatsT *stats) {drm_stats_t s; -int i; +unsigned int i;if (drmIoctl (fd,DRM_IOCTL_GET_STATS , &s))return -errno;
Signature · 6 lines
2.1.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 6/6 android: remove duplicate libdrm in LOCAL_SHARED_LIBRARIES
In reply to Emil VelikovFrom: Chih-Wei Huang <[email protected]>
--- freedreno/Android.mk | 3 --- intel/Android.mk | 1 - nouveau/Android.mk | 3 --- radeon/Android.mk | 3 --- 4 files changed, 10 deletions(-)
freedreno/Android.mk +0 -3
@@ -24,7 +24,4 @@ LOCAL_CFLAGS := \ LOCAL_COPY_HEADERS := $(LIBDRM_FREEDRENO_H_FILES) LOCAL_COPY_HEADERS_TO := freedreno -LOCAL_SHARED_LIBRARIES := \ - libdrm - include $(BUILD_SHARED_LIBRARY)
intel/Android.mk +0 -1
@@ -49,7 +49,6 @@ LOCAL_COPY_HEADERS := $(LIBDRM_INTEL_H_FILES) LOCAL_COPY_HEADERS_TO := libdrm LOCAL_SHARED_LIBRARIES := \ - libdrm \ libpciaccess include $(BUILD_SHARED_LIBRARY)
nouveau/Android.mk +0 -3
@@ -24,7 +24,4 @@ LOCAL_CFLAGS := \ LOCAL_COPY_HEADERS := $(LIBDRM_NOUVEAU_H_FILES) LOCAL_COPY_HEADERS_TO := libdrm -LOCAL_SHARED_LIBRARIES := \ - libdrm - include $(BUILD_SHARED_LIBRARY)
radeon/Android.mk +0 -3
@@ -24,7 +24,4 @@ LOCAL_CFLAGS := \ LOCAL_COPY_HEADERS := $(LIBDRM_RADEON_H_FILES) LOCAL_COPY_HEADERS_TO := libdrm -LOCAL_SHARED_LIBRARIES := \ - libdrm - include $(BUILD_SHARED_LIBRARY)
Signature · 6 lines
2.1.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/2 util: add missing include <string.h>
In reply to Emil VelikovRequired by strcmp, otherwise we'll error out of the build with the following commit.
--- tests/util/format.c | 1 + 1 file changed, 1 insertion(+)
tests/util/format.c +1 -0
@@ -29,6 +29,7 @@#include <stdint.h> #include <stdlib.h> +#include <string.h> #include <drm_fourcc.h>
Signature · 6 lines
2.1.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 util: silence pointer arithmetic warnings
--- tests/util/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/util/Makefile.am +2 -1
@@ -6,7 +6,8 @@ AM_CPPFLAGS = \ AM_CFLAGS = \ $(CAIRO_CFLAGS) \ - $(WARN_CFLAGS) + $(filter-out -Wpointer-arith, $(WARN_CFLAGS)) + noinst_LTLIBRARIES = \ libutil.la
Signature · 6 lines
2.1.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/2] util: add missing include <string.h>
In reply to Emil VelikovGrr... git send-email did not keep the fix of the patches :\
This one should be "PATCH 0.1/6" while "util: silence pointer arithmetic warnings" - "PATCH 1.1/6".
Cheers,
Emil
Quoted 14 lines · Emil Velikov
Required by strcmp, otherwise we'll error out of the build with the following commit.
Signed-off-by Emil Velikov <[email protected]>--- tests/util/format.c | 1 + 1 file changed, 1 insertion(+)tests/util/format.c +0
-0
tests/util/format.c line 35
Quoted 7 lines
tests/util/format.c +1
-0@@ -29,6 +29,7 @@#include <stdint.h> #include <stdlib.h> +#include <string.h> #include <drm_fourcc.h>
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel