dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

Blame SOURCES/0191-setarch-prefer-preprocessor-rather-than-autotools-ch.patch

4aa97a
From e08af84191b2a8ca226e1c72c27c63dcf8ac8c27 Mon Sep 17 00:00:00 2001
4aa97a
From: Sami Kerola <kerolasa@iki.fi>
4aa97a
Date: Sun, 28 Jul 2013 22:11:16 +0100
4aa97a
Subject: [PATCH] setarch: prefer preprocessor rather than autotools check
4aa97a
4aa97a
It seems to be pointless to spend time in ./configure phase when
4aa97a
preprocessor has to perform #ifndef check anyway.
4aa97a
4aa97a
[kzak@redhat.com: -
4aa97a
   Note that on RHEL-7 glibc' <sys/personality.h> does not contain the
4aa97a
   same set of the flags like <linux/personality.h>. We need to include
4aa97a
   glibc version dues to syscall, so it seems better make our macro
4aa97a
   fallbacks more robust.]
4aa97a
4aa97a
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=1690102
4aa97a
Upstream: http://github.com/karelzak/util-linux/commit/f29a3d1868c847ae41bc681db58bd087fc9f941d
4aa97a
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4aa97a
---
4aa97a
 configure.ac        | 12 ------------
4aa97a
 sys-utils/setarch.c | 22 +++++++++++-----------
4aa97a
 2 files changed, 11 insertions(+), 23 deletions(-)
4aa97a
4aa97a
diff --git a/configure.ac b/configure.ac
4aa97a
index 4c5d098e6..49de6c6b3 100644
4aa97a
--- a/configure.ac
4aa97a
+++ b/configure.ac
4aa97a
@@ -260,18 +260,6 @@ AC_CHECK_MEMBERS([struct termios.c_line],,,
4aa97a
 AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,,
4aa97a
 	[#include <sys/stat.h>])
4aa97a
 
4aa97a
-AC_CHECK_DECLS([
4aa97a
- UNAME26,
4aa97a
- ADDR_NO_RANDOMIZE,
4aa97a
- FDPIC_FUNCPTRS,
4aa97a
- MMAP_PAGE_ZERO,
4aa97a
- ADDR_COMPAT_LAYOUT,
4aa97a
- READ_IMPLIES_EXEC,
4aa97a
- ADDR_LIMIT_32BIT,
4aa97a
- WHOLE_SECONDS,
4aa97a
- STICKY_TIMEOUTS,
4aa97a
- ADDR_LIMIT_3GB], [], [], [#include <linux/personality.h>])
4aa97a
-
4aa97a
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
4aa97a
 [[
4aa97a
 #ifdef HAVE_SYS_SWAP_H
4aa97a
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
4aa97a
index 0e45cfef9..9863cb298 100644
4aa97a
--- a/sys-utils/setarch.c
4aa97a
+++ b/sys-utils/setarch.c
4aa97a
@@ -56,37 +56,37 @@ enum {
4aa97a
 	} while(0)
4aa97a
 
4aa97a
 
4aa97a
-#if !HAVE_DECL_UNAME26
4aa97a
+#ifndef UNAME26
4aa97a
 # define UNAME26                 0x0020000
4aa97a
 #endif
4aa97a
-#if !HAVE_DECL_ADDR_NO_RANDOMIZE
4aa97a
+#ifndef ADDR_NO_RANDOMIZE
4aa97a
 # define ADDR_NO_RANDOMIZE       0x0040000
4aa97a
 #endif
4aa97a
-#if !HAVE_DECL_FDPIC_FUNCPTRS
4aa97a
+#ifndef FDPIC_FUNCPTRS
4aa97a
 # define FDPIC_FUNCPTRS          0x0080000
4aa97a
 #endif
4aa97a
-#if !HAVE_DECL_MMAP_PAGE_ZERO
4aa97a
+#ifndef MMAP_PAGE_ZERO
4aa97a
 # define MMAP_PAGE_ZERO          0x0100000
4aa97a
 #endif
4aa97a
-#if !HAVE_DECL_ADDR_COMPAT_LAYOUT
4aa97a
+#ifndef ADDR_COMPAT_LAYOUT
4aa97a
 # define ADDR_COMPAT_LAYOUT      0x0200000
4aa97a
 #endif
4aa97a
-#if !HAVE_DECL_READ_IMPLIES_EXEC
4aa97a
+#ifndef READ_IMPLIES_EXEC
4aa97a
 # define READ_IMPLIES_EXEC       0x0400000
4aa97a
 #endif
4aa97a
-#if !HAVE_DECL_ADDR_LIMIT_32BIT
4aa97a
+#ifndef ADDR_LIMIT_32BIT
4aa97a
 # define ADDR_LIMIT_32BIT        0x0800000
4aa97a
 #endif
4aa97a
-#if !HAVE_DECL_SHORT_INODE
4aa97a
+#ifndef SHORT_INODE
4aa97a
 # define SHORT_INODE             0x1000000
4aa97a
 #endif
4aa97a
-#if !HAVE_DECL_WHOLE_SECONDS
4aa97a
+#ifndef WHOLE_SECONDS
4aa97a
 # define WHOLE_SECONDS           0x2000000
4aa97a
 #endif
4aa97a
-#if !HAVE_DECL_STICKY_TIMEOUTS
4aa97a
+#ifndef STICKY_TIMEOUTS
4aa97a
 # define STICKY_TIMEOUTS         0x4000000
4aa97a
 #endif
4aa97a
-#if !HAVE_DECL_ADDR_LIMIT_3GB
4aa97a
+#ifndef ADDR_LIMIT_3GB
4aa97a
 # define ADDR_LIMIT_3GB          0x8000000
4aa97a
 #endif
4aa97a
 
4aa97a
-- 
4aa97a
2.21.0
4aa97a