diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2016-12-26 20:07:59 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-10 16:55:51 +0100 |
commit | add927e3d16414738ce46c28bb9d83e173848740 (patch) | |
tree | 90b2cb4cd2b7236f1c3417760e6de9bbf4dd5809 | |
parent | 7bcc3c46a7749226697e8b4a486edadcac4f1723 (diff) | |
download | busybox-w32-add927e3d16414738ce46c28bb9d83e173848740.tar.gz busybox-w32-add927e3d16414738ce46c28bb9d83e173848740.tar.bz2 busybox-w32-add927e3d16414738ce46c28bb9d83e173848740.zip |
modutils: remove special handling of uClibc
Commit 3a45b87ac36f (modutils: support finit_module syscall) introduced
macro finit_module. But it is not defined for uClibc.
The compilation for busybox fails for MIPS with:
With uClibc, we get following build errors:
modutils/lib.a(modutils.o): In function `bb_init_module':
modutils.c:(.text.bb_init_module+0x94): undefined reference to `finit_module'
modutils.c:(.text.bb_init_module+0xa0): undefined reference to `finit_module'
We can just use syscall() without any need for the
uClibc wrappers.
Newer versions of uClibc-ng (>1.0.20) will remove the
module syscall wrappers.
Found via Buildroot autobuilders:
http://autobuild.buildroot.net/results/556/55655daef23788fb3967f801ec8b79e9bed7122b/build-end.log
function old new delta
bb_delete_module 26 32 +6
bb_init_module 90 95 +5
delete_module 37 - -37
init_module 53 - -53
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 2/0 up/down: 11/-90) Total: -79 bytes
Reported-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | modutils/modprobe-small.c | 4 | ||||
-rw-r--r-- | modutils/modutils.c | 16 |
2 files changed, 8 insertions, 12 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c index 652ff4dfa..0fc9ea454 100644 --- a/modutils/modprobe-small.c +++ b/modutils/modprobe-small.c | |||
@@ -39,8 +39,8 @@ | |||
39 | #include <fnmatch.h> | 39 | #include <fnmatch.h> |
40 | #include <sys/syscall.h> | 40 | #include <sys/syscall.h> |
41 | 41 | ||
42 | extern int init_module(void *module, unsigned long len, const char *options); | 42 | #define init_module(mod, len, opts) syscall(__NR_init_module, mod, len, opts) |
43 | extern int delete_module(const char *module, unsigned flags); | 43 | #define delete_module(mod, flags) syscall(__NR_delete_module, mod, flags) |
44 | #ifdef __NR_finit_module | 44 | #ifdef __NR_finit_module |
45 | # define finit_module(fd, uargs, flags) syscall(__NR_finit_module, fd, uargs, flags) | 45 | # define finit_module(fd, uargs, flags) syscall(__NR_finit_module, fd, uargs, flags) |
46 | #endif | 46 | #endif |
diff --git a/modutils/modutils.c b/modutils/modutils.c index d36caaf68..4204f06fe 100644 --- a/modutils/modutils.c +++ b/modutils/modutils.c | |||
@@ -7,17 +7,13 @@ | |||
7 | */ | 7 | */ |
8 | #include "modutils.h" | 8 | #include "modutils.h" |
9 | 9 | ||
10 | #ifdef __UCLIBC__ | 10 | #include <sys/syscall.h> |
11 | extern int init_module(void *module, unsigned long len, const char *options); | 11 | |
12 | extern int delete_module(const char *module, unsigned int flags); | 12 | #define init_module(mod, len, opts) syscall(__NR_init_module, mod, len, opts) |
13 | #else | 13 | #if defined(__NR_finit_module) |
14 | # include <sys/syscall.h> | 14 | # define finit_module(fd, uargs, flags) syscall(__NR_finit_module, fd, uargs, flags) |
15 | # define init_module(mod, len, opts) syscall(__NR_init_module, mod, len, opts) | ||
16 | # if defined(__NR_finit_module) | ||
17 | # define finit_module(fd, uargs, flags) syscall(__NR_finit_module, fd, uargs, flags) | ||
18 | # endif | ||
19 | # define delete_module(mod, flags) syscall(__NR_delete_module, mod, flags) | ||
20 | #endif | 15 | #endif |
16 | #define delete_module(mod, flags) syscall(__NR_delete_module, mod, flags) | ||
21 | 17 | ||
22 | static module_entry *helper_get_module(module_db *db, const char *module, int create) | 18 | static module_entry *helper_get_module(module_db *db, const char *module, int create) |
23 | { | 19 | { |