From 9ab3f03153d32b6558380a3168422c709a25cc32 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Sun, 23 Aug 2015 09:05:40 -0600 Subject: [PATCH] Define some symbol export conditions, correct errno and add sleep and usleep. From Pavel Pisa --- ChangeLog | 3 +++ libc/libc.csv | 16 +++++++++------- libc/symtab/README.txt | 9 +++++++++ syscall/syscall.csv | 7 ++++--- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0ba51ab8b..09ee7e1802 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10875,3 +10875,6 @@ substantial effect on system image size. Mainly code/text. If loading of applications at runtime is not planned do not select this. From Pavel Pisa (2015-08-23). + * libc/libc.csv and syscalls/syscalls.csv: Define some symbol + export conditions, correct errno and add sleep and usleep. From + Pavel Pisa (2015-08-23). diff --git a/libc/libc.csv b/libc/libc.csv index 65dc81da82..977a111fbe 100644 --- a/libc/libc.csv +++ b/libc/libc.csv @@ -6,12 +6,12 @@ "aio_suspend","aio.h","defined(CONFIG_FS_AIO)","int","FAR struct aiocb *const []|FAR struct aiocb *const *","int","FAR const struct timespec *" "asprintf","stdio.h","","int","FAR char **","const char *","..." "avsprintf","stdio.h","","int","FAR char **","const char *","va_list" -"b16atan2","fixedmath.h","","b16_t","b16_t","b16_t" +"b16atan2","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t","b16_t" "b16cos","fixedmath.h","","b16_t","b16_t" -"b16divb16","fixedmath.h","","b16_t","b16_t","b16_t" -"b16mulb16","fixedmath.h","","b16_t","b16_t","b16_t" +"b16divb16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t","b16_t" +"b16mulb16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t","b16_t" "b16sin","fixedmath.h","","b16_t","b16_t" -"b16sqr","fixedmath.h","","b16_t","b16_t" +"b16sqr","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t" "basename","libgen.h","","FAR char","FAR char *" "cfgetspeed","termios.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SERIAL_TERMIOS)","speed_t","FAR const struct termios *" "cfsetspeed","termios.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SERIAL_TERMIOS)","int","FAR struct termios *","speed_t" @@ -117,6 +117,7 @@ "sigemptyset","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR sigset_t *" "sigfillset","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR sigset_t *" "sigismember","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const sigset_t *","int" +"sleep","unistd.h","!defined(CONFIG_DISABLE_SIGNALS)","unsigned int","unsigned int" "snprintf","stdio.h","","int","FAR char *","size_t","const char *","..." "sprintf","stdio.h","","int","FAR char *","const char *","..." "sq_addafter","queue.h","","void","FAR sq_entry_t *","FAR sq_entry_t *","FAR sq_queue_t *" @@ -162,10 +163,11 @@ "tcsetattr","termios.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SERIAL_TERMIOS)","int","int","int","FAR const struct termios *" "telldir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","off_t","FAR DIR *" "time","time.h","","time_t","time_t *" -"ub16divub16","fixedmath.h","","ub16_t","ub16_t","ub16_t" -"ub16mulub16","fixedmath.h","","ub16_t","ub16_t","ub16_t" -"ub16sqr","fixedmath.h","","ub16_t","ub16_t" +"ub16divub16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t","ub16_t" +"ub16mulub16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t","ub16_t" +"ub16sqr","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t" "ungetc","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","int","FAR FILE *" +"usleep","unistd.h","!defined(CONFIG_DISABLE_SIGNALS)","int","int","FAR FILE *" "vdbg","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_VERBOSE)","int","const char *","..." "vfprintf","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","const char *","va_list" "vprintf","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR const char *","va_list" diff --git a/libc/symtab/README.txt b/libc/symtab/README.txt index 21bb1759da..d7dc6abcca 100644 --- a/libc/symtab/README.txt +++ b/libc/symtab/README.txt @@ -17,3 +17,12 @@ Next code selectes canned symtab from application: #include ... canned_symtab_initialize(); + +The option can have substantial effect on system image size, mainly +code/text. That is because the instructions to generate canned_symtab.inc +above will cause EVERY interface in the NuttX RTOS and the C library to be +included into build. Add to that the size of a huge symbol table. + +In order to reduce the code/text size, you may want to manually prune the +auto-generated canned_symtab.inc file to remove all interfaces that you do +not wish to include into the base FLASH image. diff --git a/syscall/syscall.csv b/syscall/syscall.csv index c97d16ccf4..f9ea9285a6 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -11,7 +11,7 @@ "clock_getres","time.h","","int","clockid_t","struct timespec*" "clock_gettime","time.h","","int","clockid_t","struct timespec*" "clock_settime","time.h","","int","clockid_t","const struct timespec*" -"clock_systimer","nuttx/clock.h","","uint32_t" +"clock_systimer","nuttx/clock.h","!defined(__HAVE_KERNEL_GLOBALS)","uint32_t" "close","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","int","int" "closedir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","int","FAR DIR*" "connect","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","FAR const struct sockaddr*","socklen_t" @@ -23,7 +23,8 @@ "fs_fdopen","nuttx/fs/fs.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","FAR struct file_struct*","int","int","FAR struct tcb_s*" "fs_ioctl","nuttx/fs/fs.h","defined(CONFIG_LIBC_IOCTL_VARIADIC) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","int","int","unsigned long" "fsync","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","int" -"get_errno","errno.h","","int" +"get_errno","errno.h","!defined(__DIRECT_ERRNO_ACCESS)","int" +"get_errno_ptr","errno.h","defined(__DIRECT_ERRNO_ACCESS)","FAR int*" "getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char*","FAR const char*" "getpid","unistd.h","","pid_t" "getsockopt","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int","int","FAR void*","FAR socklen_t*" @@ -119,7 +120,7 @@ "send","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int" "sendfile","sys/sendfile.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_NET_SENDFILE)","ssize_t","int","int","FAR off_t*","size_t" "sendto","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int","FAR const struct sockaddr*","socklen_t" -"set_errno","errno.h","","void","int" +"set_errno","errno.h","!defined(__DIRECT_ERRNO_ACCESS)","void","int" "setenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char*","FAR const char*","int" "sethostname","unistd.h","defined(CONFIG_LIBC_NETDB)","int","FAR const char*","size_t" "setsockopt","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int","int","FAR const void*","socklen_t"