void-packages/srcpkgs/efivar/patches/musl-bswap.patch
maxice8 d16d21060a efivar: update to 32.
- Remove musl specific file and patch, opt for using Alpine patch that
works on both musl and glibc, this also cleans the 'case esac' on
do_build()
- Remove sed on Make.rules that add -lpopt, we add 'pkg-config' to
hostmakedepends since the Makefile uses it to find the popt-devel flags
- add patch from upstream commit that fixes the location of efivar.h on
'src/test/tester.c'
- Change build-style to gnu-makefile

Closes: #10128 [via git-merge-pr]
2017-12-28 15:32:44 +01:00

32 lines
1.1 KiB
Diff

From c9b54ee2cd504542cac4ed95fa7842bd14b39f9c Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Fri, 18 Aug 2017 20:36:03 -0500
Subject: [PATCH] makeguids: Ensure compatibility with other libcs
The musl libc does not provide __bswap_constant_XX.
If <endian.h> does not provide these macros, use our own.
This fixes issue #84.
---
src/makeguids.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- src/makeguids.c
+++ src/makeguids.c
@@ -152,6 +152,15 @@ main(int argc, char *argv[])
fprintf(symout, "#include <efivar/efivar.h>\n");
fprintf(symout, "#include <endian.h>\n");
fprintf(symout, """\n\
+#ifndef __bswap_constant_16\n\
+#define __bswap_constant_16(x)\\\n\
+ ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))\n\
+#endif\n\
+#ifndef __bswap_constant_32\n\
+#define __bswap_constant_32(x)\\\n\
+ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \\\n\
+ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))\n\
+#endif\n\
#if BYTE_ORDER == BIG_ENDIAN\n\
#define cpu_to_be32(n) (n)\n\
#define cpu_to_be16(n) (n)\n\