Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

build fails with libgnumalloc for evbarm



Hello,

Building release fails with libgnumalloc for evbarm:

  % ./build.sh -U -m evbearmv7hf-eb tools release
  ....
  /var/build/src/external/gpl2/libmalloc/dist/valloc.c: In function 'valloc':
  /var/build/src/external/gpl2/libmalloc/dist/valloc.c:46:5: error: implicit declaration of function 'getpagesize' [-Werror=implicit-function-declaration]
       pagesize = __getpagesize ();
       ^
  cc1: all warnings being treated as errors

This error does not occur for, e.g., amd64, since pagesize is calculated
via NBPG variable defined in machine/param.h. However, it is missing for
evbarm. See src/external/gpl2/dist/getpagesize.h for details.

The attached patch resolves this compiler error:

* use sysconf(_SC_PAGESIZE) instead of NBPG variable or getpagesize(3)
* remove unnecessary #include <sys/param.h> from getpagesize.h

The patched version of libgnumalloc seems to work fine; sh(1) linked to
libgnumalloc works on both evbarm and amd64 boxes.

Thanks,
Rin
====
--- src/external/gpl2/libmalloc/dist/getpagesize.h.orig	2016-01-15 17:10:55.000000000 +0900
+++ src/external/gpl2/libmalloc/dist/getpagesize.h	2016-01-15 17:10:58.000000000 +0900
@@ -1,4 +1,3 @@
-#include <sys/param.h>
 /*	$NetBSD: getpagesize.h,v 1.2 2016/01/13 21:56:38 christos Exp $	*/
 
 /* Emulate getpagesize on systems that lack it.  */
--- src/external/gpl2/libmalloc/lib/Makefile.orig	2016-01-15 17:08:54.000000000 +0900
+++ src/external/gpl2/libmalloc/lib/Makefile	2016-01-15 17:09:23.000000000 +0900
@@ -11,7 +11,7 @@
 SRCS+=  ralloc.c
 
 
-CPPFLAGS+= -I${DIST} -I${.CURDIR} -DSTDC_HEADERS -DHAVE_STDLIB_H
+CPPFLAGS+= -I${DIST} -I${.CURDIR} -DSTDC_HEADERS -DHAVE_STDLIB_H -DHAVE_UNISTD_H
 
 .PATH: ${DIST}
 


Home | Main Index | Thread Index | Old Index