Browse Source

Fix installation / uninstallation rules + Fix compilation ABI support

master
Yatis 2 months ago
parent
commit
f76757ecd2
78 changed files with 80 additions and 74 deletions
  1. +0
    -1
      include/asm/unistd.h
  2. +0
    -0
      include/fxlibc/arch/fx9860g/unistd_32.h
  3. +0
    -0
      include/fxlibc/arch/fxcg50/unistd_32.h
  4. +0
    -0
      include/fxlibc/arch/vhex/unistd_32.h
  5. +0
    -0
      include/fxlibc/asm-casio/__trapa.h
  6. +1
    -0
      include/fxlibc/asm/unistd.h
  7. +3
    -3
      include/fxlibc/asm/unistd_32.h
  8. +0
    -0
      include/fxlibc/bits/confname.h
  9. +0
    -0
      include/fxlibc/bits/fcntl.h
  10. +0
    -0
      include/fxlibc/bits/setjmp.h
  11. +0
    -0
      include/fxlibc/bits/sigaction.h
  12. +0
    -0
      include/fxlibc/bits/signum.h
  13. +0
    -0
      include/fxlibc/bits/types/FILE.h
  14. +0
    -0
      include/fxlibc/bits/types/__FILE.h
  15. +2
    -1
      include/fxlibc/bits/types/struct_FILE.h
  16. +0
    -0
      include/fxlibc/bits/waitflags.h
  17. +0
    -0
      include/fxlibc/bits/waitstatus.h
  18. +0
    -0
      include/fxlibc/elf.h
  19. +0
    -0
      include/fxlibc/errno.h
  20. +0
    -0
      include/fxlibc/fcntl.h
  21. +1
    -1
      include/fxlibc/setjmp.h
  22. +2
    -1
      include/fxlibc/signal.h
  23. +0
    -0
      include/fxlibc/stdio.h
  24. +0
    -0
      include/fxlibc/stdlib.h
  25. +0
    -0
      include/fxlibc/string.h
  26. +0
    -0
      include/fxlibc/sys/mman.h
  27. +1
    -0
      include/fxlibc/sys/signal.h
  28. +0
    -0
      include/fxlibc/sys/stat.h
  29. +2
    -2
      include/fxlibc/sys/syscall.h
  30. +0
    -0
      include/fxlibc/sys/types.h
  31. +2
    -2
      include/fxlibc/sys/wait.h
  32. +1
    -0
      include/fxlibc/syscall.h
  33. +0
    -0
      include/fxlibc/threads.h
  34. +3
    -2
      include/fxlibc/unistd.h
  35. +0
    -1
      include/sys/signal.h
  36. +0
    -1
      include/syscall.h
  37. +10
    -7
      make/Makefile.default
  38. +1
    -1
      src/fcntl/arch/vhex/open.S
  39. +1
    -1
      src/signal/arch/vhex/kill.S
  40. +1
    -1
      src/signal/arch/vhex/signal.S
  41. +1
    -1
      src/stdio/dprintf.c
  42. +1
    -1
      src/stdio/internal/printf_actions.c
  43. +1
    -1
      src/stdio/internal/printf_common.c
  44. +1
    -1
      src/stdio/internal/printf_options.c
  45. +2
    -2
      src/stdio/printf.c
  46. +3
    -3
      src/stdio/putc.c
  47. +3
    -3
      src/stdio/puts.c
  48. +1
    -1
      src/stdio/snprintf.c
  49. +1
    -1
      src/stdio/sprintf.c
  50. +2
    -2
      src/stdio/vdprintf.c
  51. +1
    -1
      src/stdio/vsnprintf.c
  52. +1
    -1
      src/stdio/vsprintf.c
  53. +1
    -1
      src/stdlib/arch/vhex/free.S
  54. +1
    -1
      src/stdlib/arch/vhex/malloc.S
  55. +1
    -1
      src/stdlib/arch/vhex/realloc.S
  56. +3
    -3
      src/stdlib/calloc.c
  57. +1
    -1
      src/stdlib/reallocarray.c
  58. +1
    -1
      src/string/memcpy.c
  59. +1
    -1
      src/string/memset.c
  60. +1
    -1
      src/string/strcat.c
  61. +1
    -1
      src/string/strchr.c
  62. +1
    -1
      src/string/strcmp.c
  63. +1
    -1
      src/string/strcpy.c
  64. +2
    -2
      src/string/strdup.c
  65. +1
    -1
      src/string/strlen.c
  66. +1
    -1
      src/sys/wait/arch/vhex/wait.S
  67. +1
    -1
      src/sys/wait/arch/vhex/waitpid.S
  68. +2
    -2
      src/threads/mutex.c
  69. +2
    -2
      src/unistd/arch/fx9860g/close.S
  70. +1
    -1
      src/unistd/arch/vhex/close.S
  71. +1
    -1
      src/unistd/arch/vhex/fork_execve.S
  72. +1
    -1
      src/unistd/arch/vhex/getpgid.S
  73. +1
    -1
      src/unistd/arch/vhex/getpid.S
  74. +1
    -1
      src/unistd/arch/vhex/getppid.S
  75. +1
    -1
      src/unistd/arch/vhex/lseek.S
  76. +1
    -1
      src/unistd/arch/vhex/read.S
  77. +1
    -1
      src/unistd/arch/vhex/setpgid.S
  78. +1
    -1
      src/unistd/arch/vhex/write.S

+ 0
- 1
include/asm/unistd.h View File

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

include/arch/fx9860g/unistd_32.h → include/fxlibc/arch/fx9860g/unistd_32.h View File


include/arch/fxcg50/unistd_32.h → include/fxlibc/arch/fxcg50/unistd_32.h View File


include/arch/vhex/unistd_32.h → include/fxlibc/arch/vhex/unistd_32.h View File


include/asm-casio/__trapa.h → include/fxlibc/asm-casio/__trapa.h View File


+ 1
- 0
include/fxlibc/asm/unistd.h View File

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

include/asm/unistd_32.h → 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__*/

include/bits/confname.h → include/fxlibc/bits/confname.h View File


include/bits/fcntl.h → include/fxlibc/bits/fcntl.h View File


include/bits/setjmp.h → include/fxlibc/bits/setjmp.h View File


include/bits/sigaction.h → include/fxlibc/bits/sigaction.h View File


include/bits/signum.h → include/fxlibc/bits/signum.h View File


include/bits/types/FILE.h → include/fxlibc/bits/types/FILE.h View File


include/bits/types/__FILE.h → include/fxlibc/bits/types/__FILE.h View File


include/bits/types/struct_FILE.h → include/fxlibc/bits/types/struct_FILE.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 ?

include/bits/waitflags.h → include/fxlibc/bits/waitflags.h View File


include/bits/waitstatus.h → include/fxlibc/bits/waitstatus.h View File


include/elf.h → include/fxlibc/elf.h View File


include/errno.h → include/fxlibc/errno.h View File


include/fcntl.h → include/fxlibc/fcntl.h View File


include/setjmp.h → include/fxlibc/setjmp.h 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];

include/signal.h → include/fxlibc/signal.h 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;

include/stdio.h → include/fxlibc/stdio.h View File


include/stdlib.h → include/fxlibc/stdlib.h View File


include/string.h → include/fxlibc/string.h View File


include/sys/mman.h → include/fxlibc/sys/mman.h View File


+ 1
- 0
include/fxlibc/sys/signal.h View File

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

include/sys/stat.h → include/fxlibc/sys/stat.h View File


include/sys/syscall.h → include/fxlibc/sys/syscall.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

include/sys/types.h → include/fxlibc/sys/types.h View File


include/sys/wait.h → include/fxlibc/sys/wait.h 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
- 0
include/fxlibc/syscall.h View File

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

include/threads.h → include/fxlibc/threads.h View File


include/unistd.h → include/fxlibc/unistd.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);

+ 0
- 1
include/sys/signal.h View File

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

+ 0
- 1
include/syscall.h View File

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

+ 10
- 7
make/Makefile.default 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


+ 1
- 1
src/fcntl/arch/vhex/open.S 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


+ 1
- 1
src/signal/arch/vhex/kill.S 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


+ 1
- 1
src/signal/arch/vhex/signal.S 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


+ 1
- 1
src/stdio/dprintf.c 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


+ 1
- 1
src/stdio/internal/printf_actions.c View File

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


+ 1
- 1
src/stdio/internal/printf_common.c View File

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


+ 1
- 1
src/stdio/internal/printf_options.c View File

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


+ 2
- 2
src/stdio/printf.c 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


+ 3
- 3
src/stdio/putc.c 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;


+ 3
- 3
src/stdio/puts.c 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.


+ 1
- 1
src/stdio/snprintf.c View File

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


+ 1
- 1
src/stdio/sprintf.c View File

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


+ 2
- 2
src/stdio/vdprintf.c 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


+ 1
- 1
src/stdio/vsnprintf.c View File

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


+ 1
- 1
src/stdio/vsprintf.c View File

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


+ 1
- 1
src/stdlib/arch/vhex/free.S 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


+ 1
- 1
src/stdlib/arch/vhex/malloc.S 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


+ 1
- 1
src/stdlib/arch/vhex/realloc.S 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


+ 3
- 3
src/stdlib/calloc.c 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


+ 1
- 1
src/stdlib/reallocarray.c 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


+ 1
- 1
src/string/memcpy.c 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.


+ 1
- 1
src/string/memset.c 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


+ 1
- 1
src/string/strcat.c View File

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


+ 1
- 1
src/string/strchr.c 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


+ 1
- 1
src/string/strcmp.c 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


+ 1
- 1
src/string/strcpy.c 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


+ 2
- 2
src/string/strdup.c 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


+ 1
- 1
src/string/strlen.c 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,


+ 1
- 1
src/sys/wait/arch/vhex/wait.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


+ 1
- 1
src/sys/wait/arch/vhex/waitpid.S 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


+ 2
- 2
src/threads/mutex.c 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.


+ 2
- 2
src/unistd/arch/fx9860g/close.S 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


+ 1
- 1
src/unistd/arch/vhex/close.S 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


+ 1
- 1
src/unistd/arch/vhex/fork_execve.S 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


+ 1
- 1
src/unistd/arch/vhex/getpgid.S 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


+ 1
- 1
src/unistd/arch/vhex/getpid.S 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


+ 1
- 1
src/unistd/arch/vhex/getppid.S 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


+ 1
- 1
src/unistd/arch/vhex/lseek.S 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


+ 1
- 1
src/unistd/arch/vhex/read.S 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


+ 1
- 1
src/unistd/arch/vhex/setpgid.S 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


+ 1
- 1
src/unistd/arch/vhex/write.S 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


Loading…
Cancel
Save