Warnings when building for arm

Denys Vlasenko vda.linux at googlemail.com
Sun Jul 5 18:29:53 UTC 2009


On Sunday 05 July 2009 16:42, Tito wrote:
> Hi,
> while building for arm I've noticed this warnings:
> 
> libbb/sha1.c:176:1: warning: "R0" redefined
> In file included from /home/tito/Desktop/android/arm-2008q3/bin/../arm-none-linux-gnueabi/libc/usr/include/signal.h:353,
>                  from include/libbb.h:22,
>                  from libbb/sha1.c:31:
> /home/tito/Desktop/android/arm-2008q3/bin/../arm-none-linux-gnueabi/libc/usr/include/sys/ucontext.h:44:1: warning: this is the location of the previous definition
> libbb/sha1.c:177:1: warning: "R1" redefined
> /home/tito/Desktop/android/arm-2008q3/bin/../arm-none-linux-gnueabi/libc/usr/include/sys/ucontext.h:46:1: warning: this is the location of the previous definition
> 
> 
> The build completes, so it is not a big problem.
> Attached is a trivial patch that seems to fix the problem.
> Hope I've got it right with this obscure git voodo. 


Can you test whether we can simply undef all macros
before using these names? Like this:

--
vda


diff -d -urpN busybox.2/libbb/sha1.c busybox.3/libbb/sha1.c
--- busybox.2/libbb/sha1.c	2009-07-05 13:23:15.000000000 +0200
+++ busybox.3/libbb/sha1.c	2009-07-05 20:27:10.000000000 +0200
@@ -53,6 +53,12 @@ static inline uint64_t hton64(uint64_t v
 #endif
 
 
+/* Some arch headers have conflicting defines */
+#undef ch
+#undef parity
+#undef maj
+#undef rnd
+
 static void FAST_FUNC sha1_process_block64(sha1_ctx_t *ctx)
 {
 	unsigned t;
@@ -162,6 +168,13 @@ static const uint64_t sha_K[80] = {
 	0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL
 };
 
+#undef Ch
+#undef Maj
+#undef S0
+#undef S1
+#undef R0
+#undef R1
+
 static void FAST_FUNC sha256_process_block64(sha256_ctx_t *ctx)
 {
 	unsigned t;


More information about the busybox mailing list