void-packages/srcpkgs/efivar/patches/portability.patch
2015-08-30 02:01:47 +02:00

62 lines
2 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 262acfc7c4fbb4bbc76f4235220336fd41993ca8 Mon Sep 17 00:00:00 2001
From: Felix Janda <felix.janda@posteo.de>
Date: Tue, 14 Jul 2015 05:53:04 -0600
Subject: [PATCH 1/2] Remove -fshort-wchar from CFLAGS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-fshort-wchar makes wchar_t 16bit. We are not using wchar_t anywhere,
so we don't need it. Removing it fixes an compilation error with musl
libc:
In file included from dp-acpi.c:21:0:
/usr/ligcc/armv7a-hardfloat-linux-musleabi/4.7.4/include/stddef.h:325:24: error: conflicting types for wchar_t
In file included from /usr/include/inttypes.h:12:0,
from dp-acpi.c:20:
/usr/include/bits/alltypes.h:18:18: note: previous declaration of wchar_t was here
make[1]: *** [dp-acpi.o] Error 1
make: *** [src] Error 2
---
Make.defaults | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git Make.defaults Make.defaults
index cc2baa9..7f5ae5e 100644
--- Make.defaults
+++ Make.defaults
@@ -13,7 +13,7 @@ clang_cflags =
gcc_cflags = -Wmaybe-uninitialized
cflags := $(CFLAGS) \
-Werror -Wall -Wsign-compare -Wstrict-aliasing \
- -std=gnu11 -fshort-wchar -fPIC \
+ -std=gnu11 -fPIC \
-fvisibility=hidden \
-D_GNU_SOURCE -I${TOPDIR}/src/include/efivar/ \
$(if $(filter $(CC),clang),$(clang_cflags),) \
From 841ae2fc8c911dbac595cbd228be6bfed7881cad Mon Sep 17 00:00:00 2001
From: Felix Janda <felix.janda@posteo.de>
Date: Tue, 14 Jul 2015 05:56:05 -0600
Subject: [PATCH 2/2] Use the more portable major() instead of gnu_dev_major()
Do the same for minor() and gnu_dev_minor()
---
src/linux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git src/linux.c src/linux.c
index c4d099e..0cbd94a 100644
--- src/linux.c
+++ src/linux.c
@@ -129,8 +129,8 @@ get_partition_number(const char *devpath)
return -1;
}
- maj = gnu_dev_major(statbuf.st_rdev);
- min = gnu_dev_minor(statbuf.st_rdev);
+ maj = major(statbuf.st_rdev);
+ min = minor(statbuf.st_rdev);
rc = sysfs_readlink(&linkbuf, "/sys/dev/block/%u:%u", maj, min);
if (rc < 0)