All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] include/common.h: fix build against musl
@ 2015-04-23 22:12 Jörg Krause
  2015-04-23 22:12 ` [PATCH 2/3] Makefile: " Jörg Krause
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jörg Krause @ 2015-04-23 22:12 UTC (permalink / raw)
  To: linux-mtd; +Cc: Jörg Krause

Like uClibc version older than (not yet released) 0.9.34 musl does not have
a rpmatch() implementation.

uClibc defines both __UCLIBC__ and __GLIBC__. So first check for uCibc and its
version and then for a non glibc implementation (like musl). Note, musl does
not define __MUSL__.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
---
 include/common.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/common.h b/include/common.h
index 9b8804a..fb0ca83 100644
--- a/include/common.h
+++ b/include/common.h
@@ -117,11 +117,12 @@ extern "C" {
 	fprintf(stderr, "%s: warning!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \
 } while(0)
 
-#if defined(__UCLIBC__)
-/* uClibc versions before 0.9.34 don't have rpmatch() */
-#if __UCLIBC_MAJOR__ == 0 && \
+/* uClibc versions before 0.9.34 and musl don't have rpmatch() */
+#if defined(__UCLIBC__) && \
+		(__UCLIBC_MAJOR__ == 0 && \
 		(__UCLIBC_MINOR__ < 9 || \
-		(__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 34))
+		(__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 34))) || \
+	!defined(__GLIBC__)
 #undef rpmatch
 #define rpmatch __rpmatch
 static inline int __rpmatch(const char *resp)
@@ -130,7 +131,6 @@ static inline int __rpmatch(const char *resp)
 	(resp[0] == 'n' || resp[0] == 'N') ? 0 : -1;
 }
 #endif
-#endif
 
 /**
  * prompt the user for confirmation
-- 
2.3.6


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

* [PATCH 2/3] Makefile: fix build against musl
  2015-04-23 22:12 [PATCH 1/3] include/common.h: fix build against musl Jörg Krause
@ 2015-04-23 22:12 ` Jörg Krause
  2015-04-24 20:43   ` Jörg Krause
  2015-04-23 22:12 ` [PATCH 3/3] lib/libfec.c: " Jörg Krause
  2015-05-28 23:43 ` [PATCH 1/3] include/common.h: " Brian Norris
  2 siblings, 1 reply; 6+ messages in thread
From: Jörg Krause @ 2015-04-23 22:12 UTC (permalink / raw)
  To: linux-mtd; +Cc: Jörg Krause

Fix undefined reference to 'libintl_gettext'.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index eade234..36bb700 100644
--- a/Makefile
+++ b/Makefile
@@ -105,7 +105,7 @@ $(call _mkdep,lib/,libmtd.a)
 obj-mkfs.ubifs = crc16.o lpt.o compr.o devtable.o \
 	hashtable/hashtable.o hashtable/hashtable_itr.o
 LDFLAGS_mkfs.ubifs = $(ZLIBLDFLAGS) $(LZOLDFLAGS) $(UUIDLDFLAGS)
-LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid
+LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid -lintl
 $(call mkdep,mkfs.ubifs/,mkfs.ubifs,,ubi-utils/libubi.a)
 
 #
-- 
2.3.6


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

* [PATCH 3/3] lib/libfec.c: fix build against musl
  2015-04-23 22:12 [PATCH 1/3] include/common.h: fix build against musl Jörg Krause
  2015-04-23 22:12 ` [PATCH 2/3] Makefile: " Jörg Krause
@ 2015-04-23 22:12 ` Jörg Krause
  2015-05-28 23:39   ` Brian Norris
  2015-05-28 23:43 ` [PATCH 1/3] include/common.h: " Brian Norris
  2 siblings, 1 reply; 6+ messages in thread
From: Jörg Krause @ 2015-04-23 22:12 UTC (permalink / raw)
  To: linux-mtd; +Cc: Jörg Krause

Add missing #include <sys/types.h> for u_long.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
---
 lib/libfec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/libfec.c b/lib/libfec.c
index ff5a127..c5e7749 100644
--- a/lib/libfec.c
+++ b/lib/libfec.c
@@ -45,6 +45,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/types.h>
 
 /*
  * stuff used for testing purposes only
-- 
2.3.6


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

* Re: [PATCH 2/3] Makefile: fix build against musl
  2015-04-23 22:12 ` [PATCH 2/3] Makefile: " Jörg Krause
@ 2015-04-24 20:43   ` Jörg Krause
  0 siblings, 0 replies; 6+ messages in thread
From: Jörg Krause @ 2015-04-24 20:43 UTC (permalink / raw)
  To: linux-mtd

On Fr, 2015-04-24 at 00:12 +0200, Jörg Krause wrote:
> Fix undefined reference to 'libintl_gettext'.
> 
> Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index eade234..36bb700 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -105,7 +105,7 @@ $(call _mkdep,lib/,libmtd.a)
>  obj-mkfs.ubifs = crc16.o lpt.o compr.o devtable.o \
>       hashtable/hashtable.o hashtable/hashtable_itr.o
>  LDFLAGS_mkfs.ubifs = $(ZLIBLDFLAGS) $(LZOLDFLAGS) $(UUIDLDFLAGS)
> -LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid
> +LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid -lintl
>  $(call mkdep,mkfs.ubifs/,mkfs.ubifs,,ubi-utils/libubi.a)
>  
>  #

It turned out that this is unrelated to mtd. Reject this.

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

* Re: [PATCH 3/3] lib/libfec.c: fix build against musl
  2015-04-23 22:12 ` [PATCH 3/3] lib/libfec.c: " Jörg Krause
@ 2015-05-28 23:39   ` Brian Norris
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Norris @ 2015-05-28 23:39 UTC (permalink / raw)
  To: Jörg Krause; +Cc: linux-mtd

On Fri, Apr 24, 2015 at 12:12:53AM +0200, Jörg Krause wrote:
> Add missing #include <sys/types.h> for u_long.

I pushed a different patch from another contributor that kills off the
u_long usage, so I think this should no longer be necessary. Let me know
if you still see issues.

Thanks,
Brian

> Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
> ---
>  lib/libfec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/libfec.c b/lib/libfec.c
> index ff5a127..c5e7749 100644
> --- a/lib/libfec.c
> +++ b/lib/libfec.c
> @@ -45,6 +45,7 @@
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
> +#include <sys/types.h>
>  
>  /*
>   * stuff used for testing purposes only

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

* Re: [PATCH 1/3] include/common.h: fix build against musl
  2015-04-23 22:12 [PATCH 1/3] include/common.h: fix build against musl Jörg Krause
  2015-04-23 22:12 ` [PATCH 2/3] Makefile: " Jörg Krause
  2015-04-23 22:12 ` [PATCH 3/3] lib/libfec.c: " Jörg Krause
@ 2015-05-28 23:43 ` Brian Norris
  2 siblings, 0 replies; 6+ messages in thread
From: Brian Norris @ 2015-05-28 23:43 UTC (permalink / raw)
  To: Jörg Krause; +Cc: linux-mtd

On Fri, Apr 24, 2015 at 12:12:51AM +0200, Jörg Krause wrote:
> Like uClibc version older than (not yet released) 0.9.34 musl does not have
> a rpmatch() implementation.
> 
> uClibc defines both __UCLIBC__ and __GLIBC__. So first check for uCibc and its
> version and then for a non glibc implementation (like musl). Note, musl does
> not define __MUSL__.
> 
> Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>

Applied this one to mtd-utils.git. Thanks!

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

end of thread, other threads:[~2015-05-28 23:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-23 22:12 [PATCH 1/3] include/common.h: fix build against musl Jörg Krause
2015-04-23 22:12 ` [PATCH 2/3] Makefile: " Jörg Krause
2015-04-24 20:43   ` Jörg Krause
2015-04-23 22:12 ` [PATCH 3/3] lib/libfec.c: " Jörg Krause
2015-05-28 23:39   ` Brian Norris
2015-05-28 23:43 ` [PATCH 1/3] include/common.h: " Brian Norris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.