Merge tag 'efi-2019-10-rc5' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for v2019.10-rc5

Bug fixes for the SetVariable() boot service.
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 84e79bf..a1c5b4f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -145,6 +145,13 @@
   script:
     - make tools-only_config tools-only -j$(nproc)
 
+# Ensure env tools build
+Build envtools:
+  tags: [ 'all' ]
+  stage: testsuites
+  script:
+    - make tools-only_config envtools -j$(nproc)
+
 Run binman, buildman, dtoc and patman testsuites:
   tags: [ 'all' ]
   stage: testsuites
diff --git a/.travis.yml b/.travis.yml
index 59d2e97..0ce09e3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -361,6 +361,10 @@
     - name: "Build tools-only"
       script:
         - make tools-only_config tools-only -j$(nproc)
+    # Ensure env tools build
+    - name: "Build envtools"
+      script:
+        - make tools-only_config envtools -j$(nproc)
 
     # test/py
     - name: "test/py sandbox"
diff --git a/include/env.h b/include/env.h
index a74a261..b72239f 100644
--- a/include/env.h
+++ b/include/env.h
@@ -9,6 +9,7 @@
 #ifndef __ENV_H
 #define __ENV_H
 
+#include <compiler.h>
 #include <stdbool.h>
 #include <linux/types.h>
 
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 95c9984..e2801f5 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -119,13 +119,6 @@
 
 static int have_redund_env;
 
-static unsigned char ENV_REDUND_ACTIVE = 1;
-/*
- * ENV_REDUND_OBSOLETE must be 0 to efficiently set it on NOR flash without
- * erasing
- */
-static unsigned char ENV_REDUND_OBSOLETE;
-
 #define DEFAULT_ENV_INSTANCE_STATIC
 #include <env_default.h>
 
@@ -1142,6 +1135,7 @@
 {
 	int rc;
 	struct erase_info_user erase;
+	char tmp = ENV_REDUND_OBSOLETE;
 
 	erase.start = DEVOFFSET(dev);
 	erase.length = DEVESIZE(dev);
@@ -1153,7 +1147,7 @@
 		return rc;
 	}
 	ioctl(fd, MEMUNLOCK, &erase);
-	rc = write(fd, &ENV_REDUND_OBSOLETE, sizeof(ENV_REDUND_OBSOLETE));
+	rc = write(fd, &tmp, sizeof(tmp));
 	ioctl(fd, MEMLOCK, &erase);
 	if (rc < 0)
 		perror("Could not set obsolete flag");