From 0e68a11830ace5651f942c9c4ff830ce0b42d5b8 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 19 Aug 2017 01:45:24 +0000 Subject: user/efivar: new package --- ...ids-Ensure-compatibility-with-other-libcs.patch | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 user/efivar/0001-makeguids-Ensure-compatibility-with-other-libcs.patch (limited to 'user/efivar/0001-makeguids-Ensure-compatibility-with-other-libcs.patch') diff --git a/user/efivar/0001-makeguids-Ensure-compatibility-with-other-libcs.patch b/user/efivar/0001-makeguids-Ensure-compatibility-with-other-libcs.patch new file mode 100644 index 000000000..1577d306b --- /dev/null +++ b/user/efivar/0001-makeguids-Ensure-compatibility-with-other-libcs.patch @@ -0,0 +1,36 @@ +From c9b54ee2cd504542cac4ed95fa7842bd14b39f9c Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +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 does not provide these macros, use our own. + +This fixes issue #84. +--- + src/makeguids.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/makeguids.c b/src/makeguids.c +index ec75a86..6b0d80e 100644 +--- a/src/makeguids.c ++++ b/src/makeguids.c +@@ -152,6 +152,15 @@ main(int argc, char *argv[]) + fprintf(symout, "#include \n"); + fprintf(symout, "#include \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\ +-- +2.10.0 + -- cgit v1.2.3-70-g09d2