Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] vboot-utils: convert to Git formatted patches
@ 2016-01-21 21:10 Thomas Petazzoni
  2016-01-21 21:10 ` [Buildroot] [PATCH 2/2] vboot-utils: fix RSA redefinition build error with old compilers Thomas Petazzoni
  2016-01-23 12:11 ` [Buildroot] [PATCH 1/2] vboot-utils: convert to Git formatted patches Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-01-21 21:10 UTC (permalink / raw)
  To: buildroot

Since vboot-utils is hosted in a Git repository, it makes sense to use
Git formatted patches for this package.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...Add-missing-definition-of-MTD_CHAR_MAJOR.patch} | 15 +++++++++++-
 ...02-Add-missing-header-include-for-ssize_t.patch | 27 ++++++++++++++++++++++
 package/vboot-utils/0002-ssize-t.patch             | 14 -----------
 3 files changed, 41 insertions(+), 15 deletions(-)
 rename package/vboot-utils/{0001-mtd-char-major.patch => 0001-Add-missing-definition-of-MTD_CHAR_MAJOR.patch} (57%)
 create mode 100644 package/vboot-utils/0002-Add-missing-header-include-for-ssize_t.patch
 delete mode 100644 package/vboot-utils/0002-ssize-t.patch

diff --git a/package/vboot-utils/0001-mtd-char-major.patch b/package/vboot-utils/0001-Add-missing-definition-of-MTD_CHAR_MAJOR.patch
similarity index 57%
rename from package/vboot-utils/0001-mtd-char-major.patch
rename to package/vboot-utils/0001-Add-missing-definition-of-MTD_CHAR_MAJOR.patch
index 9db90b2..42410c8 100644
--- a/package/vboot-utils/0001-mtd-char-major.patch
+++ b/package/vboot-utils/0001-Add-missing-definition-of-MTD_CHAR_MAJOR.patch
@@ -1,7 +1,17 @@
-This definition missing from <linux/major.h> for kernels <= 3.13.
+From 1438211660e700b2c9505863aae1cc957236b7c8 Mon Sep 17 00:00:00 2001
+From: Alex Suykov <alex.suykov@gmail.com>
+Date: Thu, 21 Jan 2016 21:59:46 +0100
+Subject: [PATCH] Add missing definition of MTD_CHAR_MAJOR
+
+This definition missing from <linux/major.h> for kernels <= 3.13
 
 Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
+---
+ cgpt/cgpt_wrapper.c | 4 ++++
+ 1 file changed, 4 insertions(+)
 
+diff --git a/cgpt/cgpt_wrapper.c b/cgpt/cgpt_wrapper.c
+index dcfaab9..4d07aad 100644
 --- a/cgpt/cgpt_wrapper.c
 +++ b/cgpt/cgpt_wrapper.c
 @@ -25,6 +25,10 @@
@@ -15,3 +25,6 @@ Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
  // Check if cmdline |argv| has "-D". "-D" signifies that GPT structs are stored
  // off device, and hence we should not wrap around cgpt.
  static bool has_dash_D(int argc, const char *const argv[]) {
+-- 
+2.6.4
+
diff --git a/package/vboot-utils/0002-Add-missing-header-include-for-ssize_t.patch b/package/vboot-utils/0002-Add-missing-header-include-for-ssize_t.patch
new file mode 100644
index 0000000..4d559ea
--- /dev/null
+++ b/package/vboot-utils/0002-Add-missing-header-include-for-ssize_t.patch
@@ -0,0 +1,27 @@
+From b6bed8d4e9453bc74ba021c8c17e20c3b5964c37 Mon Sep 17 00:00:00 2001
+From: Alex Suykov <alex.suykov@gmail.com>
+Date: Thu, 21 Jan 2016 22:00:34 +0100
+Subject: [PATCH] Add missing header include for ssize_t
+
+The code uses ssize_t which is usually defined in <unistd.h>.
+
+Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
+---
+ host/lib/fmap.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/host/lib/fmap.c b/host/lib/fmap.c
+index c95338d..e3db826 100644
+--- a/host/lib/fmap.c
++++ b/host/lib/fmap.c
+@@ -6,6 +6,7 @@
+ 
+ #include <stdio.h>
+ #include <string.h>
++#include <unistd.h>
+ 
+ #include "fmap.h"
+ 
+-- 
+2.6.4
+
diff --git a/package/vboot-utils/0002-ssize-t.patch b/package/vboot-utils/0002-ssize-t.patch
deleted file mode 100644
index 9f1df45..0000000
--- a/package/vboot-utils/0002-ssize-t.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-The code uses ssize_t which is usually defined in <unistd.h>
-
-Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
-
---- a/host/lib/fmap.c
-+++ a/host/lib/fmap.c
-@@ -6,6 +6,7 @@
- 
- #include <stdio.h>
- #include <string.h>
-+#include <unistd.h>
- 
- #include "fmap.h"
- 
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] vboot-utils: fix RSA redefinition build error with old compilers
  2016-01-21 21:10 [Buildroot] [PATCH 1/2] vboot-utils: convert to Git formatted patches Thomas Petazzoni
@ 2016-01-21 21:10 ` Thomas Petazzoni
  2016-01-23 12:11 ` [Buildroot] [PATCH 1/2] vboot-utils: convert to Git formatted patches Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-01-21 21:10 UTC (permalink / raw)
  To: buildroot

Old gcc compilers do not support type redefinitions, which causes a
build failure of the host-vboot-utils package on certain machines. The
vboot-utils source code redefines "typedef struct rsa_st RSA" which is
already defined in the OpenSSL headers.

This commit adds a patch which works around this build issue.

Fixes:

  http://autobuild.buildroot.org/results/1a4/1a45412939a3f9d6fa59d086d834a3b4a4bffef7/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../0003-Avoid-RSA-type-redefinition.patch         | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 package/vboot-utils/0003-Avoid-RSA-type-redefinition.patch

diff --git a/package/vboot-utils/0003-Avoid-RSA-type-redefinition.patch b/package/vboot-utils/0003-Avoid-RSA-type-redefinition.patch
new file mode 100644
index 0000000..86374ca
--- /dev/null
+++ b/package/vboot-utils/0003-Avoid-RSA-type-redefinition.patch
@@ -0,0 +1,44 @@
+From 593407d2b3ea3b871d55ec399671e48c84b900a7 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 21 Jan 2016 22:01:37 +0100
+Subject: [PATCH] Avoid RSA type redefinition
+
+The host_key.h headers does:
+
+  typedef struct rsa_st RSA;
+
+But this type definition is already done by the OpenSSL headers.
+
+While such a type redefinition is legal with recent gcc versions, it
+doesn't build with older gcc versions such as gcc 4.4.
+
+To work around this problem, we instead use a forward declaration of
+"struct rsa_st", and change the only place where the RSA type was used
+by "struct rsa_st".
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ host/lib/include/host_key.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/host/lib/include/host_key.h b/host/lib/include/host_key.h
+index 9f98ccc..c2d01a5 100644
+--- a/host/lib/include/host_key.h
++++ b/host/lib/include/host_key.h
+@@ -12,11 +12,11 @@
+ #include "vboot_struct.h"
+ 
+ 
+-typedef struct rsa_st RSA;
++struct rsa_st;
+ 
+ /* Private key data */
+ typedef struct VbPrivateKey {
+-  RSA* rsa_private_key;  /* Private key data */
++  struct rsa_rt* rsa_private_key;  /* Private key data */
+   uint64_t algorithm;    /* Algorithm to use when signing */
+ } VbPrivateKey;
+ 
+-- 
+2.6.4
+
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] vboot-utils: convert to Git formatted patches
  2016-01-21 21:10 [Buildroot] [PATCH 1/2] vboot-utils: convert to Git formatted patches Thomas Petazzoni
  2016-01-21 21:10 ` [Buildroot] [PATCH 2/2] vboot-utils: fix RSA redefinition build error with old compilers Thomas Petazzoni
@ 2016-01-23 12:11 ` Thomas Petazzoni
  2016-01-23 21:50   ` Alex Suykov
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2016-01-23 12:11 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 21 Jan 2016 22:10:09 +0100, Thomas Petazzoni wrote:
> Since vboot-utils is hosted in a Git repository, it makes sense to use
> Git formatted patches for this package.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Despite the absence of review/ack, I've applied those two patches since
they fix a very frequent build failure (#1 failure in today's report).

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] vboot-utils: convert to Git formatted patches
  2016-01-23 12:11 ` [Buildroot] [PATCH 1/2] vboot-utils: convert to Git formatted patches Thomas Petazzoni
@ 2016-01-23 21:50   ` Alex Suykov
  2016-01-23 22:05     ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Suykov @ 2016-01-23 21:50 UTC (permalink / raw)
  To: buildroot

Sat, Jan 23, 2016 at 01:11:51PM +0100, Thomas Petazzoni wrote:

> Despite the absence of review/ack, I've applied those two patches since
> they fix a very frequent build failure (#1 failure in today's report).

Since it was probably me who should have at least tried it:
the package builds and works well, but there's a typo in the patch.

> -typedef struct rsa_st RSA;
> +struct rsa_st;
(...)
> -  RSA* rsa_private_key;  /* Private key data */
> +  struct rsa_rt* rsa_private_key;  /* Private key data */

The second one should be struct rsa_st, not rsa_rt.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] vboot-utils: convert to Git formatted patches
  2016-01-23 21:50   ` Alex Suykov
@ 2016-01-23 22:05     ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-01-23 22:05 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 23 Jan 2016 23:50:15 +0200, Alex Suykov wrote:

> > Despite the absence of review/ack, I've applied those two patches since
> > they fix a very frequent build failure (#1 failure in today's report).
> 
> Since it was probably me who should have at least tried it:
> the package builds and works well, but there's a typo in the patch.
> 
> > -typedef struct rsa_st RSA;
> > +struct rsa_st;
> (...)
> > -  RSA* rsa_private_key;  /* Private key data */
> > +  struct rsa_rt* rsa_private_key;  /* Private key data */
> 
> The second one should be struct rsa_st, not rsa_rt.

Sigh, how does it build then? Is this structure unused?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-23 22:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-21 21:10 [Buildroot] [PATCH 1/2] vboot-utils: convert to Git formatted patches Thomas Petazzoni
2016-01-21 21:10 ` [Buildroot] [PATCH 2/2] vboot-utils: fix RSA redefinition build error with old compilers Thomas Petazzoni
2016-01-23 12:11 ` [Buildroot] [PATCH 1/2] vboot-utils: convert to Git formatted patches Thomas Petazzoni
2016-01-23 21:50   ` Alex Suykov
2016-01-23 22:05     ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox