Re: util-linux-ng-2.14-rc1

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

 



On Tue, May 06, 2008 at 05:34:12PM +0200, Gabor Z. Papp wrote:
> gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h -I../include -DLOCALEDIR=\"/usr/share/locale\"  -fsigned-char -g -O2 -MT setarch.o -MD -MP -MF .deps/setarch.Tpo -c -o setarch.o setarch.c setarch.c: In function 'main':
> setarch.c:248: error: 'ADDR_NO_RANDOMIZE' undeclared (first use in this function)
> setarch.c:248: error: (Each undeclared identifier is reported only once
> setarch.c:248: error: for each function it appears in.)
> setarch.c:251: error: 'FDPIC_FUNCPTRS' undeclared (first use in this function)
> setarch.c:257: error: 'ADDR_COMPAT_LAYOUT' undeclared (first use in this function)
> setarch.c:260: error: 'READ_IMPLIES_EXEC' undeclared (first use in this function)
> make[2]: *** [setarch.o] Error 1
> 
> [kernel]
> Linux gzp1 2.4.36.1-gzp1 #1 SMP Tue Feb 19 10:23:48 CET 2008 i686 GNU/Linux

The patch below should fix the problem.

This is probably the most simple patch for this issue. I have also a
more complex patch that removes some duplicate things, but it seems
too invasive for -rc3.
http://people.redhat.com/kzak/util-linux/0001-setarch-code-refactoring-add-AC_CHECK_DECLS.patch


    Karel


>From 2d281745d918b1c03bfde69f4b1f663cf2e2577d Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@xxxxxxxxxx>
Date: Tue, 13 May 2008 14:00:39 +0200
Subject: [PATCH] setarch: add fallback for linux/personality

setarch.c:248: error: 'ADDR_NO_RANDOMIZE' undeclared (first use in this function)
setarch.c:248: error: (Each undeclared identifier is reported only once
setarch.c:248: error: for each function it appears in.)
setarch.c:251: error: 'FDPIC_FUNCPTRS' undeclared (first use in this function)
setarch.c:257: error: 'ADDR_COMPAT_LAYOUT' undeclared (first use in this function)
setarch.c:260: error: 'READ_IMPLIES_EXEC' undeclared (first use in this function)

Linux gzp1 2.4.36.1-gzp1 #1 SMP Tue Feb 19 10:23:48 CET 2008 i686 GNU/Linux

Reported-By: Gabor Z. Papp <gzp@xxxxxxx>
Signed-off-by: Karel Zak <kzak@xxxxxxxxxx>
---
 configure.ac        |   10 ++++++++++
 sys-utils/setarch.c |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index f767361..a288757 100644
--- a/configure.ac
+++ b/configure.ac
@@ -381,6 +381,16 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 [AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])
 ])
 
+AC_CHECK_DECLS([
+ ADDR_NO_RANDOMIZE,
+ FDPIC_FUNCPTRS,
+ MMAP_PAGE_ZERO,
+ ADDR_COMPAT_LAYOUT,
+ READ_IMPLIES_EXEC,
+ ADDR_LIMIT_32BIT,
+ WHOLE_SECONDS,
+ STICKY_TIMEOUTS,
+ ADDR_LIMIT_3GB], [], [], [#include <linux/personality.h>])
 
 AC_CHECK_HEADERS([sys/swap.h])
 
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
index bc6a12d..c5f885b 100644
--- a/sys-utils/setarch.c
+++ b/sys-utils/setarch.c
@@ -50,6 +50,38 @@
 			printf(_("Switching on %s.\n"), #_flag); \
 	} while(0)
 
+
+#if !HAVE_DECL_ADDR_NO_RANDOMIZE
+# define ADDR_NO_RANDOMIZE       0x0040000
+#endif
+#if !HAVE_DECL_FDPIC_FUNCPTRS
+# define FDPIC_FUNCPTRS          0x0080000
+#endif
+#if !HAVE_DECL_MMAP_PAGE_ZERO
+# define MMAP_PAGE_ZERO          0x0100000
+#endif
+#if !HAVE_DECL_ADDR_COMPAT_LAYOUT
+# define ADDR_COMPAT_LAYOUT      0x0200000
+#endif
+#if !HAVE_DECL_READ_IMPLIES_EXEC
+# define READ_IMPLIES_EXEC       0x0400000
+#endif
+#if !HAVE_DECL_ADDR_LIMIT_32BIT
+# define ADDR_LIMIT_32BIT        0x0800000
+#endif
+#if !HAVE_DECL_SHORT_INODE
+# define SHORT_INODE             0x1000000
+#endif
+#if !HAVE_DECL_WHOLE_SECONDS
+# define WHOLE_SECONDS           0x2000000
+#endif
+#if !HAVE_DECL_STICKY_TIMEOUTS
+# define STICKY_TIMEOUTS         0x4000000
+#endif
+#if !HAVE_DECL_ADDR_LIMIT_3GB
+# define ADDR_LIMIT_3GB          0x8000000
+#endif
+
 /* Options --3gb and --4gb are for compatibitity with an old Debian setarch
    implementation. */
 struct option longopts[] =
-- 
1.5.4.1

--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux