Blame SOURCES/0003-Build-with-fshort-wchar-so-toggle-passwords-work-rig.patch

112f40
From 9eb111a7f7b897ba4ae19a68708e010a5c384260 Mon Sep 17 00:00:00 2001
112f40
From: Peter Jones <pjones@redhat.com>
112f40
Date: Fri, 19 Jun 2015 16:53:36 -0400
112f40
Subject: [PATCH 03/10] Build with -fshort-wchar so toggle passwords work
112f40
 right.
112f40
112f40
This source tree uses:
112f40
112f40
typedef wchar_t efi_char16_t;
112f40
112f40
to define UEFI's UCS-2 character type.  On many platforms, wchar_t is
112f40
32-bits by default.  As a result, efichar_from_char winds up writing
112f40
4-byte characters instead of 2-byte characters.  In the case where we
112f40
hash the password in mokutil, this works fine, because the same datatype
112f40
is used, and the values are the same.  But for our feature toggles,
112f40
where we store the raw data and shim is interpretting the character
112f40
array, every other character winds up being L'\0', and verification
112f40
fails.
112f40
112f40
So always build with -fshort-wchar to ensure we get 2-byte character
112f40
storage.
112f40
112f40
Signed-off-by: Peter Jones <pjones@redhat.com>
112f40
---
112f40
 configure.ac | 2 +-
112f40
 1 file changed, 1 insertion(+), 1 deletion(-)
112f40
112f40
diff --git a/configure.ac b/configure.ac
112f40
index fe28fb92241..69d412ac633 100644
112f40
--- a/configure.ac
112f40
+++ b/configure.ac
112f40
@@ -37,7 +37,7 @@ else
112f40
 	default_strict=no
112f40
 fi
112f40
 
112f40
-WARNINGFLAGS_C="$WARNINGFLAGS_C -std=gnu11"
112f40
+WARNINGFLAGS_C="$WARNINGFLAGS_C -std=gnu11 -fshort-wchar"
112f40
 
112f40
 AC_ARG_ENABLE(strict, AS_HELP_STRING([--enable-strict],[Enable strict compilation options]), enable_strict=$enableval,
112f40
 		enable_strict=$default_strict)
112f40
-- 
112f40
2.17.1
112f40