Skip to contentSkip to conversation

lib/sha256: fix compile on some hosts

PATCH In review Andreas Bießmann 4 participants 4 messages Apr 20, 2014 – May 13, 2014 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/sha256: fix compile on some hosts

Commit 2842c1c24269a05142802d25520e7cb9035e456c introduced lib/sha256 into mkimage. Since then it will be compiled with HOSTCC which may produce errors on some systems. Most BSD systems (like OS X for me) do not ship a linux/string.h which will lead to take the U-Boot provided include/linux/string.h in the end. This header howver is completely wrong here. Just take the string.h if compiling with HOSTCC and linux/string.h when not.

---

 lib/sha256.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/sha256.c +3 -1
index 3212bab..b1085ea 100644
@@ -8,9 +8,11 @@
 
 #ifndef USE_HOSTCC
 #include <common.h>
+#include <linux/string.h>
+#else
+#include <string.h>
 #endif /* USE_HOSTCC */
 #include <watchdog.h>
-#include <linux/string.h>
 #include <sha256.h>
 
 /*
Signature · 1 line
1.9.2
#1 lore raw

PATCH 1/1 lib/sha256: fix compile on some hosts

Hi Andreas,

Quoted 5 lines · Andreas Bie?mann

Commit 2842c1c24269a05142802d25520e7cb9035e456c introduced lib/sha256 into mkimage. Since then it will be compiled with HOSTCC which may produce errors on some systems. Most BSD systems (like OS X for me) do not ship a linux/string.h which will lead to take the U-Boot provided include/linux/string.h in the end. This header howver is completely wrong

s/howver/however

Quoted 17 lines

here. Just take the string.h if compiling with HOSTCC and linux/string.h when not.

---

  lib/sha256.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
lib/sha256.c +0 -0
index 3212bab..b1085ea 100644
@@ -8,9 +8,11 @@
 
  #ifndef USE_HOSTCC

lib/sha256.c line 18

Quoted 10 lines
lib/sha256.c +3 -1
  #include <common.h>
+#include <linux/string.h>
+#else
+#include <string.h>
  #endif /* USE_HOSTCC */
  #include <watchdog.h>
-#include <linux/string.h>
  #include <sha256.h>
 
  /*

Best Regards,
Bo Shen

#2 lore raw

PATCH 1/1 lib/sha256: fix compile on some hosts

In reply to Andreas Bießmann

Hello Andreas,

Am 20.04.2014 10:34, schrieb Andreas Bie?mann:

Quoted 8 lines

Commit 2842c1c24269a05142802d25520e7cb9035e456c introduced lib/sha256 into mkimage. Since then it will be compiled with HOSTCC which may produce errors on some systems. Most BSD systems (like OS X for me) do not ship a linux/string.h which will lead to take the U-Boot provided include/linux/string.h in the end. This header howver is completely wrong here. Just take the string.h if compiling with HOSTCC and linux/string.h when not.

Quoted 6 lines

---

  lib/sha256.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

Thanks!

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw
In reply to Andreas Bießmann
Quoted 11 lines · Andreas Bie?mann

Commit 2842c1c24269a05142802d25520e7cb9035e456c introduced lib/sha256 into mkimage. Since then it will be compiled with HOSTCC which may produce errors on some systems. Most BSD systems (like OS X for me) do not ship a linux/string.h which will lead to take the U-Boot provided include/linux/string.h in the end. This header howver is completely wrong here. Just take the string.h if compiling with HOSTCC and linux/string.h when not.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140512/d4ebffb6/attachment.pgp>