Fix installation / uninstallation rules + Fix compilation ABI support

This commit is contained in:
Yatis 2020-11-03 15:15:01 +01:00
parent 6fa1e2498d
commit f76757ecd2
78 changed files with 80 additions and 74 deletions

View File

@ -1 +0,0 @@
#include <asm/unistd_32.h>

View File

@ -0,0 +1 @@
#include <fxlibc/asm/unistd_32.h>

View File

@ -3,11 +3,11 @@
// ABI redirection
#if defined(__SUPPORT_VHEX_KERNEL)
# include <arch/vhex/unistd_32.h>
# include <fxlibc/arch/vhex/unistd_32.h>
#elif defined(__SUPPORT_CASIO_ABI_FX9860G)
# include <arch/fx9860g/unistd_32.h>
# include <fxlibc/arch/fx9860g/unistd_32.h>
#elif defined(__SUPPORT_CASIO_ABI_FXCG50)
# include <arch/fxcg50/unistd_32.h>
# include <fxlibc/arch/fxcg50/unistd_32.h>
#endif
#endif /*__ASM_UNISTD_32_H__*/

View File

@ -3,7 +3,8 @@
#include <stdint.h>
#include <stddef.h>
#include <sys/types.h>
#include <fxlibc/sys/types.h>
//---
// TODO: VFS abstraction ? or ABI-spesific abstraction ?

View File

@ -5,7 +5,7 @@
#include <stdint.h>
/* Get '__jmp_buf' */
#include <bits/setjmp.h>
#include <fxlibc/bits/setjmp.h>
/* User jmp_buf alias */
typedef struct __jmp_buf jmp_buf[1];

View File

@ -3,7 +3,8 @@
#include <stddef.h>
#include <stdint.h>
#include <bits/signum.h>
#include <fxlibc/bits/signum.h>
/* Type of signal set */
typedef uint32_t sigset_t;

View File

@ -0,0 +1 @@
#include <fxlibc/signal.h>

View File

@ -6,13 +6,13 @@
** But instead of duplicating this we use the information available
** from the kernel sources.
*/
#include <asm/unistd.h>
#include <fxlibc/asm/unistd.h>
/*
** The Linux kernel header file defines macros __NR_*, but some
** programs expect the traditional form SYS_*. <bits/syscall.h>
** defines SYS_* macros for __NR_* macros of known names.
*/
#include <bits/syscall.h>
#include <fxlibc/bits/syscall.h>
#endif

View File

@ -9,10 +9,10 @@
** This will define the `W*' macros for the flag bits to `waitpid', `wait3',
** and `wait4'.
*/
#include <bits/waitflags.h>
#include <fxlibc/bits/waitflags.h>
/* This will define all the `__W*' macros.*/
#include <bits/waitstatus.h>
#include <fxlibc/bits/waitstatus.h>
/* Macros for the `waitpid`'s wstatus argument. */
#define WEXITSTATUS(status) __WEXITSTATUS(status)

1
include/fxlibc/syscall.h Normal file
View File

@ -0,0 +1 @@
#include <fxlibc/sys/syscall.h>

View File

@ -3,7 +3,8 @@
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#include <fxlibc/sys/types.h>
//---
// Process part
@ -86,7 +87,7 @@ extern int close(int __fd);
** the `_SC_*' symbols for the NAME argument to `sysconf'; and the `_CS_*'
** symbols for the NAME argument to `confstr'.
*/
#include <bits/confname.h>
#include <fxlibc/bits/confname.h>
/* Get the value of the system variable NAME. */
extern long int sysconf(int __name);

View File

@ -1 +0,0 @@
#include <signal.h>

View File

@ -1 +0,0 @@
#include <sys/syscall.h>

View File

@ -35,7 +35,7 @@
#---
MAJOR := 0
MINOR := 3
PATCH := 5
PATCH := 6
EXTRAVERSION :=
@ -140,9 +140,9 @@ endif
# add custom project-specific flags based on the target ABI
ifeq ($1,fxlibc-vhex)
lib-cflags += -D __SUPPORT_VHEX_KERNEL
else ifeq ($1,fxlibc-casio-abi-fx9860g)
else ifeq ($1,fxlibc-fx9860g)
lib-cflags += -D __SUPPORT_CASIO_ABI_FX9860G
else ifeq ($1,fxlibc-casio-abi-fxcf50)
else ifeq ($1,fxlibc-fxcf50)
lib-cflags += -D __SUPPORT_CASIO_ABI_FXCG50
endif
@ -235,7 +235,11 @@ $(foreach libs,$(lib-generation-rules),$(eval \
))
# Generate the path where include directory will be installed.
lib-install-header-dir := $(CONFIG.PREFIX)include/fxlibc
lib-install-header-dir := $(CONFIG.PREFIX)include/
ifeq ($(wildcard $(lib-install-header-dir)fxlibc/.*),)
lib-install-header-dir := $(lib-install-header-dir)fxlibc
endif
@ -244,11 +248,10 @@ lib-install-header-dir := $(CONFIG.PREFIX)include/fxlibc
# Installation rules
#---
install: $(lib-generation-rules) $(lib-installation-rules)
rm -rf $(lib-install-header-dir)
cp -r ../include $(lib-install-header-dir)
cp -r ../include/fxlibc/ $(lib-install-header-dir)
uninstall: $(lib-uninstallation-rules)
rm -rf $(lib-install-header-dir)
rm -rf $(CONFIG.PREFIX)include/fxlibc

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd_32.h>
.text
.global _open
.type _open, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd_32.h>
.text
.global _kill
.type _kill, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd_32.h>
.text
.global _signal
.type _signal, @function

View File

@ -1,4 +1,4 @@
#include <stdio.h>
#include <fxlibc/stdio.h>
/*
** The function dprintf() is the same as fprintf() except that it outputs to a

View File

@ -1,4 +1,4 @@
#include <stdio.h>
#include <fxlibc/stdio.h>
// internal depency
// TODO: update path detection

View File

@ -1,4 +1,4 @@
#include <stdio.h>
#include <fxlibc/stdio.h>
// internal depency
// TODO: update path detection

View File

@ -1,4 +1,4 @@
#include <stdio.h>
#include <fxlibc/stdio.h>
// internal depency
// TODO: update path detection

View File

@ -1,5 +1,5 @@
#include <stdio.h>
#include <unistd.h>
#include <fxlibc/stdio.h>
#include <fxlibc/unistd.h>
/*
** printf() write the output under the control of a format string that specifies

View File

@ -1,7 +1,7 @@
#include <stdio.h>
#include <unistd.h>
#include <fxlibc/stdio.h>
#include <fxlibc/unistd.h>
int putc(int c)
int putchar(int c)
{
char n;

View File

@ -1,6 +1,6 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fxlibc/stdio.h>
#include <fxlibc/string.h>
#include <fxlibc/unistd.h>
/*
** puts() writes the string s and a trailing newline to stdout.

View File

@ -1,4 +1,4 @@
#include <stdio.h>
#include <fxlibc/stdio.h>
/*
** sprintf(), snprintf(), vsprintf() and vsnprintf() write the output under the

View File

@ -1,4 +1,4 @@
#include <stdio.h>
#include <fxlibc/stdio.h>
/*
** sprintf(), snprintf(), vsprintf() and vsnprintf() write the output under the

View File

@ -1,5 +1,5 @@
#include <stdio.h>
#include <unistd.h>
#include <fxlibc/stdio.h>
#include <fxlibc/unistd.h>
// internal depency
// TODO: update path detection

View File

@ -1,4 +1,4 @@
#include <stdio.h>
#include <fxlibc/stdio.h>
// internal depency
// TODO: update path detection

View File

@ -1,4 +1,4 @@
#include <stdio.h>
#include <fxlibc/stdio.h>
/*
** The functions vsprintf() are equivalent to the sprintf() except that they

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd_32.h>
.text
.global _free
.type _free, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd_32.h>
.text
.global _malloc
.type _malloc, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd_32.h>
.text
.global _realloc
.type _realloc, @function

View File

@ -1,6 +1,6 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fxlibc/stdlib.h>
#include <fxlibc/string.h>
#include <fxlibc/unistd.h>
/*
** The calloc() function allocates memory for an array of nmemb elements of size

View File

@ -1,4 +1,4 @@
#include <stdlib.h>
#include <fxlibc/stdlib.h>
/*
** The reallocarray() function changes the size of the memory block pointed to

View File

@ -1,4 +1,4 @@
#include <string.h>
#include <fxlibc/string.h>
/*
** The memcpy() function copies n bytes from memory area src to memory area dest.

View File

@ -1,4 +1,4 @@
#include <string.h>
#include <fxlibc/string.h>
/*
** The memset() function fills the first n bytes of the memory area pointed to

View File

@ -1,4 +1,4 @@
#include <string.h>
#include <fxlibc/string.h>
/*
** The strcat() function appends the src string to the dest string,

View File

@ -1,4 +1,4 @@
#include <string.h>
#include <fxlibc/string.h>
/*
** The strchr() function returns a pointer to the first occurrence of the

View File

@ -1,4 +1,4 @@
#include <string.h>
#include <fxlibc/string.h>
/*
** The strcmp() function compares the two strings s1 and s2. The locale is not

View File

@ -1,4 +1,4 @@
#include <string.h>
#include <fxlibc/string.h>
/*
** The strcpy() function copies the string pointed to by src, including the

View File

@ -1,5 +1,5 @@
#include <string.h>
#include <stdlib.h>
#include <fxlibc/string.h>
#include <fxlibc/stdlib.h>
/*
** The strdup() function returns a pointer to a new string which is a

View File

@ -1,4 +1,4 @@
#include <string.h>
#include <fxlibc/string.h>
/*
** The strlen() function calculates the length of the string pointed to by s,

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd.h>
.text
.global _wait
.type _wait, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd.h>
.text
.global _waitpid
.type _waitpid, @function

View File

@ -1,5 +1,5 @@
#include <threads.h>
#include <unistd.h>
#include <fxlibc/threads.h>
#include <fxlibc/unistd.h>
// Creates a new mutex object with type __TYPE.
// @note: If successful the new object is pointed by __MUTEX.

View File

@ -1,6 +1,6 @@
#ifdef __SUPPORT_CASIO_ABI_FX9860G
#include <asm/unistd_32.h>
#include <asm-casio/__trapa.h>
#include <fxlibc/asm/unistd_32.h>
#include <fxlibc/asm-casio/__trapa.h>
.text
.global _close
.type _close, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd.h>
.text
.global _close
.type _close, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd.h>
.text
.global _fork_execve
.type _fork_execve, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd.h>
.text
.global _getpgid
.type _getpgid, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd.h>
.text
.global _getpid
.type _getpid, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd.h>
.text
.global _getppid
.type _getppid, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd.h>
.text
.global _lseek
.type _lseek, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd.h>
.text
.global _read
.type _read, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd.h>
.text
.global _setpgid
.type _setpgid, @function

View File

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <asm/unistd_32.h>
#include <fxlibc/asm/unistd.h>
.text
.global _write
.type _write, @function