[Mesa-dev] [PATCH] configure.ac: Add AC_SYS_LARGEFILE
Emil Velikov
emil.l.velikov at gmail.com
Tue Sep 2 14:50:08 PDT 2014
Hi Michel,
On 02/09/14 08:17, Michel Dänzer wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Making sure large file support is enabled across the tree even on 32-bit
> systems.
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
> configure.ac | 2 ++
> src/gallium/auxiliary/os/os_mman.h | 13 +++++++++----
> src/gallium/winsys/radeon/drm/radeon_ctx.h | 1 -
> src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 1 -
> src/gallium/winsys/svga/drm/Makefile.am | 2 +-
> 5 files changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index aa7d1f2..9d2ddb4 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -57,6 +57,8 @@ AC_CHECK_PROGS([PYTHON2], [python2 python])
> AC_PROG_SED
> AC_PROG_MKDIR_P
>
> +AC_SYS_LARGEFILE
> +
> LT_PREREQ([2.2])
> LT_INIT([disable-static])
>
> diff --git a/src/gallium/auxiliary/os/os_mman.h b/src/gallium/auxiliary/os/os_mman.h
> index b48eb053..19478d2 100644
> --- a/src/gallium/auxiliary/os/os_mman.h
> +++ b/src/gallium/auxiliary/os/os_mman.h
> @@ -40,9 +40,6 @@
> #include "pipe/p_compiler.h"
>
> #if defined(PIPE_OS_UNIX)
> -# ifndef _FILE_OFFSET_BITS
> -# error _FILE_OFFSET_BITS must be defined to 64
> -# endif
Can you leave the above hunk, afaics it serves as a safeguard which is always
a nice thing to have :)
> # include <sys/mman.h>
> #else
> # error Unsupported OS
> @@ -77,7 +74,15 @@ static INLINE void *os_mmap(void *addr, size_t length, int prot, int flags, int
> # define os_mmap(addr, length, prot, flags, fd, offset) mmap(addr, length, prot, flags, fd, offset)
> #endif
>
> -#define os_munmap(addr, length) munmap(addr, length)
> +static INLINE int os_munmap(void *addr, size_t length)
> +{
> + /* Copied from configure code generated by AC_SYS_LARGEFILE */
> +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
> + STATIC_ASSERT(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1);
> +#undef LARGE_OFF_T
> +
> + return munmap(addr, length);
> +}
>
>
> #ifdef __cplusplus
> diff --git a/src/gallium/winsys/radeon/drm/radeon_ctx.h b/src/gallium/winsys/radeon/drm/radeon_ctx.h
> index 5618b3a..d027016 100644
> --- a/src/gallium/winsys/radeon/drm/radeon_ctx.h
> +++ b/src/gallium/winsys/radeon/drm/radeon_ctx.h
> @@ -26,7 +26,6 @@
> #ifndef RADEON_CTX_H
> #define RADEON_CTX_H
>
> -#define _FILE_OFFSET_BITS 64
> #include <sys/mman.h>
>
As Marek mentioned, this file is not build with mesa but is used/included with
dumped traces.
Thanks
Emil
More information about the mesa-dev
mailing list