diff options
author | Adam Duskett <Aduskett@gmail.com> | 2017-01-09 11:15:20 -0500 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-01-25 23:25:26 +1300 |
commit | f4ba984ade64541fdfbfaa15a4aebed67c41abbf (patch) | |
tree | e2cbd28d130d5a089ef4f1c5938ea1916e9430c2 /package/libselinux/0001-libselinux-src-regex.c-support-old-compilers-for-the.patch | |
parent | 6a9696d918e6c8251891825c503fc88021c22331 (diff) | |
download | buildroot-f4ba984ade64541fdfbfaa15a4aebed67c41abbf.tar.gz buildroot-f4ba984ade64541fdfbfaa15a4aebed67c41abbf.zip |
libselinux: bump version to 2.6
This commit also adds a patch that allows libselinux 2.6 to build
properly with older compilers such as gcc 4.4.
Signed-off-by: Adam Duskett <aduskett@codeblue.com>
[Thomas: add patch to fix gcc 4.4 build issue.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/libselinux/0001-libselinux-src-regex.c-support-old-compilers-for-the.patch')
-rw-r--r-- | package/libselinux/0001-libselinux-src-regex.c-support-old-compilers-for-the.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/package/libselinux/0001-libselinux-src-regex.c-support-old-compilers-for-the.patch b/package/libselinux/0001-libselinux-src-regex.c-support-old-compilers-for-the.patch new file mode 100644 index 0000000000..3bda607512 --- /dev/null +++ b/package/libselinux/0001-libselinux-src-regex.c-support-old-compilers-for-the.patch @@ -0,0 +1,47 @@ +From e0803c0bdbb1abf06b6b5bb1b52fdb733505b8f7 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> +Date: Wed, 25 Jan 2017 22:41:02 +1300 +Subject: [PATCH] src/regex.c: support old compilers for the endian + check + +libselinux 2.6 has added some code in regex.c that uses __BYTE_ORDER__ +to determine the system endianness. Unfortunately, this definition +provided directly by the compiler doesn't exist in older gcc versions +such as gcc 4.4. + +In order to address this, this commit extends the logic to use +<endian.h> definitions if __BYTE_ORDER__ is not provided by the +compiler. This allows libselinux to build properly with gcc 4.4. + +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> +--- + src/regex.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/regex.c b/src/regex.c +index a3b427b..0c5ad27 100644 +--- a/src/regex.c ++++ b/src/regex.c +@@ -13,7 +13,18 @@ + #endif + + #ifndef __BYTE_ORDER__ +-#error __BYTE_ORDER__ not defined. Unable to determine endianness. ++ ++/* If the compiler doesn't define __BYTE_ORDER__, try to use the C ++ * library <endian.h> header definitions. */ ++#include <endian.h> ++#ifndef __BYTE_ORDER ++#error Neither __BYTE_ORDER__ nor __BYTE_ORDER defined. Unable to determine endianness. ++#endif ++ ++#define __ORDER_LITTLE_ENDIAN __LITTLE_ENDIAN ++#define __ORDER_BIG_ENDIAN __BIG_ENDIAN ++#define __BYTE_ORDER__ __BYTE_ORDER ++ + #endif + + #ifdef USE_PCRE2 +-- +2.7.4 + |