===================================================================
--- recipe/files/gcc/libunixlib/include/features.h (revision 7721)
+++ recipe/files/gcc/libunixlib/include/features.h (working copy)
@@ -30,6 +30,7 @@
__STRICT_ANSI__ ISO Standard C.
_ISOC99_SOURCE Extensions to ISO C89 from ISO C99.
+ _ISOC11_SOURCE Extensions to ISO C99 from ISO C11.
_POSIX_SOURCE IEEE Std 1003.1.
_POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
if >=199309L, add IEEE Std 1003.1b-1993;
@@ -62,8 +63,10 @@
These are defined by this file and are used by the
header files to decide what to declare or define:
+ __USE_ISOC11 Define ISO C11 things.
__USE_ISOC99 Define ISO C99 things.
__USE_ISOC95 Define ISO C90 AMD1 (C95) things.
+ __USE_ISOCXX11 Define ISO C++11 things.
__USE_POSIX Define IEEE Std 1003.1 things.
__USE_POSIX2 Define IEEE Std 1003.2 things.
__USE_POSIX199309 Define IEEE Std 1003.1, and .1b things.
@@ -98,8 +101,10 @@
/* Undefine everything, so we get a clean slate. */
+#undef __USE_ISOC11
#undef __USE_ISOC99
#undef __USE_ISOC95
+#undef __USE_ISOCXX11
#undef __USE_POSIX
#undef __USE_POSIX2
#undef __USE_POSIX199309
@@ -158,6 +163,8 @@
#ifdef _GNU_SOURCE
# undef _ISOC99_SOURCE
# define _ISOC99_SOURCE 1
+# undef _ISOC11_SOURCE
+# define _ISOC11_SOURCE 1
# undef _POSIX_SOURCE
# define _POSIX_SOURCE 1
# undef _POSIX_C_SOURCE
@@ -178,7 +185,8 @@
/* If nothing (other than _GNU_SOURCE) is defined,
define _BSD_SOURCE and _SVID_SOURCE. */
-#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
+#if (!defined __STRICT_ANSI__ && \
+ !defined _ISOC99_SOURCE && !defined _ISOC11_SOURCE && \
!defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
!defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
!defined _BSD_SOURCE && !defined _SVID_SOURCE)
@@ -186,21 +194,40 @@
# define _SVID_SOURCE 1
#endif
+/* This is to enable the ISO C11 extension. */
+#if (defined _ISOC11_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
+# define __USE_ISOC11 1
+#endif
+
/* This is to enable the ISO C99 extension. Also recognize the old macro
which was used prior to the standard acceptance. This macro will
eventually go away and the features enabled by default once the ISO C99
standard is widely adopted. */
-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE || defined _ISOC11_SOURCE \
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
# define __USE_ISOC99 1
#endif
/* This is to enable the ISO C90 Amendment 1:1995 extension. */
-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE || defined _ISOC11_SOURCE \
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L))
# define __USE_ISOC95 1
#endif
+#ifdef __cplusplus
+/* This is to enable compatibility for ISO C++17. */
+# if __cplusplus >= 201703L
+# define __USE_ISOC11 1
+# endif
+/* This is to enable compatibility for ISO C++11.
+ Check the temporary macro for now, too. */
+# if __cplusplus >= 201103L || defined __GXX_EXPERIMENTAL_CXX0X__
+# define __USE_ISOCXX11 1
+# define __USE_ISOC99 1
+# endif
+#endif
+
/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
(and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */
#if ((!defined __STRICT_ANSI__ || (_XOPEN_SOURCE - 0) >= 500) && \
Index: recipe/files/gcc/libunixlib/include/stdlib.h
===================================================================
--- recipe/files/gcc/libunixlib/include/stdlib.h (revision 7721)
+++ recipe/files/gcc/libunixlib/include/stdlib.h (working copy)
@@ -71,6 +71,20 @@
extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
__END_NAMESPACE_STD
+#if defined __USE_ISOC11 || defined __USE_ISOCXX11
+# ifdef __TARGET_SCL__
+__BEGIN_NAMESPACE_C11
+/* Register a function to be called when `quick_exit' is called. */
+extern int at_quick_exit (void (*__func) (void)) __THROW __nonnull ((1));
+
+/* Call all functions registered with `at_quick_exit' in the reverse
+ of the order in which they were registered and terminate program
+ execution with STATUS. */
+extern void quick_exit (int __status) __THROW __attribute__ ((__noreturn__));
+__END_NAMESPACE_C11
+# endif
+#endif
+
#ifdef __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Terminate the program with status. Don't call any functions
@@ -181,6 +195,17 @@
# endif
#endif
+#ifdef __USE_ISOC11
+# ifdef __TARGET_SCL__
+__BEGIN_NAMESPACE_C11
+/* ISO C variant of aligned allocation. */
+extern void *aligned_alloc (size_t __alignment, size_t __size)
+ __THROW __attribute_malloc__ __attribute_alloc_align__ ((1))
+ __attribute_alloc_size__ ((2)) __wur;
+__END_NAMESPACE_C11
+# endif
+#endif
+
#ifndef __TARGET_SCL__
extern void *memalign (size_t __alignment,
size_t __bytes) __THROW __attribute_malloc__ __wur;
Index: recipe/files/gcc/libunixlib/include/sys/cdefs.h
===================================================================
--- recipe/files/gcc/libunixlib/include/sys/cdefs.h (revision 7721)
+++ recipe/files/gcc/libunixlib/include/sys/cdefs.h (working copy)
@@ -114,6 +114,9 @@
# define __BEGIN_NAMESPACE_C99 namespace __c99 {
# define __END_NAMESPACE_C99 }
# define __USING_NAMESPACE_C99(name) using __c99::name;
+# define __BEGIN_NAMESPACE_C11 namespace __c11 {
+# define __END_NAMESPACE_C11 }
+# define __USING_NAMESPACE_C11(name) using __c11::name;
#else
/* For compatibility we do not add the declarations into any
namespace. They will end up in the global namespace which is what
@@ -124,6 +127,9 @@
# define __BEGIN_NAMESPACE_C99
# define __END_NAMESPACE_C99
# define __USING_NAMESPACE_C99(name)
+# define __BEGIN_NAMESPACE_C11
+# define __END_NAMESPACE_C11
+# define __USING_NAMESPACE_C11(name)
#endif
@@ -216,6 +222,24 @@
# define __attribute_malloc__ /* Ignore */
#endif
+/* Tell the compiler which arguments to an allocation function
+ indicate the size of the allocation. */
+#if __GNUC_PREREQ (4, 3)
+# define __attribute_alloc_size__(params) \
+ __attribute__ ((__alloc_size__ params))
+#else
+# define __attribute_alloc_size__(params) /* Ignore. */
+#endif
+
+/* Tell the compiler which argument to an allocation function
+ indicates the alignment of the allocation. */
+#if __GNUC_PREREQ (4, 9)
+# define __attribute_alloc_align__(param) \
+ __attribute__ ((__alloc_align__ param))
+#else
+# define __attribute_alloc_align__(param) /* Ignore. */
+#endif
+
/* At some point during the gcc 2.96 development the `pure' attribute
for functions was introduced. We don't want to use it unconditionally
(although this would be possible) since it generates warnings. */
Index: recipe/files/gcc/libunixlib/include/time.h
===================================================================
--- recipe/files/gcc/libunixlib/include/time.h (revision 7721)
+++ recipe/files/gcc/libunixlib/include/time.h (working copy)
@@ -63,12 +63,12 @@
#if !defined __timespec_defined && defined __need_timespec
#define __timespec_defined 1
-
+#include <unixlib/types.h>
/* POSIX.1b structure for a time value. This is like a `struct timeval' but
has nanoseconds instead of microseconds. */
struct timespec
{
- long int tv_sec; /* Seconds. */
+ __time_t tv_sec; /* Seconds. */
long int tv_nsec; /* Nanoseconds. */
};
#endif
@@ -89,6 +89,11 @@
/* Obsolete name for CLOCKS_PER_SEC. */
#define CLK_TCK CLOCKS_PER_SEC
+#ifdef __USE_ISOC11
+/* Time base values for timespec_get. */
+# define TIME_UTC 1
+#endif
+
__BEGIN_NAMESPACE_STD
/* Return the elapsed processor time. */
@@ -171,8 +176,6 @@
#endif
-/* C99 Additions. */
-
#ifdef __USE_POSIX199309
/* Identifier for system-wide realtime clock. */
@@ -205,6 +208,16 @@
#endif
#endif
+/* C11 Additions. */
+
+#ifdef __USE_ISOC11
+# ifdef __TARGET_SCL__
+/* Set TS to calendar time based in time base BASE. */
+extern int timespec_get (struct timespec *__ts, int __base)
+ __THROW __nonnull ((1));
+# endif
+#endif
+
/* System V compatibility. */
# if defined __USE_SVID || defined __USE_XOPEN
Index: recipe/files/gcc/libunixlib/scl/chunkid05.s
===================================================================
--- recipe/files/gcc/libunixlib/scl/chunkid05.s (revision 7721)
+++ recipe/files/gcc/libunixlib/scl/chunkid05.s (working copy)
@@ -572,8 +572,7 @@
@ Entry 71
@ Inverse hyperbolic cosine function
@ float acoshf (float x);
- @ Implemented in scl_acoshf.s
- MOV PC, #0
+ MOV PC, #0 @ FIXME
@ Entry 72
@ Inverse hyperbolic sine function
@@ -585,8 +584,7 @@
@ Entry 73
@ Inverse hyperbolic sine function
@ float asinhf (float x);
- @ Implemented in scl_sinhf.s
- MOV PC, #0
+ MOV PC, #0 @ FIXME
@ Entry 74
@ Inverse hyperbolic tangent function
@@ -1091,6 +1089,37 @@
@ with #define _LARGEFILE64_SOURCE
DefSCLFnc tmpfile64
+ @ Entry
+ @ void *aligned_alloc(size_t, size_t);
+ DefSCLFnc aligned_alloc
+
+ @ Entry
+ @ int at_quick_exit(void (*)(void));
+ DefSCLFnc at_quick_exit
+
+ @ Entry
+ @ void quick_exit (int);
+ DefSCLFnc quick_exit
+
+ @ Entry
+ @ int timespec_get (struct timespec *, int);
+ DefSCLFnc timespec_get
+
+ @ Entry
+ @ float coshf (float x);
+ @ Implemented in scl_coshf.s
+ MOV PC, #0
+
+ @ Entry
+ @ float sinhf (float x);
+ @ Implemented in scl_coshf.s
+ MOV PC, #0
+
+ @ Entry
+ @ float tanhf (float x);
+ @ Implemented in scl_tanhf.s
+ MOV PC, #0
+
extra_vectors_end:
.space extra_vectors_end - extra_vectors_begin
.size extra_vectors, . - extra_vectors
Index: recipe/files/gcc/libunixlib/scl/scl_coshf.s
===================================================================
--- recipe/files/gcc/libunixlib/scl/scl_coshf.s (revision 7721)
+++ recipe/files/gcc/libunixlib/scl/scl_coshf.s (working copy)
@@ -4,6 +4,9 @@
@ Only suited for APCS-32 linking (SharedCLibrary 5) with code compiled
@ with GCCSDK 4.x.
+@ Note that this function was absent from the stubs prior to
+@ SharedCLibrary 6.09.
+
#include "internal/elf-macros.s"
#include "internal/scl-macros.s"
Index: recipe/files/gcc/libunixlib/scl/scl_sinhf.s
===================================================================
--- recipe/files/gcc/libunixlib/scl/scl_sinhf.s (revision 7721)
+++ recipe/files/gcc/libunixlib/scl/scl_sinhf.s (working copy)
@@ -4,6 +4,9 @@
@ Only suited for APCS-32 linking (SharedCLibrary 5) with code compiled
@ with GCCSDK 4.x.
+@ Note that this function was absent from the stubs prior to
+@ SharedCLibrary 6.09.
+
#include "internal/elf-macros.s"
#include "internal/scl-macros.s"
Index: recipe/files/gcc/libunixlib/scl/scl_tanhf.s
===================================================================
--- recipe/files/gcc/libunixlib/scl/scl_tanhf.s (revision 7721)
+++ recipe/files/gcc/libunixlib/scl/scl_tanhf.s (working copy)
@@ -4,6 +4,9 @@
@ Only suited for APCS-32 linking (SharedCLibrary 5) with code compiled
@ with GCCSDK 4.x.
+@ Note that this function was absent from the stubs prior to
+@ SharedCLibrary 6.09.
+
#include "internal/elf-macros.s"
#include "internal/scl-macros.s"
Hi
I've attached a patch that provides the following functions that were added in SharedCLibrary 6.05: (https://gitlab.riscosopen.org/RiscOS/Sources/Lib/RISC_OSLib/-/commit/eef62ec858c7b1eb7c23fdae6215e13484a429ab)
aligned_alloc
at_quick_exit
quick_exit
timespec_get
It also acknowledges the addition of the following functions in SharedCLibrary 6.09 (https://gitlab.riscosopen.org/RiscOS/Sources/Lib/RISC_OSLib/-/commit/9297c9e44aeb87e024567d3b3455e15efd20b926), although all three of them were already supported as statically linked functions in FPA builds:
coshf
sinhf
tanhf
aligned_alloc
at_quick_exit
quick_exit
timespec_get
It also acknowledges the addition of the following functions in SharedCLibrary 6.09 (https://gitlab.riscosopen.org/RiscOS/Sources/Lib/RISC_OSLib/-/commit/9297c9e44aeb87e024567d3b3455e15efd20b926), although all three of them were already supported as statically linked functions in FPA builds:
coshf
sinhf
tanhf
The patch doesn't implement the functions in UnixLib builds, doesn't include any of the atomic functions that were added in SharedCLibrary 6.14, and it doesn't do any additional version checks, so it'll crash if the new functions are called with an older version of SharedCLibrary.
Regards
Cameron
No comments:
Post a Comment