remove gettext-tiny, libintl is now included in uClibc-ng
[openadk.git] / package / busybox / patches / 009-modutils.patch
blob49ccb8ff435cd3dd0426187e3d31ed66b343d21b
1 From 7cf41b6e281c42fb7f2117927a8ff7f476103e76 Mon Sep 17 00:00:00 2001
2 From: Waldemar Brodkorb <wbx@openadk.org>
3 Date: Sun, 25 Dec 2016 16:53:32 +0100
4 Subject: [PATCH] modutils: remove special handling of uClibc
6 Commit 3a45b87ac36f (modutils: support finit_module syscall) introduced
7 macro finit_module. But it is not defined for uClibc.
9 The compilation for busybox fails for MIPS with:
10 With uClibc, we get following build errors:
12 modutils/lib.a(modutils.o): In function `bb_init_module':
13 modutils.c:(.text.bb_init_module+0x94): undefined reference to `finit_module'
14 modutils.c:(.text.bb_init_module+0xa0): undefined reference to `finit_module'
16 We can just use syscall() without any need for the
17 uClibc wrappers.
19 Newer versions of uClibc-ng (>1.0.20) will remove the
20 module syscall wrappers.
22 Found via Buildroot autobuilders:
23 http://autobuild.buildroot.net/results/556/55655daef23788fb3967f801ec8b79e9bed7122b/build-end.log
25 Reported-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
26 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
27 ---
28 modutils/modprobe-small.c | 4 ++--
29 modutils/modutils.c | 15 +++++----------
30 2 files changed, 7 insertions(+), 12 deletions(-)
32 diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
33 index 652ff4d..0fc9ea4 100644
34 --- a/modutils/modprobe-small.c
35 +++ b/modutils/modprobe-small.c
36 @@ -39,8 +39,8 @@
37 #include <fnmatch.h>
38 #include <sys/syscall.h>
40 -extern int init_module(void *module, unsigned long len, const char *options);
41 -extern int delete_module(const char *module, unsigned flags);
42 +#define init_module(mod, len, opts) syscall(__NR_init_module, mod, len, opts)
43 +#define delete_module(mod, flags) syscall(__NR_delete_module, mod, flags)
44 #ifdef __NR_finit_module
45 # define finit_module(fd, uargs, flags) syscall(__NR_finit_module, fd, uargs, flags)
46 #endif
47 diff --git a/modutils/modutils.c b/modutils/modutils.c
48 index d36caaf..d56bfc8 100644
49 --- a/modutils/modutils.c
50 +++ b/modutils/modutils.c
51 @@ -7,17 +7,12 @@
53 #include "modutils.h"
55 -#ifdef __UCLIBC__
56 -extern int init_module(void *module, unsigned long len, const char *options);
57 -extern int delete_module(const char *module, unsigned int flags);
58 -#else
59 -# include <sys/syscall.h>
60 -# define init_module(mod, len, opts) syscall(__NR_init_module, mod, len, opts)
61 -# if defined(__NR_finit_module)
62 -# define finit_module(fd, uargs, flags) syscall(__NR_finit_module, fd, uargs, flags)
63 -# endif
64 -# define delete_module(mod, flags) syscall(__NR_delete_module, mod, flags)
65 +#include <sys/syscall.h>
66 +#define init_module(mod, len, opts) syscall(__NR_init_module, mod, len, opts)
67 +#if defined(__NR_finit_module)
68 +# define finit_module(fd, uargs, flags) syscall(__NR_finit_module, fd, uargs, flags)
69 #endif
70 +#define delete_module(mod, flags) syscall(__NR_delete_module, mod, flags)
72 static module_entry *helper_get_module(module_db *db, const char *module, int create)
74 --
75 2.1.4