• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/libselinux/0001-libselinux-src-regex.c-support-old-compilers-for-the.patch
Adam DuskettAdam Duskett committed f4ba984ade609 Jan 2017
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
From e0803c0bdbb1abf06b6b5bb1b52fdb733505b8f7 Mon Sep 17 00:00:00 2001
2
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3
Date: Wed, 25 Jan 2017 22:41:02 +1300
4
Subject: [PATCH] src/regex.c: support old compilers for the endian
5
 check
6
​
7
libselinux 2.6 has added some code in regex.c that uses __BYTE_ORDER__
8
to determine the system endianness. Unfortunately, this definition
9
provided directly by the compiler doesn't exist in older gcc versions
10
such as gcc 4.4.
11
​
12
In order to address this, this commit extends the logic to use
13
<endian.h> definitions if __BYTE_ORDER__ is not provided by the
14
compiler. This allows libselinux to build properly with gcc 4.4.
15
​
16
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
17
---
18
 src/regex.c | 13 ++++++++++++-
19
 1 file changed, 12 insertions(+), 1 deletion(-)
20
​
21
diff --git a/src/regex.c b/src/regex.c
22
index a3b427b..0c5ad27 100644
23
--- a/src/regex.c
24
+++ b/src/regex.c
25
@@ -13,7 +13,18 @@
26
 #endif
27
 
28
 #ifndef __BYTE_ORDER__
29
-#error __BYTE_ORDER__ not defined. Unable to determine endianness.
30
+
31
+/* If the compiler doesn't define __BYTE_ORDER__, try to use the C
32
+ * library <endian.h> header definitions. */
33
+#include <endian.h>
34
+#ifndef __BYTE_ORDER
35
+#error Neither __BYTE_ORDER__ nor __BYTE_ORDER defined. Unable to determine endianness.
36
+#endif
37
+
38
+#define __ORDER_LITTLE_ENDIAN __LITTLE_ENDIAN
39
+#define __ORDER_BIG_ENDIAN __BIG_ENDIAN
40
+#define __BYTE_ORDER__ __BYTE_ORDER
41
+
42
 #endif
43
 
44
 #ifdef USE_PCRE2
45
-- 
46
2.7.4
47
​
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.