For architectures without ucontext implementation it is possible
to use libucontext with this small adaptation.
Signed-off-by: Waldemar Brodkorb <wbx(a)openadk.org>
---
include/ucontext.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/ucontext.h b/include/ucontext.h
index 4ce114ef1..76b4f375e 100644
--- a/include/ucontext.h
+++ b/include/ucontext.h
@@ -23,11 +23,11 @@
#include <features.h>
-#ifdef __UCLIBC_HAS_CONTEXT_FUNCS__
-
/* Get machine dependent definition of data structures. */
#include <sys/ucontext.h>
+#ifdef __UCLIBC_HAS_CONTEXT_FUNCS__
+
__BEGIN_DECLS
/* Get user context and store it in variable pointed to by UCP. */
--
2.30.2
The parameters are not used in the function variant without vdso
support, so tell this to the compiler to avoid a warning. Also fix the
indentation to be in-line with other functions in the file.
Signed-off-by: Marcus Haehnel <marcus.haehnel(a)kernkonzept.com>
---
ldso/ldso/dl-vdso.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ldso/ldso/dl-vdso.c b/ldso/ldso/dl-vdso.c
index 196cbbb3b..01309011d 100755
--- a/ldso/ldso/dl-vdso.c
+++ b/ldso/ldso/dl-vdso.c
@@ -28,14 +28,14 @@
#ifndef __VDSO_SUPPORT__
- void load_vdso(void *sys_info_ehdr, char **envp ){
+void load_vdso( void *sys_info_ehdr attribute_unused,
+ char **envp attribute_unused ){
#ifdef __SUPPORT_LD_DEBUG__
- if ( _dl_debug_vdso != 0 ){
- _dl_dprintf(2,"_dl_vdso support not enabled\n" );
- }
-
-#endif
+ if ( _dl_debug_vdso != 0 ){
+ _dl_dprintf(2,"_dl_vdso support not enabled\n" );
}
+#endif
+}
#else
void *_dl__vdso_gettimeofday = 0;
--
2.45.2
GCC-14 requires all functions to have an explicit return type.
An implicit return type is no longer supported. main() in the ncurses
link check was declared without return type. Add it to make this work
on GCC-14.
See also: https://gcc.gnu.org/gcc-14/porting_to.html
Signed-off-by: Marcus Haehnel <marcus.haehnel(a)kernkonzept.com>
---
extra/config/lxdialog/check-lxdialog.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/extra/config/lxdialog/check-lxdialog.sh b/extra/config/lxdialog/check-lxdialog.sh
index 9d2a4c585..66bfcb549 100644
--- a/extra/config/lxdialog/check-lxdialog.sh
+++ b/extra/config/lxdialog/check-lxdialog.sh
@@ -43,7 +43,7 @@ trap "rm -f $tmp" 0 1 2 3 15
check() {
$cc -x c - -o $tmp 2>/dev/null <<'EOF'
#include CURSES_LOC
-main() {}
+int main() {}
EOF
if [ $? != 0 ]; then
echo " *** Unable to find the ncurses libraries or the" 1>&2
--
2.45.2
From: Marcus Hähnel <marcus.haehnel(a)kernkonzept.com>
Clang also supports the gnu_inline attribute and the
__GNUC_STDC_INLINE__ macro (C99 semantics). However, it reports as
GCC 4.2 compatible (__GNUC_MINOR__ / __GNUC__) and thus the current
defines do not think it can support this.
Add clang as an alternative for this support. Documentation shows that
this attribute is supported since at least Clang 8.
Signed-off-by: Marcus Haehnel <marcus.haehnel(a)kernkonzept.com>
---
include/sys/cdefs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index 9b3a02177..656548c52 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -320,7 +320,7 @@
inline semantics, unless -fgnu89-inline is used.
For -std=gnu99, forcing gnu_inline attribute does not change behavior,
but may silence spurious warnings (such as in GCC 4.2). */
-#if !defined __cplusplus || __GNUC_PREREQ (4,3)
+#if !defined __cplusplus || __GNUC_PREREQ (4,3) || __CLANG_PREREQ(8,0)
# if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ || defined __cplusplus
# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
# if __GNUC_PREREQ (4,3)
--
2.45.2
This can be used to guard fatures for specific clang versions.
Signed-off-by: Marcus Haehnel <marcus.haehnel(a)kernkonzept.com>
---
include/features.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/features.h b/include/features.h
index b5d4e79f2..1a4efb9db 100644
--- a/include/features.h
+++ b/include/features.h
@@ -140,6 +140,18 @@
# define __GNUC_PREREQ(maj, min) 0
#endif
+/* Convenience macro to test the version of clang.
+ Use like this:
+ #if __CLANG_PREREQ(3,2)
+ ... code requiring clang 3.2 or later ...
+ #endif */
+#if defined __clang__
+# define __CLANG_PREREQ(maj, min) \
+ ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
+#else
+# define __CLANG_PREREQ(maj, min) 0
+#endif
+
/* Whether to use feature set F. */
#define __GLIBC_USE(F) __GLIBC_USE_ ## F
--
2.45.2
From: Yann Le Du <yann.le.du(a)kernkonzept.com>
The existing limit of 20 was found to be insufficient when moving from
gcc 8 to gcc 9. At the time a test ran already 16 handlers had been
installed leaving only minimal room for application installed handlers.
Musl uses 32, as does newlib. Further, the ISO C standard for C99
specifies that:
The implementation shall support the registration of at least
32 functions.
(7.20.4.2 The atexit function)
Co-authored-by: Yann Le Du <yann.le.du(a)kernkonzept.com>
Signed-off-by: Marcus Haehnel <marcus.haehnel(a)kernkonzept.com>
---
include/stdlib.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/stdlib.h b/include/stdlib.h
index 8b1375184..d4e0b75e7 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -606,7 +606,7 @@ libc_hidden_proto(unsetenv)
#ifdef __UCLIBC_DYNAMIC_ATEXIT__
# define __UCLIBC_MAX_ATEXIT INT_MAX
#else
-# define __UCLIBC_MAX_ATEXIT 20
+# define __UCLIBC_MAX_ATEXIT 32
#endif
--
2.45.2
Make two implicit casts from double to int explicit to silence compiler
warnings about them. The casts are required during the computation of
exponentiation.
Co-authored-by: Sven Linker <sven.linker(a)kernkonzept.com>
Signed-off-by: Marcus Haehnel <marcus.haehnel(a)kernkonzept.com>
---
libm/e_exp.c | 2 +-
libm/s_expm1.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libm/e_exp.c b/libm/e_exp.c
index ffa556120..f694f67d1 100644
--- a/libm/e_exp.c
+++ b/libm/e_exp.c
@@ -126,7 +126,7 @@ double __ieee754_exp(double x) /* default IEEE double exp */
if(hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */
hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb;
} else {
- k = invln2*x+halF[xsb];
+ k = (int32_t)(invln2*x+halF[xsb]);
t = k;
hi = x - t*ln2HI[0]; /* t*ln2HI is exact here */
lo = t*ln2LO[0];
diff --git a/libm/s_expm1.c b/libm/s_expm1.c
index 8e51ae748..85defefa4 100644
--- a/libm/s_expm1.c
+++ b/libm/s_expm1.c
@@ -159,7 +159,7 @@ double expm1(double x)
else
{hi = x + ln2_hi; lo = -ln2_lo; k = -1;}
} else {
- k = invln2*x+((xsb==0)?0.5:-0.5);
+ k = (int32_t)(invln2*x+((xsb==0)?0.5:-0.5));
t = k;
hi = x - t*ln2_hi; /* t*ln2_hi is exact here */
lo = t*ln2_lo;
--
2.45.2