kernel/lib: Adjustments to use musl's ffs implementation.
This actually has another advantage: if we can use musl sources in the kernel POSIX support, then we can drop some of the BSD sources that are used only in the kernel and have a different implementation in userland (e.g. strtod) and have just one version for both.
This commit is contained in:
parent
0afb8a1b49
commit
0d29def7d2
@ -47,6 +47,14 @@ SEARCH_SOURCE += [ FDirName $(posixSources) time ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(posixSources) unistd ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(gnuSources) ] ;
|
||||
|
||||
local muslSources =
|
||||
ffs.c
|
||||
;
|
||||
|
||||
SourceHdrs $(muslSources) :
|
||||
[ FDirName $(posixSources) musl internal ]
|
||||
[ FDirName $(posixSources) musl arch $(TARGET_KERNEL_ARCH_DIR) ] ;
|
||||
|
||||
KernelMergeObject kernel_lib_posix.o :
|
||||
# main
|
||||
kernel_errno.cpp
|
||||
@ -99,7 +107,6 @@ KernelMergeObject kernel_lib_posix.o :
|
||||
usergroup.cpp
|
||||
write.c
|
||||
# string
|
||||
ffs.cpp
|
||||
memchr.c
|
||||
memcmp.c
|
||||
memmem.c
|
||||
@ -129,9 +136,12 @@ KernelMergeObject kernel_lib_posix.o :
|
||||
strupr.c
|
||||
stpcpy.c
|
||||
|
||||
$(muslSources)
|
||||
: $(TARGET_KERNEL_PIC_CCFLAGS)
|
||||
;
|
||||
|
||||
SEARCH on [ FGristFiles $(muslSources) ] += [ FDirName $(posixSources) musl misc ] ;
|
||||
|
||||
# misc
|
||||
|
||||
SEARCH_SOURCE = [ FDirName $(HAIKU_TOP) src kits support ] ;
|
||||
|
@ -2,7 +2,7 @@ SubDir HAIKU_TOP src system libroot posix musl misc ;
|
||||
|
||||
SubDirSysHdrs [ FDirName $(SUBDIR) .. include ] ;
|
||||
UseHeaders [ FDirName $(SUBDIR) .. internal ] ;
|
||||
UseHeaders [ FDirName $(SUBDIR) .. arch $(TARGET_KERNEL_ARCH_DIR) ] ;
|
||||
UseHeaders [ FDirName $(SUBDIR) .. arch $(TARGET_ARCH) ] ;
|
||||
|
||||
local architectureObject ;
|
||||
for architectureObject in [ MultiArchSubDirSetup ] {
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "atomic.h"
|
||||
|
||||
int ffs(int i);
|
||||
int ffs(int i)
|
||||
{
|
||||
return i ? a_ctz_l(i)+1 : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user