From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Dec 25 20:10:14 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FB64106566B for ; Sun, 25 Dec 2011 20:10:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 36FDD8FC15 for ; Sun, 25 Dec 2011 20:10:14 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pBPKAEp4055744 for ; Sun, 25 Dec 2011 20:10:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pBPKAEfL055743; Sun, 25 Dec 2011 20:10:14 GMT (envelope-from gnats) Resent-Date: Sun, 25 Dec 2011 20:10:14 GMT Resent-Message-Id: <201112252010.pBPKAEfL055743@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Steve Wills Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92741106564A for ; Sun, 25 Dec 2011 20:07:50 +0000 (UTC) (envelope-from steve@mouf.net) Received: from mouf.net (unknown [IPv6:2607:fc50:0:4400:216:3eff:fe69:33b2]) by mx1.freebsd.org (Postfix) with ESMTP id 1C69A8FC08 for ; Sun, 25 Dec 2011 20:07:50 +0000 (UTC) Received: from meatwad.mouf.net (cpe-024-162-230-236.nc.res.rr.com [24.162.230.236]) by mouf.net (8.14.4/8.14.4) with ESMTP id pBPK7jpF072432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 25 Dec 2011 15:07:45 -0500 (EST) (envelope-from steve@meatwad.mouf.net) Received: (from steve@localhost) by meatwad.mouf.net (8.14.5/8.14.5/Submit) id pBPK7jX2093296; Sun, 25 Dec 2011 15:07:45 -0500 (EST) (envelope-from steve) Message-Id: <201112252007.pBPK7jX2093296@meatwad.mouf.net> Date: Sun, 25 Dec 2011 15:07:45 -0500 (EST) From: Steve Wills To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: gnome@FreeBSD.org Subject: ports/163613: [PATCH] devel/libgtop: fix build on 10-CURRENT X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2011 20:10:14 -0000 >Number: 163613 >Category: ports >Synopsis: [PATCH] devel/libgtop: fix build on 10-CURRENT >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Dec 25 20:10:13 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Steve Wills >Release: FreeBSD 10.0-CURRENT amd64 >Organization: >Environment: System: FreeBSD meatwad.mouf.net 10.0-CURRENT FreeBSD 10.0-CURRENT #8: Mon Dec 19 15:53:28 EST 2011 >Description: I experienced the same build failure with libgtop seen here: http://pointyhat.freebsd.org/errorlogs/i386-errorlogs/e.10.20111207031942/libgtop-2.28.3_2.log gmake[3]: Entering directory `/work/a/ports/devel/libgtop/work/libgtop-2.28.3/sysdeps/freebsd' ... gnome-libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/include -I/usr/local/include -DHAVE_NET_IF_VAR_H -Winline -Wall -std=gnu89 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -O2 -pipe -fno-strict-aliasing -MT open.lo -MD -MP -MF .deps/open.Tpo -c open.c -fPIC -DPIC -o .libs/open.o open.c: In function 'glibtop_open_s': open.c:47: error: '__FreeBSD_kernel_version' undeclared (first use in this function) open.c:47: error: (Each undeclared identifier is reported only once open.c:47: error: for each function it appears in.) gmake[3]: *** [open.lo] Error 1 The attached patch fixes it for me. The patch is mainly noise due to the file files/patch-sysdeps_freebsd_open.c not being updated I think, but the main change is that the check for __FreeBSD_kernel__ and usage of __FreeBSD_kernel_version was removed in favor of just using __FreeBSD_version all the time. I believe this is the correct thing to do, but I'm not 100% sure. Port maintainer (gnome@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.99 >How-To-Repeat: >Fix: --- libgtop-2.28.3_2.patch begins here --- Index: files/patch-sysdeps_freebsd_open.c =================================================================== RCS file: /home/pcvs/ports/devel/libgtop/files/patch-sysdeps_freebsd_open.c,v retrieving revision 1.1 diff -u -u -r1.1 patch-sysdeps_freebsd_open.c --- files/patch-sysdeps_freebsd_open.c 10 Jan 2009 05:21:26 -0000 1.1 +++ files/patch-sysdeps_freebsd_open.c 25 Dec 2011 20:03:26 -0000 @@ -1,6 +1,6 @@ ---- sysdeps/freebsd/open.c.orig 2008-05-23 18:13:23.000000000 -0400 -+++ sysdeps/freebsd/open.c 2008-09-29 17:23:22.000000000 -0400 -@@ -20,76 +20,33 @@ +--- sysdeps/freebsd/open.c.orig 2011-12-25 11:29:32.897248000 +0000 ++++ sysdeps/freebsd/open.c 2011-12-25 11:38:05.000000000 +0000 +@@ -20,76 +20,27 @@ */ #include @@ -23,16 +23,16 @@ - glibtop_error_r (NULL, "glibtop_init_p (server == NULL)"); - - /* Do the initialization, but only if not already initialized. */ -- -- if ((server->flags & _GLIBTOP_INIT_STATE_SYSDEPS) == 0) { -- glibtop_open_p (server, "glibtop", features, flags); +#include +#include -- for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++) -- (*init_fkt) (server); +- if ((server->flags & _GLIBTOP_INIT_STATE_SYSDEPS) == 0) { +- glibtop_open_p (server, "glibtop", features, flags); +#include +- for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++) +- (*init_fkt) (server); +- - server->flags |= _GLIBTOP_INIT_STATE_SYSDEPS; - } -} @@ -46,24 +46,24 @@ -#ifdef DEBUG - fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ()); -#endif +- +- /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ + int ncpus; + size_t len; -- /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ -+ len = sizeof (ncpus); -+ sysctlbyname ("hw.ncpu", &ncpus, &len, NULL, 0); -+ server->real_ncpu = ncpus - 1; -+ server->ncpu = MIN(GLIBTOP_NCPU - 1, server->real_ncpu); - - server->machine.uid = getuid (); - server->machine.euid = geteuid (); - server->machine.gid = getgid (); - server->machine.egid = getegid (); - #if defined(__FreeBSD_kernel__) - server->os_version_code = __FreeBSD_kernel_version; - #else +-#if defined(__FreeBSD_kernel__) +- server->os_version_code = __FreeBSD_kernel_version; +-#else ++ len = sizeof (ncpus); ++ sysctlbyname ("hw.ncpu", &ncpus, &len, NULL, 0); ++ server->real_ncpu = ncpus - 1; ++ server->ncpu = MIN(GLIBTOP_NCPU - 1, server->real_ncpu); server->os_version_code = __FreeBSD_version; - #endif +-#endif - /* Setup machine-specific data */ - server->machine.kd = kvm_open (NULL, NULL, NULL, O_RDONLY, "kvm_open"); - @@ -82,7 +82,7 @@ - - /* Our effective uid is now those of the user invoking the server, - * so we do no longer have any priviledges. */ - +- - /* NOTE: On FreeBSD, we do not need to be suid root, we just need to - * be sgid kmem. - * --- libgtop-2.28.3_2.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: