Skip to contentSkip to conversation

fwts: Bump SRCREV to latest past 17.03.00 release

PATCH Superseded Khem Raj 2 participants 3 messages Jun 8, 2017 – Jun 13, 2017

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v4 1/1 fwts: Bump SRCREV to latest past 17.03.00 release

Helps fixing build issues with gcc7

---
v2 -> v3
- move the LDFLAGS after CFLAGS
v3 -> v4
- Fix point-to-int incompatibilities seen on x86 with off_t being 64bit
- Fix printf formatting issues

 ...01-Add-correct-printf-qualifier-for-off_t.patch | 35 ++++++++++
 ...e-poll.h-instead-of-deprecated-sys-poll.h.patch | 48 ++++++++++++++
 ...-C99-defined-format-for-printing-uint64_t.patch | 53 +++++++++++++++
 ...efine-__SWORD_TYPE-if-not-defined-by-libc.patch | 33 ++++++++++
 .../fwts/fwts/0003-Undefine-PAGE_SIZE.patch        | 30 +++++++++
 ...ntptr_t-to-fix-pointer-to-int-cast-issues.patch | 76 ++++++++++++++++++++++
 meta-oe/recipes-test/fwts/fwts_git.bb              | 12 +++-
 7 files changed, 285 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch
meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch new file +35 -0
new file mode 100644
index 000000000..891185de6
@@ -0,0 +1,35 @@
+From 232daf5fca6fb52cced5e810f2601fe1a71b96d8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 8 Jun 2017 16:49:50 -0700
+Subject: [PATCH 1/3] Add correct printf qualifier for off_t
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/bios/ebda_region/ebda_region.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/bios/ebda_region/ebda_region.c b/src/bios/ebda_region/ebda_region.c
+index 54768a95..fec04445 100644
+--- a/src/bios/ebda_region/ebda_region.c
++++ b/src/bios/ebda_region/ebda_region.c
+@@ -83,7 +83,7 @@ static int ebda_test1(fwts_framework *fw)
+ 	if ((entry != NULL) &&
+ 	    (entry->type == FWTS_MEMORY_MAP_RESERVED ||
+ 	     entry->type == FWTS_MEMORY_MAP_ACPI)) {
+-		fwts_passed(fw, "EBDA region mapped at 0x%lx and reserved as a %" PRId64
++		fwts_passed(fw, "EBDA region mapped at 0x%jdx and reserved as a %" PRId64
+ 			"K region in the %s table at 0x%" PRIx64 "..0x%" PRIx64 ".",
+ 			ebda_addr,
+ 			(entry->end_address - entry->start_address) / 1024,
+@@ -93,7 +93,7 @@ static int ebda_test1(fwts_framework *fw)
+ 	} else
+ 		fwts_failed(fw, LOG_LEVEL_MEDIUM,
+ 			"EBDAMappedNotReserved",
+-			"EBDA region mapped at 0x%lx but not reserved in the %s table.",
++			"EBDA region mapped at 0x%jdx but not reserved in the %s table.",
+ 			ebda_addr, memory_map_name);
+ 		
+ 	return FWTS_OK;
+-- 
+2.13.1
+
meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch new file +48 -0

48 lines not on this page · raw message

meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch new file +53 -0

53 lines not on this page · raw message

meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch new file +33 -0
new file mode 100644
index 000000000..3b83ca57c
@@ -0,0 +1,33 @@
+From 0e89127cd02ecd5ea4506b935cb2b59eb94107d2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Jun 2017 07:37:20 -0700
+Subject: [PATCH 2/3] Define __SWORD_TYPE if not defined by libc
+
+__SWORD_TYPE is internal to glibc, therefore
+check and define it if needed e.g. on musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/src/fwts_uefi.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
+index 1f9d31fa..2d925f8d 100644
+--- a/src/lib/src/fwts_uefi.c
++++ b/src/lib/src/fwts_uefi.c
+@@ -59,6 +59,10 @@ typedef struct {
+ #define UEFI_IFACE_SYSFS		(2)	/* sysfs */
+ #define UEFI_IFACE_EFIVARS		(3)	/* efivar fs */
+ 
++#ifndef __SWORD_TYPE
++typedef __typeof__( ((struct statfs *)0)->f_type )	__SWORD_TYPE;
++#endif
++
+ /* File system magic numbers */
+ #define PSTOREFS_MAGIC          ((__SWORD_TYPE)0x6165676C)
+ #define EFIVARFS_MAGIC          ((__SWORD_TYPE)0xde5e81e4)
+-- 
+2.13.0
+
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +30 -0
new file mode 100644
index 000000000..f84fbffd8
@@ -0,0 +1,30 @@
+From 0857269d5a053b5b4c31cfa01b6501526b24035f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Jun 2017 07:39:28 -0700
+Subject: [PATCH 3/3] Undefine PAGE_SIZE
+
+musl defines PAGE_SIZE and build complains
+of multiple definitions
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/src/fwts_acpi_tables.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
+index 1d4fc705..71023ad2 100644
+--- a/src/lib/src/fwts_acpi_tables.c
++++ b/src/lib/src/fwts_acpi_tables.c
+@@ -42,6 +42,7 @@
+ #define BIOS_START	(0x000e0000)		/* Start of BIOS memory */
+ #define BIOS_END  	(0x000fffff)		/* End of BIOS memory */
+ #define BIOS_LENGTH	(BIOS_END - BIOS_START)	/* Length of BIOS memory */
++#undef PAGE_SIZE
+ #define PAGE_SIZE	(4096)
+ 
+ static fwts_acpi_table_info	tables[ACPI_MAX_TABLES];
+-- 
+2.13.0
+
meta-oe/recipes-test/fwts/fwts/0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch new file +76 -0

76 lines not on this page · raw message

meta-oe/recipes-test/fwts/fwts_git.bb +10 -2
index 4c4ae66d6..87a23af19 100644
@@ -5,11 +5,17 @@ HOMEPAGE = "https://wiki.ubuntu.com/Kernel/Reference/fwts"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://src/main.c;beginline=1;endline=16;md5=31da590f3e9f3bd34dcdb9e4db568519"
 
-PV = "17.03.00"
+PV = "17.03.00+git${SRCPV}"
 
-SRCREV = "e3e9d1442b4cc70f5b30199f584cec8e25aeaad4"
+SRCREV = "0153ea51cb648b3067a1b327eee6a075b6cfa330"
 SRC_URI = "git://kernel.ubuntu.com/hwe/fwts.git \
            file://0001-ignore-constant-logical-operand-warning-with-clang.patch \
+           file://0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch \
+           file://0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch \
+           file://0003-Undefine-PAGE_SIZE.patch \
+           file://0001-Add-correct-printf-qualifier-for-off_t.patch \
+           file://0002-Add-C99-defined-format-for-printing-uint64_t.patch \
+           file://0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch \
            "
 
 S = "${WORKDIR}/git"
@@ -17,10 +23,12 @@ S = "${WORKDIR}/git"
 COMPATIBLE_HOST = "(i.86|x86_64|aarch64|powerpc64).*-linux"
 
 DEPENDS = "libpcre json-c glib-2.0 dtc"
+DEPENDS_append_libc-musl = " libexecinfo"
 
 inherit autotools pkgconfig
 
 CFLAGS += "-I${STAGING_INCDIR}/json-c -Wno-error=unknown-pragmas"
+LDFLAGS_append_libc-musl = " -lexecinfo"
 
 FILES_${PN} += "${libdir}/fwts/lib*${SOLIBS}"
 FILES_${PN}-dev += "${libdir}/fwts/lib*${SOLIBSDEV} ${libdir}/fwts/lib*.la"
Signature · 1 line
2.13.1
#1 lore raw
Quoted 6 lines · Khem Raj

Helps fixing build issues with gcc7

Quoted 6 lines

---
v2 -> v3
- move the LDFLAGS after CFLAGS
v3 -> v4
- Fix point-to-int incompatibilities seen on x86 with off_t being 64bit
- Fix printf formatting issues

I'm sorry but still fails to build for qemux86:
http://errors.yoctoproject.org/Errors/Details/145075/

Quoted 367 lines
 ...01-Add-correct-printf-qualifier-for-off_t.patch | 35 ++++++++++
 ...e-poll.h-instead-of-deprecated-sys-poll.h.patch | 48 ++++++++++++++
 ...-C99-defined-format-for-printing-uint64_t.patch | 53 +++++++++++++++
 ...efine-__SWORD_TYPE-if-not-defined-by-libc.patch | 33 ++++++++++
 .../fwts/fwts/0003-Undefine-PAGE_SIZE.patch        | 30 +++++++++
 ...ntptr_t-to-fix-pointer-to-int-cast-issues.patch | 76 ++++++++++++++++++++++
 meta-oe/recipes-test/fwts/fwts_git.bb              | 12 +++-
 7 files changed, 285 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch
 create mode 100644 meta-oe/recipes-test/fwts/fwts/0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch
meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch new file +35 -0
new file mode 100644
index 000000000..891185de6
@@ -0,0 +1,35 @@
+From 232daf5fca6fb52cced5e810f2601fe1a71b96d8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 8 Jun 2017 16:49:50 -0700
+Subject: [PATCH 1/3] Add correct printf qualifier for off_t
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/bios/ebda_region/ebda_region.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/bios/ebda_region/ebda_region.c b/src/bios/ebda_region/ebda_region.c
+index 54768a95..fec04445 100644
+--- a/src/bios/ebda_region/ebda_region.c
++++ b/src/bios/ebda_region/ebda_region.c
+@@ -83,7 +83,7 @@ static int ebda_test1(fwts_framework *fw)
+ 	if ((entry != NULL) &&
+ 	    (entry->type == FWTS_MEMORY_MAP_RESERVED ||
+ 	     entry->type == FWTS_MEMORY_MAP_ACPI)) {
+-		fwts_passed(fw, "EBDA region mapped at 0x%lx and reserved as a %" PRId64
++		fwts_passed(fw, "EBDA region mapped at 0x%jdx and reserved as a %" PRId64
+ 			"K region in the %s table at 0x%" PRIx64 "..0x%" PRIx64 ".",
+ 			ebda_addr,
+ 			(entry->end_address - entry->start_address) / 1024,
+@@ -93,7 +93,7 @@ static int ebda_test1(fwts_framework *fw)
+ 	} else
+ 		fwts_failed(fw, LOG_LEVEL_MEDIUM,
+ 			"EBDAMappedNotReserved",
+-			"EBDA region mapped at 0x%lx but not reserved in the %s table.",
++			"EBDA region mapped at 0x%jdx but not reserved in the %s table.",
+ 			ebda_addr, memory_map_name);
+ 		
+ 	return FWTS_OK;
+-- 
+2.13.1
+
meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch new file +48 -0
new file mode 100644
index 000000000..8ad078936
@@ -0,0 +1,48 @@
+From 100a107a53d5dc9b0554252ac5dbf2c9330615e9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Jun 2017 07:25:09 -0700
+Subject: [PATCH 1/3] Include poll.h instead of deprecated sys/poll.h
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/src/fwts_ipmi.c   | 3 ++-
+ src/lib/src/fwts_pipeio.c | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/lib/src/fwts_ipmi.c b/src/lib/src/fwts_ipmi.c
+index cbb27611..70d11cfa 100644
+--- a/src/lib/src/fwts_ipmi.c
++++ b/src/lib/src/fwts_ipmi.c
+@@ -18,10 +18,11 @@
+  *
+  */
+ 
++#include <poll.h>
++
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+-#include <sys/poll.h>
+ #include <sys/ioctl.h>
+ #include <linux/ipmi.h>
+ 
+diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
+index fd719640..bdc5b2ea 100644
+--- a/src/lib/src/fwts_pipeio.c
++++ b/src/lib/src/fwts_pipeio.c
+@@ -30,9 +30,9 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <paths.h>
++#include <poll.h>
+ 
+ #include <sys/param.h>
+-#include <sys/poll.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <errno.h>
+-- 
+2.13.0
+
meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch new file +53 -0
new file mode 100644
index 000000000..35ce883a2
@@ -0,0 +1,53 @@
+From 25f18b9ac37960dc12a3b648a5c866bd56ef2cbe Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 8 Jun 2017 16:50:23 -0700
+Subject: [PATCH 2/3] Add C99 defined format for printing uint64_t
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/opal/reserv_mem.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/opal/reserv_mem.c b/src/opal/reserv_mem.c
+index eeec2947..f0672e05 100644
+--- a/src/opal/reserv_mem.c
++++ b/src/opal/reserv_mem.c
+@@ -185,7 +185,7 @@ static int reserv_mem_limits_test(fwts_framework *fw)
+ 		regions[j].start = (uint64_t)be64toh(ranges[2 * j]);
+ 		regions[j].len = (uint64_t)be64toh(ranges[2 * j + 1]);
+ 		fwts_log_info(fw, "Region name %80s"
+-			" start: 0x%08lx, len: 0x%08lx\n",
++			" start: 0x%08" PRIx64 ", len: 0x%08" PRIx64 "\n",
+ 			regions[j].name, regions[j].start, regions[j].len);
+ 	}
+ 
+@@ -248,7 +248,7 @@ static int reserv_mem_limits_test(fwts_framework *fw)
+ 				fwts_failed(fw, LOG_LEVEL_MEDIUM,
+ 					"ImageSizeMismatch",
+ 					"Mismatch in homer-image size, "
+-					"expected: 0x%lx, actual: 0x%lx",
++					"expected: 0x%" PRIx64 ", actual: 0x%" PRIx64 "",
+ 					configstruct.homer, regions[j].len);
+ 				ok = false;
+ 			} else
+@@ -261,7 +261,7 @@ static int reserv_mem_limits_test(fwts_framework *fw)
+ 				fwts_failed(fw, LOG_LEVEL_MEDIUM,
+ 					"ImageSizeMismatch",
+ 					"Mismatch in slw-image size, "
+-					"expected: 0x%lx, actual: 0x%lx",
++					"expected: 0x%" PRIx64 ", actual: 0x%" PRIx64 "",
+ 					configstruct.slw, regions[j].len);
+ 				ok = false;
+ 			} else
+@@ -274,7 +274,7 @@ static int reserv_mem_limits_test(fwts_framework *fw)
+ 				fwts_failed(fw, LOG_LEVEL_MEDIUM,
+ 					"ImageSizeMismatch",
+ 					"Mismatch in occ-common-area size, "
+-					"expected: 0x%lx, actual: 0x%lx",
++					"expected: 0x%" PRIx64", actual: 0x%" PRIx64"",
+ 					configstruct.occ_common,
+ 					regions[j].len);
+ 				ok = false;
+-- 
+2.13.1
+
meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch new file +33 -0
new file mode 100644
index 000000000..3b83ca57c
@@ -0,0 +1,33 @@
+From 0e89127cd02ecd5ea4506b935cb2b59eb94107d2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Jun 2017 07:37:20 -0700
+Subject: [PATCH 2/3] Define __SWORD_TYPE if not defined by libc
+
+__SWORD_TYPE is internal to glibc, therefore
+check and define it if needed e.g. on musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/src/fwts_uefi.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
+index 1f9d31fa..2d925f8d 100644
+--- a/src/lib/src/fwts_uefi.c
++++ b/src/lib/src/fwts_uefi.c
+@@ -59,6 +59,10 @@ typedef struct {
+ #define UEFI_IFACE_SYSFS		(2)	/* sysfs */
+ #define UEFI_IFACE_EFIVARS		(3)	/* efivar fs */
+ 
++#ifndef __SWORD_TYPE
++typedef __typeof__( ((struct statfs *)0)->f_type )	__SWORD_TYPE;
++#endif
++
+ /* File system magic numbers */
+ #define PSTOREFS_MAGIC          ((__SWORD_TYPE)0x6165676C)
+ #define EFIVARFS_MAGIC          ((__SWORD_TYPE)0xde5e81e4)
+-- 
+2.13.0
+
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +30 -0
new file mode 100644
index 000000000..f84fbffd8
@@ -0,0 +1,30 @@
+From 0857269d5a053b5b4c31cfa01b6501526b24035f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Jun 2017 07:39:28 -0700
+Subject: [PATCH 3/3] Undefine PAGE_SIZE
+
+musl defines PAGE_SIZE and build complains
+of multiple definitions
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/src/fwts_acpi_tables.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
+index 1d4fc705..71023ad2 100644
+--- a/src/lib/src/fwts_acpi_tables.c
++++ b/src/lib/src/fwts_acpi_tables.c
+@@ -42,6 +42,7 @@
+ #define BIOS_START	(0x000e0000)		/* Start of BIOS memory */
+ #define BIOS_END  	(0x000fffff)		/* End of BIOS memory */
+ #define BIOS_LENGTH	(BIOS_END - BIOS_START)	/* Length of BIOS memory */
++#undef PAGE_SIZE
+ #define PAGE_SIZE	(4096)
+ 
+ static fwts_acpi_table_info	tables[ACPI_MAX_TABLES];
+-- 
+2.13.0
+
meta-oe/recipes-test/fwts/fwts/0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch new file +76 -0
new file mode 100644
index 000000000..3cd3fbbc1
@@ -0,0 +1,76 @@
+From d0d76820efe51dd404d381fc4c46544008e757dd Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 8 Jun 2017 16:50:59 -0700
+Subject: [PATCH 3/3] use intptr_t to fix pointer-to-int-cast issues
+
+uintptr_t is guaranteed to be wide enough that
+converting a void* to uintptr_t and back again
+will yield the original pointer value
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/src/fwts_acpi_tables.c | 4 ++--
+ src/lib/src/fwts_mmap.c        | 2 +-
+ src/lib/src/fwts_smbios.c      | 4 ++--
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
+index 832f8d66..d0006529 100644
+--- a/src/lib/src/fwts_acpi_tables.c
++++ b/src/lib/src/fwts_acpi_tables.c
+@@ -150,7 +150,7 @@ static fwts_acpi_table_rsdp *fwts_acpi_get_rsdp(fwts_framework *fw, void *addr,
+ 	fwts_acpi_table_rsdp *rsdp = NULL;
+ 	*rsdp_len = 0;
+ 
+-	if ((mem = fwts_mmap((off_t)addr, sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED)
++	if ((mem = fwts_mmap((uintptr_t)addr, sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED)
+ 		return NULL;
+ 
+ 	if (fwts_safe_memread(mem, sizeof(fwts_acpi_table_rsdp)) != FWTS_OK) {
+@@ -456,7 +456,7 @@ static int fwts_acpi_load_tables_from_firmware(fwts_framework *fw)
+ 	if ((rsdp = fwts_acpi_get_rsdp(fw, rsdp_addr, &rsdp_len)) == NULL)
+ 		return FWTS_ERROR;
+ 
+-	fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(off_t)rsdp_addr, rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE);
++	fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(uintptr_t)rsdp_addr, rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE);
+ 
+ 	/* Load any tables from XSDT if it's valid */
+ 	if (rsdp->xsdt_address) {
+diff --git a/src/lib/src/fwts_mmap.c b/src/lib/src/fwts_mmap.c
+index a09f688e..9fe6329a 100644
+--- a/src/lib/src/fwts_mmap.c
++++ b/src/lib/src/fwts_mmap.c
+@@ -81,7 +81,7 @@ int fwts_munmap(void *mem, const size_t size)
+ 	off_t offset;
+ 
+ 	page_size = fwts_page_size();
+-	offset = ((off_t)(mem)) & (page_size - 1);
++	offset = ((uintptr_t)(mem)) & (page_size - 1);
+ 
+ 	if (munmap((void *)((uint8_t *)mem - offset), size + offset) < 0)
+ 		return FWTS_ERROR;
+diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c
+index 8d0ea39b..63b4bf25 100644
+--- a/src/lib/src/fwts_smbios.c
++++ b/src/lib/src/fwts_smbios.c
+@@ -54,7 +54,7 @@ static void *fwts_smbios_find_entry_uefi(fwts_framework *fw, fwts_smbios_entry *
+ 	if ((addr = fwts_scan_efi_systab("SMBIOS")) != NULL) {
+ 		fwts_smbios_entry *mapped_entry;
+ 
+-		if ((mapped_entry = fwts_mmap((off_t)addr, sizeof(fwts_smbios_entry))) != FWTS_MAP_FAILED) {
++		if ((mapped_entry = fwts_mmap((uintptr_t)addr, sizeof(fwts_smbios_entry))) != FWTS_MAP_FAILED) {
+ 			*entry = *mapped_entry;
+ 			(void)fwts_munmap(mapped_entry, sizeof(fwts_smbios_entry));
+ 			*type  = FWTS_SMBIOS;
+@@ -84,7 +84,7 @@ static void *fwts_smbios30_find_entry_uefi(fwts_framework *fw, fwts_smbios30_ent
+ 	if ((addr = fwts_scan_efi_systab("SMBIOS3")) != NULL) {
+ 		fwts_smbios30_entry *mapped_entry;
+ 
+-		if ((mapped_entry = fwts_mmap((off_t)addr, sizeof(fwts_smbios30_entry))) != FWTS_MAP_FAILED) {
++		if ((mapped_entry = fwts_mmap((uintptr_t)addr, sizeof(fwts_smbios30_entry))) != FWTS_MAP_FAILED) {
+ 			*entry = *mapped_entry;
+ 			(void)fwts_munmap(mapped_entry, sizeof(fwts_smbios30_entry));
+ 			return addr;
+-- 
+2.13.1
+
meta-oe/recipes-test/fwts/fwts_git.bb +10 -2
index 4c4ae66d6..87a23af19 100644
@@ -5,11 +5,17 @@ HOMEPAGE = "https://wiki.ubuntu.com/Kernel/Reference/fwts"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://src/main.c;beginline=1;endline=16;md5=31da590f3e9f3bd34dcdb9e4db568519"
 
-PV = "17.03.00"
+PV = "17.03.00+git${SRCPV}"
 
-SRCREV = "e3e9d1442b4cc70f5b30199f584cec8e25aeaad4"
+SRCREV = "0153ea51cb648b3067a1b327eee6a075b6cfa330"
 SRC_URI = "git://kernel.ubuntu.com/hwe/fwts.git \
            file://0001-ignore-constant-logical-operand-warning-with-clang.patch \
+           file://0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch \
+           file://0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch \
+           file://0003-Undefine-PAGE_SIZE.patch \
+           file://0001-Add-correct-printf-qualifier-for-off_t.patch \
+           file://0002-Add-C99-defined-format-for-printing-uint64_t.patch \
+           file://0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch \
            "
 
 S = "${WORKDIR}/git"
@@ -17,10 +23,12 @@ S = "${WORKDIR}/git"
 COMPATIBLE_HOST = "(i.86|x86_64|aarch64|powerpc64).*-linux"
 
 DEPENDS = "libpcre json-c glib-2.0 dtc"
+DEPENDS_append_libc-musl = " libexecinfo"
 
 inherit autotools pkgconfig
 
 CFLAGS += "-I${STAGING_INCDIR}/json-c -Wno-error=unknown-pragmas"
+LDFLAGS_append_libc-musl = " -lexecinfo"
 
 FILES_${PN} += "${libdir}/fwts/lib*${SOLIBS}"
 FILES_${PN}-dev += "${libdir}/fwts/lib*${SOLIBSDEV} ${libdir}/fwts/lib*.la"
Signature · 1 line
2.13.1
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
author
#2 lore raw

Thanks, I'll check it out.

Quoted 452 lines · Martin Jansa
Quoted 6 lines · Khem Raj

Helps fixing build issues with gcc7

Quoted 6 lines

---
v2 -> v3
- move the LDFLAGS after CFLAGS
v3 -> v4
- Fix point-to-int incompatibilities seen on x86 with off_t being 64bit
- Fix printf formatting issues

I'm sorry but still fails to build for qemux86:
http://errors.yoctoproject.org/Errors/Details/145075/

Quoted 7 lines
 ...01-Add-correct-printf-qualifier-for-off_t.patch | 35 ++++++++++
 ...e-poll.h-instead-of-deprecated-sys-poll.h.patch | 48 ++++++++++++++
 ...-C99-defined-format-for-printing-uint64_t.patch | 53 +++++++++++++++
 ...efine-__SWORD_TYPE-if-not-defined-by-libc.patch | 33 ++++++++++
 .../fwts/fwts/0003-Undefine-PAGE_SIZE.patch        | 30 +++++++++
 ...ntptr_t-to-fix-pointer-to-int-cast-issues.patch | 76

++++++++++++++++++++++

Quoted 3 lines
 meta-oe/recipes-test/fwts/fwts_git.bb              | 12 +++-
 7 files changed, 285 insertions(+), 2 deletions(-)
 create mode 100644

meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch

Quoted 1 line
 create mode 100644

meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch

Quoted 1 line
 create mode 100644

meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch

Quoted 1 line
 create mode 100644

meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch

Quoted 1 line
 create mode 100644

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch

Quoted 1 line
 create mode 100644

meta-oe/recipes-test/fwts/fwts/0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch

Quoted 2 lines

diff --git

a/meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch b/meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch

Quoted 4 lines

new file mode 100644
index 000000000..891185de6
--- /dev/null
+++

b/meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch

meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch line 11

Quoted 12 lines
meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch new file +11 -0
@@ -0,0 +1,35 @@
+From 232daf5fca6fb52cced5e810f2601fe1a71b96d8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 8 Jun 2017 16:49:50 -0700
+Subject: [PATCH 1/3] Add correct printf qualifier for off_t
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/bios/ebda_region/ebda_region.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/bios/ebda_region/ebda_region.c

b/src/bios/ebda_region/ebda_region.c

meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch

Quoted 8 lines
meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch new file +8 -0
+index 54768a95..fec04445 100644
+--- a/src/bios/ebda_region/ebda_region.c
++++ b/src/bios/ebda_region/ebda_region.c
+@@ -83,7 +83,7 @@ static int ebda_test1(fwts_framework *fw)
+     if ((entry != NULL) &&
+         (entry->type == FWTS_MEMORY_MAP_RESERVED ||
+          entry->type == FWTS_MEMORY_MAP_ACPI)) {
+-            fwts_passed(fw, "EBDA region mapped at 0x%lx and reserved

as a %" PRId64

Review line 20

Quoted 1 line
(quoted diff) +1 -0
++            fwts_passed(fw, "EBDA region mapped at 0x%jdx and reserved

as a %" PRId64

Review line 21

Quoted 1 line
(quoted diff) +1 -0
+                     "K region in the %s table at 0x%" PRIx64 "..0x%"

PRIx64 ".",

meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch

Quoted 7 lines
meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch new file +7 -0
+                     ebda_addr,
+                     (entry->end_address - entry->start_address) / 1024,
+@@ -93,7 +93,7 @@ static int ebda_test1(fwts_framework *fw)
+     } else
+             fwts_failed(fw, LOG_LEVEL_MEDIUM,
+                     "EBDAMappedNotReserved",
+-                    "EBDA region mapped at 0x%lx but not reserved in

the %s table.",

Review line 29

Quoted 1 line
(quoted diff) +1 -0
++                    "EBDA region mapped at 0x%jdx but not reserved in

the %s table.",

Quoted 7 lines
meta-oe/recipes-test/fwts/fwts/0001-Add-correct-printf-qualifier-for-off_t.patch new file +6 -0
+                     ebda_addr, memory_map_name);
+
+     return FWTS_OK;
+--
+2.13.1
+

diff --git

a/meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch b/meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch

Quoted 4 lines

new file mode 100644
index 000000000..8ad078936
--- /dev/null
+++

b/meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch

Quoted 49 lines
meta-oe/recipes-test/fwts/fwts/0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch new file +48 -0
@@ -0,0 +1,48 @@
+From 100a107a53d5dc9b0554252ac5dbf2c9330615e9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Jun 2017 07:25:09 -0700
+Subject: [PATCH 1/3] Include poll.h instead of deprecated sys/poll.h
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/src/fwts_ipmi.c   | 3 ++-
+ src/lib/src/fwts_pipeio.c | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/lib/src/fwts_ipmi.c b/src/lib/src/fwts_ipmi.c
+index cbb27611..70d11cfa 100644
+--- a/src/lib/src/fwts_ipmi.c
++++ b/src/lib/src/fwts_ipmi.c
+@@ -18,10 +18,11 @@
+  *
+  */
+
++#include <poll.h>
++
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+-#include <sys/poll.h>
+ #include <sys/ioctl.h>
+ #include <linux/ipmi.h>
+
+diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
+index fd719640..bdc5b2ea 100644
+--- a/src/lib/src/fwts_pipeio.c
++++ b/src/lib/src/fwts_pipeio.c
+@@ -30,9 +30,9 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <paths.h>
++#include <poll.h>
+
+ #include <sys/param.h>
+-#include <sys/poll.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <errno.h>
+--
+2.13.0
+
Quoted 1 line

diff --git

a/meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch b/meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch

Quoted 4 lines

new file mode 100644
index 000000000..35ce883a2
--- /dev/null
+++

b/meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch

Quoted 6 lines
meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch new file +5 -0
@@ -0,0 +1,53 @@
+From 25f18b9ac37960dc12a3b648a5c866bd56ef2cbe Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 8 Jun 2017 16:50:23 -0700
+Subject: [PATCH 2/3] Add C99 defined format for printing uint64_t
+

meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch line 15

Quoted 10 lines
meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch new file +10 -0
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/opal/reserv_mem.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/opal/reserv_mem.c b/src/opal/reserv_mem.c
+index eeec2947..f0672e05 100644
+--- a/src/opal/reserv_mem.c
++++ b/src/opal/reserv_mem.c
+@@ -185,7 +185,7 @@ static int reserv_mem_limits_test(fwts_framework

*fw)

meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch

Quoted 9 lines
meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch new file +9 -0
+             regions[j].start = (uint64_t)be64toh(ranges[2 * j]);
+             regions[j].len = (uint64_t)be64toh(ranges[2 * j + 1]);
+             fwts_log_info(fw, "Region name %80s"
+-                    " start: 0x%08lx, len: 0x%08lx\n",
++                    " start: 0x%08" PRIx64 ", len: 0x%08" PRIx64 "\n",
+                     regions[j].name, regions[j].start, regions[j].len);
+     }
+
+@@ -248,7 +248,7 @@ static int reserv_mem_limits_test(fwts_framework

*fw)

meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch

Quoted 5 lines
meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch new file +5 -0
+                             fwts_failed(fw, LOG_LEVEL_MEDIUM,
+                                     "ImageSizeMismatch",
+                                     "Mismatch in homer-image size, "
+-                                    "expected: 0x%lx, actual: 0x%lx",
++                                    "expected: 0x%" PRIx64 ", actual:

0x%" PRIx64 "",

Review line 30

Quoted 1 line
(quoted diff) +1 -0
+                                     configstruct.homer,

regions[j].len);

meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch

Quoted 3 lines
meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch new file +3 -0
+                             ok = false;
+                     } else
+@@ -261,7 +261,7 @@ static int reserv_mem_limits_test(fwts_framework

*fw)

meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch

Quoted 5 lines
meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch new file +5 -0
+                             fwts_failed(fw, LOG_LEVEL_MEDIUM,
+                                     "ImageSizeMismatch",
+                                     "Mismatch in slw-image size, "
+-                                    "expected: 0x%lx, actual: 0x%lx",
++                                    "expected: 0x%" PRIx64 ", actual:

0x%" PRIx64 "",

meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch

Quoted 4 lines
meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch new file +4 -0
+                                     configstruct.slw, regions[j].len);
+                             ok = false;
+                     } else
+@@ -274,7 +274,7 @@ static int reserv_mem_limits_test(fwts_framework

*fw)

meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch

Quoted 3 lines
meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch new file +3 -0
+                             fwts_failed(fw, LOG_LEVEL_MEDIUM,
+                                     "ImageSizeMismatch",
+                                     "Mismatch in occ-common-area size,

"

Review line 47

Quoted 2 lines
(quoted diff) +2 -0
+-                                    "expected: 0x%lx, actual: 0x%lx",
++                                    "expected: 0x%" PRIx64", actual:

0x%" PRIx64"",

Quoted 7 lines
meta-oe/recipes-test/fwts/fwts/0002-Add-C99-defined-format-for-printing-uint64_t.patch new file +6 -0
+                                     configstruct.occ_common,
+                                     regions[j].len);
+                             ok = false;
+--
+2.13.1
+

diff --git

a/meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch b/meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch

Quoted 4 lines

new file mode 100644
index 000000000..3b83ca57c
--- /dev/null
+++

b/meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch

Quoted 34 lines
meta-oe/recipes-test/fwts/fwts/0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch new file +33 -0
@@ -0,0 +1,33 @@
+From 0e89127cd02ecd5ea4506b935cb2b59eb94107d2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Jun 2017 07:37:20 -0700
+Subject: [PATCH 2/3] Define __SWORD_TYPE if not defined by libc
+
+__SWORD_TYPE is internal to glibc, therefore
+check and define it if needed e.g. on musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/src/fwts_uefi.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
+index 1f9d31fa..2d925f8d 100644
+--- a/src/lib/src/fwts_uefi.c
++++ b/src/lib/src/fwts_uefi.c
+@@ -59,6 +59,10 @@ typedef struct {
+ #define UEFI_IFACE_SYSFS            (2)     /* sysfs */
+ #define UEFI_IFACE_EFIVARS          (3)     /* efivar fs */
+
++#ifndef __SWORD_TYPE
++typedef __typeof__( ((struct statfs *)0)->f_type )  __SWORD_TYPE;
++#endif
++
+ /* File system magic numbers */
+ #define PSTOREFS_MAGIC          ((__SWORD_TYPE)0x6165676C)
+ #define EFIVARFS_MAGIC          ((__SWORD_TYPE)0xde5e81e4)
+--
+2.13.0
+
Quoted 1 line

diff --git

a/meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch b/meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch

Quoted 11 lines

new file mode 100644
index 000000000..f84fbffd8

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +6 -0
@@ -0,0 +1,30 @@
+From 0857269d5a053b5b4c31cfa01b6501526b24035f Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Jun 2017 07:39:28 -0700
+Subject: [PATCH 3/3] Undefine PAGE_SIZE
+
+musl defines PAGE_SIZE and build complains

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 16

Quoted 10 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +10 -0
+of multiple definitions
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/src/fwts_acpi_tables.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lib/src/fwts_acpi_tables.c

b/src/lib/src/fwts_acpi_tables.c

Quoted 14 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +14 -0
+index 1d4fc705..71023ad2 100644
+--- a/src/lib/src/fwts_acpi_tables.c
++++ b/src/lib/src/fwts_acpi_tables.c
+@@ -42,6 +42,7 @@
+ #define BIOS_START  (0x000e0000)            /* Start of BIOS memory */
+ #define BIOS_END    (0x000fffff)            /* End of BIOS memory */
+ #define BIOS_LENGTH (BIOS_END - BIOS_START) /* Length of BIOS memory */
++#undef PAGE_SIZE
+ #define PAGE_SIZE   (4096)
+
+ static fwts_acpi_table_info tables[ACPI_MAX_TABLES];
+--
+2.13.0
+
Quoted 1 line

diff --git

a/meta-oe/recipes-test/fwts/fwts/0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch b/meta-oe/recipes-test/fwts/fwts/0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch

Quoted 4 lines

new file mode 100644
index 000000000..3cd3fbbc1
--- /dev/null
+++

b/meta-oe/recipes-test/fwts/fwts/0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch

Quoted 8 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +7 -0
@@ -0,0 +1,76 @@
+From d0d76820efe51dd404d381fc4c46544008e757dd Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 8 Jun 2017 16:50:59 -0700
+Subject: [PATCH 3/3] use intptr_t to fix pointer-to-int-cast issues
+
+uintptr_t is guaranteed to be wide enough that
+converting a void* to uintptr_t and back again

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 17

Quoted 10 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +10 -0
+will yield the original pointer value
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/src/fwts_acpi_tables.c | 4 ++--
+ src/lib/src/fwts_mmap.c        | 2 +-
+ src/lib/src/fwts_smbios.c      | 4 ++--
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/lib/src/fwts_acpi_tables.c

b/src/lib/src/fwts_acpi_tables.c

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 21

Quoted 4 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +4 -0
+index 832f8d66..d0006529 100644
+--- a/src/lib/src/fwts_acpi_tables.c
++++ b/src/lib/src/fwts_acpi_tables.c
+@@ -150,7 +150,7 @@ static fwts_acpi_table_rsdp

*fwts_acpi_get_rsdp(fwts_framework *fw, void *addr,

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 25

Quoted 4 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +4 -0
+     fwts_acpi_table_rsdp *rsdp = NULL;
+     *rsdp_len = 0;
+
+-    if ((mem = fwts_mmap((off_t)addr, sizeof(fwts_acpi_table_rsdp)))

== FWTS_MAP_FAILED)

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 26

Quoted 1 line
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +1 -0
++    if ((mem = fwts_mmap((uintptr_t)addr,

sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED)

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 29

Quoted 3 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +3 -0
+             return NULL;
+
+     if (fwts_safe_memread(mem, sizeof(fwts_acpi_table_rsdp)) !=

FWTS_OK) {

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 30

Quoted 1 line
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +1 -0
+@@ -456,7 +456,7 @@ static int

fwts_acpi_load_tables_from_firmware(fwts_framework *fw)

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 34

Quoted 4 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +4 -0
+     if ((rsdp = fwts_acpi_get_rsdp(fw, rsdp_addr, &rsdp_len)) == NULL)
+             return FWTS_ERROR;
+
+-    fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(off_t)rsdp_addr,

rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE);

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 35

Quoted 1 line
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +1 -0
++    fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(uintptr_t)rsdp_addr,

rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE);

Quoted 11 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +11 -0
+
+     /* Load any tables from XSDT if it's valid */
+     if (rsdp->xsdt_address) {
+diff --git a/src/lib/src/fwts_mmap.c b/src/lib/src/fwts_mmap.c
+index a09f688e..9fe6329a 100644
+--- a/src/lib/src/fwts_mmap.c
++++ b/src/lib/src/fwts_mmap.c
+@@ -81,7 +81,7 @@ int fwts_munmap(void *mem, const size_t size)
+     off_t offset;
+
+     page_size = fwts_page_size();

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 56

Quoted 10 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +10 -0
+-    offset = ((off_t)(mem)) & (page_size - 1);
++    offset = ((uintptr_t)(mem)) & (page_size - 1);
+
+     if (munmap((void *)((uint8_t *)mem - offset), size + offset) < 0)
+             return FWTS_ERROR;
+diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c
+index 8d0ea39b..63b4bf25 100644
+--- a/src/lib/src/fwts_smbios.c
++++ b/src/lib/src/fwts_smbios.c
+@@ -54,7 +54,7 @@ static void

*fwts_smbios_find_entry_uefi(fwts_framework *fw, fwts_smbios_entry *

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 60

Quoted 4 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +4 -0
+     if ((addr = fwts_scan_efi_systab("SMBIOS")) != NULL) {
+             fwts_smbios_entry *mapped_entry;
+
+-            if ((mapped_entry = fwts_mmap((off_t)addr,

sizeof(fwts_smbios_entry))) != FWTS_MAP_FAILED) {

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 61

Quoted 1 line
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +1 -0
++            if ((mapped_entry = fwts_mmap((uintptr_t)addr,

sizeof(fwts_smbios_entry))) != FWTS_MAP_FAILED) {

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 63

Quoted 2 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +2 -0
+                     *entry = *mapped_entry;
+                     (void)fwts_munmap(mapped_entry,

sizeof(fwts_smbios_entry));

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 65

Quoted 2 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +2 -0
+                     *type  = FWTS_SMBIOS;
+@@ -84,7 +84,7 @@ static void

*fwts_smbios30_find_entry_uefi(fwts_framework *fw, fwts_smbios30_ent

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 69

Quoted 4 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +4 -0
+     if ((addr = fwts_scan_efi_systab("SMBIOS3")) != NULL) {
+             fwts_smbios30_entry *mapped_entry;
+
+-            if ((mapped_entry = fwts_mmap((off_t)addr,

sizeof(fwts_smbios30_entry))) != FWTS_MAP_FAILED) {

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 70

Quoted 1 line
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +1 -0
++            if ((mapped_entry = fwts_mmap((uintptr_t)addr,

sizeof(fwts_smbios30_entry))) != FWTS_MAP_FAILED) {

meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch line 72

Quoted 2 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +2 -0
+                     *entry = *mapped_entry;
+                     (void)fwts_munmap(mapped_entry,

sizeof(fwts_smbios30_entry));

Review

Quoted 5 lines
meta-oe/recipes-test/fwts/fwts/0003-Undefine-PAGE_SIZE.patch new file +4 -0
+                     return addr;
+--
+2.13.1
+
(quoted diff) +0 -0

b/meta-oe/recipes-test/fwts/fwts_git.bb

meta-oe/recipes-test/fwts/fwts_git.bb HOMEPAGE = "

Quoted 4 lines

index 4c4ae66d6..87a23af19 100644

meta-oe/recipes-test/fwts/fwts_git.bb +0 -0
@@ -5,11 +5,17 @@ HOMEPAGE = "

https://wiki.ubuntu.com/Kernel/Reference/fwts"

meta-oe/recipes-test/fwts/fwts_git.bb HOMEPAGE = " · line 6

Quoted 2 lines
meta-oe/recipes-test/fwts/fwts_git.bb +0 -0
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM =

"file://src/main.c;beginline=1;endline=16;md5=31da590f3e9f3bd34dcdb9e4db568519"

meta-oe/recipes-test/fwts/fwts_git.bb HOMEPAGE = "https://wiki.ubuntu.com/Kernel/Reference/fwts" · line 20

Quoted 8 lines
meta-oe/recipes-test/fwts/fwts_git.bb +2 -2
-PV = "17.03.00"
+PV = "17.03.00+git${SRCPV}"
 
-SRCREV = "e3e9d1442b4cc70f5b30199f584cec8e25aeaad4"
+SRCREV = "0153ea51cb648b3067a1b327eee6a075b6cfa330"
 SRC_URI = "git://kernel.ubuntu.com/hwe/fwts.git \
 

file://0001-ignore-constant-logical-operand-warning-with-clang.patch \

meta-oe/recipes-test/fwts/fwts_git.bb HOMEPAGE = " · line 12

Quoted 1 line
meta-oe/recipes-test/fwts/fwts_git.bb +1 -0
+

file://0001-Include-poll.h-instead-of-deprecated-sys-poll.h.patch \

meta-oe/recipes-test/fwts/fwts_git.bb HOMEPAGE = " · line 13

Quoted 1 line
meta-oe/recipes-test/fwts/fwts_git.bb +1 -0
+           file://0002-Define-__SWORD_TYPE-if-not-defined-by-libc.patch

\

meta-oe/recipes-test/fwts/fwts_git.bb HOMEPAGE = "https://wiki.ubuntu.com/Kernel/Reference/fwts"

Quoted 3 lines
meta-oe/recipes-test/fwts/fwts_git.bb +3 -0
+           file://0003-Undefine-PAGE_SIZE.patch \
+           file://0001-Add-correct-printf-qualifier-for-off_t.patch \
+

file://0002-Add-C99-defined-format-for-printing-uint64_t.patch \

meta-oe/recipes-test/fwts/fwts_git.bb HOMEPAGE = " · line 17

Quoted 1 line
meta-oe/recipes-test/fwts/fwts_git.bb +1 -0
+

file://0003-use-intptr_t-to-fix-pointer-to-int-cast-issues.patch \

Quoted 6 lines
meta-oe/recipes-test/fwts/fwts_git.bb +0 -0
            "
 
 S = "${WORKDIR}/git"
@@ -17,10 +23,12 @@ S = "${WORKDIR}/git"
 COMPATIBLE_HOST = "(i.86|x86_64|aarch64|powerpc64).*-linux"
 

meta-oe/recipes-test/fwts/fwts_git.bb S = "${WORKDIR}/git" · line 34

Quoted 10 lines
meta-oe/recipes-test/fwts/fwts_git.bb +2 -0
 DEPENDS = "libpcre json-c glib-2.0 dtc"
+DEPENDS_append_libc-musl = " libexecinfo"
 
 inherit autotools pkgconfig
 
 CFLAGS += "-I${STAGING_INCDIR}/json-c -Wno-error=unknown-pragmas"
+LDFLAGS_append_libc-musl = " -lexecinfo"
 
 FILES_${PN} += "${libdir}/fwts/lib*${SOLIBS}"
 FILES_${PN}-dev += "${libdir}/fwts/lib*${SOLIBSDEV}

${libdir}/fwts/lib*.la"

Quoted 3 lines

--
2.13.1

--
Martin 'JaMa' Jansa jabber: [email protected]