diff mbox series

[meta-oe,33/63] libx86: Fix pointer typecasting in assignment

Message ID 20220904073417.3251865-33-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,01/63] libutempter: Upgrade to 1.2.2-alt1 | expand

Commit Message

Khem Raj Sept. 4, 2022, 7:33 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...-type-of-the-void-pointer-assignment.patch | 33 +++++++++++++++++++
 .../recipes-extended/libx86-1/libx86-1_1.1.bb |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta-oe/recipes-extended/libx86-1/libx86-1.1/0001-Fix-type-of-the-void-pointer-assignment.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/libx86-1/libx86-1.1/0001-Fix-type-of-the-void-pointer-assignment.patch b/meta-oe/recipes-extended/libx86-1/libx86-1.1/0001-Fix-type-of-the-void-pointer-assignment.patch
new file mode 100644
index 0000000000..ea3c306fd7
--- /dev/null
+++ b/meta-oe/recipes-extended/libx86-1/libx86-1.1/0001-Fix-type-of-the-void-pointer-assignment.patch
@@ -0,0 +1,33 @@ 
+From c782e208021409e9b78acb2200abd4319072e78a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Sep 2022 00:28:05 -0700
+Subject: [PATCH] Fix type of the void pointer assignment
+
+Fixes build with clang
+
+x86-common.c:216:9: error: incompatible integer to pointer conversion assigning to 'void *' from 'long' [-Wint-conversion]
+        offset = mem_info.offset - REAL_MEM_BASE;
+               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ x86-common.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/x86-common.c b/x86-common.c
+index 137bc3c..6f737ed 100644
+--- a/x86-common.c
++++ b/x86-common.c
+@@ -213,7 +213,7 @@ void *LRMI_common_init(int high_page)
+ 	if (!real_mem_init(high_page))
+ 		return NULL;
+ 
+-	offset = mem_info.offset - REAL_MEM_BASE;
++	offset = (void*)(mem_info.offset - REAL_MEM_BASE);
+ 
+ 	/*
+ 	 Map the Interrupt Vectors (0x0 - 0x400) + BIOS data (0x400 - 0x502)
+-- 
+2.37.3
+
diff --git a/meta-oe/recipes-extended/libx86-1/libx86-1_1.1.bb b/meta-oe/recipes-extended/libx86-1/libx86-1_1.1.bb
index d303147259..9dc91f3f6f 100644
--- a/meta-oe/recipes-extended/libx86-1/libx86-1_1.1.bb
+++ b/meta-oe/recipes-extended/libx86-1/libx86-1_1.1.bb
@@ -11,6 +11,7 @@  SRC_URI = "http://www.codon.org.uk/~mjg59/libx86/downloads/${BPN}-${PV}.tar.gz \
            file://libx86-mmap-offset.patch \
            file://0001-assume-zero-is-valid-address.patch \
            file://makefile-add-ldflags.patch \
+           file://0001-Fix-type-of-the-void-pointer-assignment.patch \
 "
 
 SRC_URI[md5sum] = "41bee1f8e22b82d82b5f7d7ba51abc2a"