klibc-bot for H. Peter Anvin
2015-Nov-05 22:24 UTC
[klibc] [klibc:master] Inline __arch_libcinit()
Commit-ID: bc18ea796db39b8d3575948b3d0de28daee38261 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=bc18ea796db39b8d3575948b3d0de28daee38261 Author: H. Peter Anvin <hpa at zytor.com> AuthorDate: Thu, 5 Nov 2015 08:52:33 -0800 Committer: H. Peter Anvin <hpa at zytor.com> CommitDate: Thu, 5 Nov 2015 14:22:01 -0800 [klibc] Inline __arch_libcinit() __arch_libcinit() is only ever used as part of __libc_init(), so we might as well make it an inline function. Signed-off-by: H. Peter Anvin <hpa at zytor.com> --- scripts/Kbuild.klibc.include | 11 +++++++++++ usr/include/arch/i386/klibc/archconfig.h | 2 +- .../i386/archinit.c => include/arch/i386/klibc/archinit.h} | 4 ++-- usr/include/klibc/sysconfig.h | 2 +- usr/klibc/arch/i386/Kbuild | 2 +- usr/klibc/libc_init.c | 7 ++++++- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/scripts/Kbuild.klibc.include b/scripts/Kbuild.klibc.include new file mode 100644 index 0000000..b317286 --- /dev/null +++ b/scripts/Kbuild.klibc.include @@ -0,0 +1,11 @@ + +# klibc-cc-option +# Usage: cflags-y += $(call klibc-cc-option,-march=winchip-c6,-march=i586) + +klibc-cc-option = $(call try-run,\ + $(CC) $(KLIBCCPPFLAGS) $(KLIBCCFLAGS) $(1) -c -xc /dev/null -o "$$TMP",$(1),$(2)) + +# klibc-cc-option-yn +# Usage: flag := $(call klibc-cc-option-yn,-march=winchip-c6) +klibc-cc-option-yn = $(call try-run,\ + $(CC) $(KLIBCCPPFLAGS) $(KLIBCCFLAGS) $(1) -c -xc /dev/null -o "$$TMP",y,n) diff --git a/usr/include/arch/i386/klibc/archconfig.h b/usr/include/arch/i386/klibc/archconfig.h index d8db763..f070f5b 100644 --- a/usr/include/arch/i386/klibc/archconfig.h +++ b/usr/include/arch/i386/klibc/archconfig.h @@ -12,7 +12,7 @@ /* The i386 <asm/signal.h> is still not clean enough for this... */ #define _KLIBC_USE_RT_SIG 0 -/* We have __libc_arch_init() */ +/* We have klibc/archinit.h and __libc_archinit() */ #define _KLIBC_HAS_ARCHINIT 1 #endif /* _KLIBC_ARCHCONFIG_H */ diff --git a/usr/klibc/arch/i386/archinit.c b/usr/include/arch/i386/klibc/archinit.h similarity index 78% rename from usr/klibc/arch/i386/archinit.c rename to usr/include/arch/i386/klibc/archinit.h index 111d130..8995ebf 100644 --- a/usr/klibc/arch/i386/archinit.c +++ b/usr/include/arch/i386/klibc/archinit.h @@ -1,5 +1,5 @@ /* - * arch/i386/archinit.c + * arch/i386/include/klibc/archinit.h * * Architecture-specific libc initialization */ @@ -11,7 +11,7 @@ extern void (*__syscall_entry)(int, ...); -void __libc_archinit(void) +static inline void __libc_archinit(void) { if (__auxval[AT_SYSINFO]) __syscall_entry = (void (*)(int, ...)) __auxval[AT_SYSINFO]; diff --git a/usr/include/klibc/sysconfig.h b/usr/include/klibc/sysconfig.h index ab947c0..c91d5b8 100644 --- a/usr/include/klibc/sysconfig.h +++ b/usr/include/klibc/sysconfig.h @@ -219,7 +219,7 @@ /* * _KLIBC_HAS_ARCHINIT * - * This architecture uses __libc_archinit() + * This architecture has klibc/archinit.h and __libc_archinit() */ #ifndef _KLIBC_HAS_ARCHINIT # define _KLIBC_HAS_ARCHINIT 0 diff --git a/usr/klibc/arch/i386/Kbuild b/usr/klibc/arch/i386/Kbuild index 1642374..edc7b3c 100644 --- a/usr/klibc/arch/i386/Kbuild +++ b/usr/klibc/arch/i386/Kbuild @@ -2,7 +2,7 @@ # klibc .o files for i386 # -klib-y := archinit.o socketcall.o setjmp.o syscall.o varsyscall.o +klib-y := socketcall.o setjmp.o syscall.o varsyscall.o klib-y += open.o openat.o vfork.o klib-y += libgcc/__ashldi3.o libgcc/__ashrdi3.o libgcc/__lshrdi3.o klib-y += libgcc/__muldi3.o libgcc/__negdi2.o diff --git a/usr/klibc/libc_init.c b/usr/klibc/libc_init.c index c54d022..c5b9bab 100644 --- a/usr/klibc/libc_init.c +++ b/usr/klibc/libc_init.c @@ -28,6 +28,12 @@ #include <klibc/sysconfig.h> #include "atexit.h" +#if _KLIBC_HAS_ARCHINIT +# include "klibc/archinit.h" +#else +# define __libc_archinit() ((void)0) +#endif + /* This file is included from __static_init.c or __shared_init.c */ #ifndef SHARED # error "SHARED should be defined to 0 or 1" @@ -42,7 +48,6 @@ struct auxentry { }; extern void __libc_init_stdio(void); -extern void __libc_archinit(void); unsigned long __auxval[_AUXVAL_MAX];
Maybe Matching Threads
- [klibc:master] Move architecture-specific initialization to arch/
- [klibc:master] i386: use the vdso for system calls on i386
- [klibc:master] auxv: convert auxiliary vector into an array; define getauxval()
- [klibc:master] i386: remove special handling of socketcall
- [klibc 24/43] i386 support for klibc