forked from picolibc/picolibc
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tinystdio: added fgetpos and fsetpos files #10
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HanaMAshour
force-pushed
the
hanaa_fgetpos_fsetpos
branch
from
May 7, 2024 10:28
0412a25
to
67a423d
Compare
This file is just a wrapper for picolibc.h. Delete unnecessary references to newlib.h or picolibc.h and replace the remaining ones with sys/features.h as that defines all of the features the library supports, not just those defined by the build system. Signed-off-by: Keith Packard <[email protected]>
Make sure any .c file includes picolibc.h before testing build parameters. Signed-off-by: Keith Packard <[email protected]>
Make this match other asm source in the library, even though it doesn't strictly need to as it doesn't use any C preprocessor stuff. Signed-off-by: Keith Packard <[email protected]>
Remove C library-specific bits for glibc or picolibc as the code is just plain-old POSIX and doesn't need any magic. Signed-off-by: Keith Packard <[email protected]>
Make sure library feature test macros are defined before being used. Signed-off-by: Keith Packard <[email protected]>
This file includes the regular strftime implementation, which also defines _DEFAULT_SOURCE. Fix that by undefining before including. Signed-off-by: Keith Packard <[email protected]>
Tinystdio uses a bunch of feature macros before including any headers. Signed-off-by: Keith Packard <[email protected]>
Go through all of the machine-specific source code and make sure picolibc.h is included so that all of the feature test macros are set before being used. Signed-off-by: Keith Packard <[email protected]>
These come from glibc where various 64-bit explicit APIs are provided under the protection of _LARGEFILE64_SOURCE, which is defined by _GNU_SOURCE. Replace the __LARGE64_FILES stuff with these and then use _GNU_SOURCE where needed as that exposes these APIs. We could use _LARGEFILE64_SOURCE instead, but it seems better to just expose the GNU API instead. Signed-off-by: Keith Packard <[email protected]>
This sets up a sample interrupt vector to show how this works. Signed-off-by: Keith Packard <[email protected]>
This mirrors the existing __signbit and __signbitf functions and allows a complete implementation of the non-builtin signbit macro. Change the internal inline version name to signbitl_inline like the other similar functions. Signed-off-by: Keith Packard <[email protected]>
Make sure all functions are declared fully in header files before being defined or used. Signed-off-by: Keith Packard <[email protected]>
This was needed before all source files were fixed to ensure all feature test macros were defined before being used by including sys/features.h Signed-off-by: Keith Packard <[email protected]>
Exposes these when _POSIX_C_SOURCE >= 199309L: int getc_unlocked (FILE *); int getchar_unlocked (void); void flockfile (FILE *); int ftrylockfile (FILE *); void funlockfile (FILE *); int putc_unlocked (int, FILE *); int putchar_unlocked (int); The I/O functions don't do anything different as tinystdio doesn't have any locking at the top level APIs. Getting these to poke down inside the buffered layer would improve performance at a pretty significant cost in complexity. flockfile/funlockfile is implemented using the global libc lock. This should at least serialize threads which all use this API. ftrylockfile is the same as flockfile as there's no try-lock API to use. Signed-off-by: Keith Packard <[email protected]>
According to ISO/IEC 9899/1999 section 7.19.2: Streams before this change wide character input/output functions were applied to byte-oriented stream resulting in erroneous results handling wide characters input/output to/from files. Signed-off-by: Ahmed Shehab <[email protected]>
Added testcase that checks input/output wide-chars to/from a file. issue found by running SuperTest by Solid Sands Signed-off-by: Ahmed Shehab <[email protected]>
This fixes up the accelerated math functions and setjmp implementation to support aarch64 targets without an FPU via the aapcs-soft ABI specification. Signed-off-by: Keith Packard <[email protected]>
Soft float aarch64 targets also don't have the neon instructions necessary for all of the hand-written string functions. Signed-off-by: Keith Packard <[email protected]>
Clang has a bug where FLT_ROUNDS doesn't respect the ABI target and continues to access FPSR, causing a fault on hardware without an FPU. Hack around this by manually defining FLT_ROUNDS as 1 in this case. Signed-off-by: Keith Packard <[email protected]>
A couple of long double error handling paths weren't working for targets without exception support (aarch64 softfp) because they returned the wrong sign. Also make the /0 code path look like the 32- and 64- bit paths for symmetry. Signed-off-by: Keith Packard <[email protected]>
compiler-rt appears to have incorrect ieee support resulting in a slightly different answer for one jn computation. Signed-off-by: Keith Packard <[email protected]>
Check __ARM_FP compiler flag and if zero, the application is compiled in soft-float mode and cannot use the FPU. Signed-off-by: Keith Packard <[email protected]>
Check for either of atomic-ungetc or atomic-signal and only run the atomic test if at least one of them is enabled. Signed-off-by: Keith Packard <[email protected]>
Make sure -fno-stack-protector isn't mixed in with stack protector enable flags. Add -fno-stack-protector when not using it in tests. Signed-off-by: Keith Packard <[email protected]>
Instead of writing 64 bytes into a 16 byte temp, make the temp 48 bytes to avoid really trashing memory. Signed-off-by: Keith Packard <[email protected]>
This uses a custom llvm toolchain and compiler-rt runtime library to demonstrate running aarch64 without floating point. This should work on armv8-r as well, but there's no qemu model for that, so we're using armv8-a. Signed-off-by: Keith Packard <[email protected]>
Signed-off-by: Keith Packard <[email protected]>
added fgetpos.c and fsetpos.c files to resolve compilation error of: undefined symbol: fgetpos undefined symbol: fsetpos changed the prototype of these functions in the file stdio.h to match with the ISO/IEC 9899_1999 Signed-off-by: Hana Ashour <[email protected]>
keith-packard
force-pushed
the
hanaa_fgetpos_fsetpos
branch
from
June 30, 2024 00:06
67a423d
to
d3e49a4
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added fgetpos.c and fsetpos.c files to resolve compilation error of: undefined symbol: fgetpos
undefined symbol: fsetpos
Changed the prototype of these functions in the file stdio.h to match with the ISO/IEC 9899_1999