fxlibc - v1.4.3 : fix vhex missing headers

@update
> CMakeLists.txt
 | remove the generation of the shared version of the fxlibc (deprecated, unused)
> include/errno
 | add some error macros needed in vhex
> src/string/strerror
 | add EINTR support
 | add EAGAIN support
 | add ENOMEDIUM support
 | add EMEDIUMTYPE support

@fix
> include/target/vhex
 | add missing headers
This commit is contained in:
Yann MAGNIN 2022-07-30 17:57:08 +02:00
parent 619afe25da
commit bdf9566723
7 changed files with 57 additions and 13 deletions

View file

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.15)
project(FxLibc VERSION 1.4.1 LANGUAGES C ASM) project(FxLibc VERSION 1.4.3 LANGUAGES C ASM)
set(CMAKE_INSTALL_MESSAGE LAZY) set(CMAKE_INSTALL_MESSAGE LAZY)
@ -259,18 +259,6 @@ if(sh-generic IN_LIST TARGET_FOLDERS)
target_include_directories(fxlibc PRIVATE "${FXSDK_COMPILER_INSTALL}/include/openlibm") target_include_directories(fxlibc PRIVATE "${FXSDK_COMPILER_INSTALL}/include/openlibm")
endif() endif()
if(FXLIBC_SHARED)
target_compile_options(fxlibc PRIVATE -fPIC)
if("${FXLIBC_ARCH}" STREQUAL "sh")
# Original command: "ar qc <TARGET> <OBJECTS>; ranlib <TARGET>"
set(CMAKE_C_CREATE_STATIC_LIBRARY
"sh-elf-ld -shared <OBJECTS> -o <TARGET>")
else()
message(SEND_ERROR "TODO: Shared vhex on non-SuperH not available yet")
endif()
endif()
foreach(FOLDER IN LISTS TARGET_FOLDERS) foreach(FOLDER IN LISTS TARGET_FOLDERS)
target_include_directories(fxlibc PRIVATE include/target/${FOLDER}/) target_include_directories(fxlibc PRIVATE include/target/${FOLDER}/)
endforeach() endforeach()

View file

@ -28,6 +28,10 @@ extern int errno;
#define ENOTEMPTY 17 /* Directory is not empty. */ #define ENOTEMPTY 17 /* Directory is not empty. */
#define EINTR 18 /* Interrupted system call. */ #define EINTR 18 /* Interrupted system call. */
#define EAGAIN 19 /* Resource temporarily unavailable. */ #define EAGAIN 19 /* Resource temporarily unavailable. */
#define EIO 20 /* Input/Output error */
#define ENODEV 21 /* No such device */
#define ENOMEDIUM 22 /* No medium found */
#define EMEDIUMTYPE 23 /* Wrong medium type */
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -0,0 +1,7 @@
#ifndef __BITS_CONFNAME_H__
# define __BITS_CONFNAME_H__
#define _SC_PAGE_SIZE 0
#define _SC_PAGESIZE _SC_PAGE_SIZE
#endif /*__BITS_CONFNAME_H__*/

View file

@ -0,0 +1,8 @@
#ifndef __BITS_EXIT_H__
# define __BITS_EXIT_H__
/* Exit codes for CASIOWIN add-ins. */
#define EXIT_SUCCESS 1
#define EXIT_FAILURE 0
#endif /*__BITS_EXIT_H__*/

View file

@ -0,0 +1,20 @@
#ifndef __BITS_SIGNUM_H__
# define __BITS_SIGNUM_H__
// Define the number of signals
#define _NSIG 16
/* Fake signal functions. */
#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
/* ISO C99 signals. */
#define SIGINT 2 /* Interactive attention signal. */
#define SIGILL 4 /* Illegal instruction. */
#define SIGABRT 6 /* Abnormal termination. */
#define SIGFPE 8 /* Erroneous arithmetic operation. */
#define SIGSEGV 11 /* Invalid access to storage. */
#define SIGTERM 15 /* Termination request. */
#endif /*__BITS_SIGNUM_H__*/

View file

@ -0,0 +1,12 @@
#ifndef __BITS_TYPES_DIR_H__
# define __BITS_TYPES_DIR_H__
#include <stddef.h>
#include <stdint.h>
typedef struct {
/* Associated directory descriptor */
int fd;
} DIR;
#endif /*__BITS_TYPES_DIR_H__*/

View file

@ -20,6 +20,11 @@ static char *errno_strings [] = {
[EISDIR] = "Is a directory", [EISDIR] = "Is a directory",
[ENOTDIR] = "Not a directory", [ENOTDIR] = "Not a directory",
[ENOTEMPTY] = "Directory not empty", [ENOTEMPTY] = "Directory not empty",
[EINTR] = "Interrupted system call",
[EAGAIN] = "Resource temporarily unavailable",
[EIO] = "Input/output error",
[ENOMEDIUM] = "No medium found",
[EMEDIUMTYPE] = "Wrong medium type",
}; };
char *strerror(int e) char *strerror(int e)