hrev56174 adds 2 changesets to branch 'master'
old head: 0afb8a1b494ba36c5effd3430240b8e9439076c7
new head: 3b4737b9e511bd2fb595eea1fd33c28e7e2b2add
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=3b4737b9e511+%5E0afb8a1b494b
----------------------------------------------------------------------------
0d29def7d21d: 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.
3b4737b9e511: headers: Remove bsd_mem.h.
This is a holdover from BeOS. All the functions in here we declare
in other headers, so this is not needed.
[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]
----------------------------------------------------------------------------
4 files changed, 13 insertions(+), 36 deletions(-)
headers/posix/bsd_mem.h | 34 --------------------------
src/system/kernel/lib/Jamfile | 12 ++++++++-
src/system/libroot/posix/musl/misc/Jamfile | 2 +-
src/system/libroot/posix/musl/misc/ffs.c | 1 +
############################################################################
Commit: 0d29def7d21d6f926addd41d836f7726d747e0bf
URL: https://git.haiku-os.org/haiku/commit/?id=0d29def7d21d
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Thu Jun 9 22:29:33 2022 UTC
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.
----------------------------------------------------------------------------
diff --git a/src/system/kernel/lib/Jamfile b/src/system/kernel/lib/Jamfile
index 3591b3afa9..0d5f7ffcd6 100644
--- a/src/system/kernel/lib/Jamfile
+++ b/src/system/kernel/lib/Jamfile
@@ -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 ] ;
diff --git a/src/system/libroot/posix/musl/misc/Jamfile
b/src/system/libroot/posix/musl/misc/Jamfile
index 4a4d7fb998..afa139f6c3 100644
--- a/src/system/libroot/posix/musl/misc/Jamfile
+++ b/src/system/libroot/posix/musl/misc/Jamfile
@@ -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 ] {
diff --git a/src/system/libroot/posix/musl/misc/ffs.c
b/src/system/libroot/posix/musl/misc/ffs.c
index 240b3a101d..a202a48ac6 100644
--- a/src/system/libroot/posix/musl/misc/ffs.c
+++ b/src/system/libroot/posix/musl/misc/ffs.c
@@ -1,5 +1,6 @@
#include "atomic.h"
+int ffs(int i);
int ffs(int i)
{
return i ? a_ctz_l(i)+1 : 0;
############################################################################
Revision: hrev56174
Commit: 3b4737b9e511bd2fb595eea1fd33c28e7e2b2add
URL: https://git.haiku-os.org/haiku/commit/?id=3b4737b9e511
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Thu Jun 9 22:31:08 2022 UTC
headers: Remove bsd_mem.h.
This is a holdover from BeOS. All the functions in here we declare
in other headers, so this is not needed.
----------------------------------------------------------------------------
diff --git a/headers/posix/bsd_mem.h b/headers/posix/bsd_mem.h
deleted file mode 100644
index a0e773cbee..0000000000
--- a/headers/posix/bsd_mem.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2005-2012 Haiku, Inc. All Rights Reserved.
- * Distributed under the terms of the MIT License.
- */
-
-/*
- Make life easier for those porting old Berkeley style
- code...
-*/
-#ifndef _BSD_MEM_H_
-#define _BSD_MEM_H_
-
-#ifndef USG /* when this is defined, these aren't needed */
-
-#ifndef bcopy
-#define bcopy(s, d, l) memmove(d, s, l)
-#endif
-#ifndef bzero
-#define bzero(s, l) memset(s, 0, l)
-#endif
-#ifndef bcmp
-#define bcmp(a, b, len) memcmp(a, b, len)
-#endif
-
-#ifndef index
-#define index(str, chr) strchr(str, chr)
-#endif
-#ifndef rindex
-#define rindex(str, chr) strrchr(str, chr)
-#endif
-
-#endif /* USG */
-
-#endif /* _BSD_MEM_H_ */