diff mbox

[RFC,v2] Add support for GLIBC style endianess detection

Message ID 1493960879-21909-1-git-send-email-akshay.adiga@linux.vnet.ibm.com
State RFC
Headers show

Commit Message

Akshay Adiga May 5, 2017, 5:07 a.m. UTC
Add GLIBC style endianess check in $(SRC)/include/endian.h

On doing so, extract-gcov.c fails to build.

Problem : extract-gcov.c is built using HOSTCC , but Makefile.check 
generically adds $(SRC)/include to include path causing the issue.

HOSTCC should not include $(SKIBOOT)/include/ files and include glibc files.

Signed-off-by: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com>
---
 core/test/Makefile.check   |  2 +-
 include/endian.h           | 13 +++++++++++++
 libstb/test/Makefile.check |  2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 include/endian.h

Comments

Stewart Smith Feb. 28, 2019, 3:38 a.m. UTC | #1
Akshay Adiga <akshay.adiga@linux.vnet.ibm.com> writes:
> Add GLIBC style endianess check in $(SRC)/include/endian.h
>
> On doing so, extract-gcov.c fails to build.
>
> Problem : extract-gcov.c is built using HOSTCC , but Makefile.check 
> generically adds $(SRC)/include to include path causing the issue.
>
> HOSTCC should not include $(SKIBOOT)/include/ files and include glibc files.
>
> Signed-off-by: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com>
> ---
>  core/test/Makefile.check   |  2 +-
>  include/endian.h           | 13 +++++++++++++
>  libstb/test/Makefile.check |  2 +-
>  3 files changed, 15 insertions(+), 2 deletions(-)
>  create mode 100644 include/endian.h

(Looking through old patches sitting in patchwork).


I'm not sure what the benefit of this is at the moment? What was the
reasoning behind the patch?
diff mbox

Patch

diff --git a/core/test/Makefile.check b/core/test/Makefile.check
index 3554050..fdfed06 100644
--- a/core/test/Makefile.check
+++ b/core/test/Makefile.check
@@ -21,7 +21,7 @@  CORE_TEST := \
 	core/test/run-timer \
 	core/test/run-buddy
 
-HOSTCFLAGS+=-I . -I include
+HOSTCFLAGS+=-I .
 
 CORE_TEST_NOSTUB := core/test/run-console-log
 CORE_TEST_NOSTUB += core/test/run-console-log-buf-overrun
diff --git a/include/endian.h b/include/endian.h
new file mode 100644
index 0000000..63e0763
--- /dev/null
+++ b/include/endian.h
@@ -0,0 +1,13 @@ 
+#include <ccan/endian/endian.h>
+
+
+#define	__LITTLE_ENDIAN	1234
+#define	__BIG_ENDIAN	4321
+
+#ifdef HAVE_LITTLE_ENDIAN
+	#define __BYTE_ORDER __LITTLE_ENDIAN
+#elif HAVE_BIG_ENDIAN
+	#define __BYTE_ORDER __BIG_ENDIAN
+#else
+	#error
+#endif
diff --git a/libstb/test/Makefile.check b/libstb/test/Makefile.check
index 00e1397..5f5f6ac 100644
--- a/libstb/test/Makefile.check
+++ b/libstb/test/Makefile.check
@@ -2,7 +2,7 @@ 
 LIBSTB_TEST := libstb/test/run-stb-container \
 	    libstb/test/print-stb-container
 
-HOSTCFLAGS+=-I . -I include
+HOSTCFLAGS+=-I .
 
 libstb/test/print-stb-container-check: libstb/test/print-stb-container-q