[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patches] New option groups
- To: patches@xxxxxxxxxx
- Subject: [patches] New option groups
- From: Maxim Kuvyrkov <maxim@xxxxxxxxxxxxxxxx>
- Date: Tue, 31 Mar 2009 19:14:07 +0400
Hello,
The attached patch adds 3 new option groups to EGLIBC:
* OPTION_EGLIBC_FCVT -- functions for converting floating-point numbers
to strings;
* OPTION_EGLIBC_FMTMSG -- functions for formatting messages;
* OPTION_EGLIBC_FTRAVERSE -- functions for traversing file hierarchies;
The functions included in the above option groups were identified as
contributing significant size increase to the EGLIBC footprint while not
being present in default API of uClibc. As a result this patch provides
1-2% smaller library.
The patch could've been split into 3, but, as the changes are
straightforward, it is, probably, easier to review them together.
Tested on arm-linux and powerpc-linux without unexpected failures.
Any comments? OK for trunk?
Thanks,
--
Maxim K.
CodeSourcery
2009-03-31 Maxim Kuvyrkov <maxim@xxxxxxxxxxxxxxxx>
* option-groups.def (OPTION_EGLIBC_FCVT, OPTION_EGLIBC_FMTMSG):
Define new option groups.
(OPTION_EGLIBC_FTRAVERSE): Define new option group.
* option-groups.defaults: Set defaults for new option groups.
* misc/Makefile: Handle OPTION_EGLIBC_FCVT option group.
* stdlib/Makefile: Handle OPTION_EGLIBC_FMTMSG option group.
* io/Makefile: Handle OPTION_EGLIBC_FTRAVERSE option group.
Index: src-eglibc/glibc-trunk-2/stdlib/Makefile
===================================================================
--- src-eglibc/glibc-trunk-2/stdlib/Makefile (revision 8199)
+++ src-eglibc/glibc-trunk-2/stdlib/Makefile (working copy)
@@ -51,7 +51,7 @@ routines-y := \
strtof_l strtod_l strtold_l \
system canonicalize \
a64l l64a \
- getsubopt xpg_basename fmtmsg \
+ getsubopt xpg_basename \
strtoimax strtoumax \
getcontext setcontext makecontext swapcontext
routines-$(OPTION_EGLIBC_LOCALE_CODE) += \
@@ -62,6 +62,7 @@ routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR
ifeq (yy,$(OPTION_EGLIBC_LOCALE_CODE)$(OPTION_POSIX_REGEXP))
routines-y += rpmatch
endif
+routines-$(OPTION_EGLIBC_FMTMSG) += fmtmsg
aux = grouping groupingwc tens_in_limb
# These routines will be omitted from the libc shared object.
@@ -71,7 +72,7 @@ static-only-routines = atexit at_quick_e
distribute := exit.h grouping.h abort-instr.h isomac.c tst-fmtmsg.sh \
allocalim.h
-test-srcs := tst-fmtmsg
+test-srcs-$(OPTION_EGLIBC_FMTMSG) := tst-fmtmsg
tests := tst-strtol tst-strtod testrand testsort testdiv \
test-canon test-canon2 tst-strtoll tst-environ \
tst-xpg-basename tst-random tst-random2 tst-bsearch \
@@ -137,7 +138,9 @@ testmb2-ENV = LOCPATH=$(common-objpfx)lo
tests: $(objpfx)isomac.out
# eglibc: ifeq (no,$(cross-compiling))
+ifeq (y,$(OPTION_EGLIBC_FMTMSG))
tests: $(objpfx)tst-fmtmsg.out
+endif
# eglibc: endif
$(objpfx)isomac.out: $(objpfx)isomac
Index: src-eglibc/glibc-trunk-2/misc/Makefile
===================================================================
--- src-eglibc/glibc-trunk-2/misc/Makefile (revision 8199)
+++ src-eglibc/glibc-trunk-2/misc/Makefile (working copy)
@@ -60,7 +60,6 @@ routines := brk sbrk sstk ioctl \
syslog syscall daemon \
mmap mmap64 munmap mprotect msync madvise mincore remap_file_pages\
mlock munlock mlockall munlockall \
- efgcvt efgcvt_r qefgcvt qefgcvt_r \
hsearch hsearch_r tsearch lsearch \
err error ustat \
getsysstats dirname \
@@ -72,6 +71,7 @@ routines := brk sbrk sstk ioctl \
routines-$(OPTION_POSIX_REGEXP) += regexp
routines-$(OPTION_EGLIBC_FSTAB) += fstab
routines-$(OPTION_EGLIBC_BSD) += chflags fchflags revoke
+routines-$(OPTION_EGLIBC_FCVT) += efgcvt efgcvt_r qefgcvt qefgcvt_r
distribute := device-nrs.h
@@ -85,9 +85,10 @@ install-lib := libbsd-compat.a libg.a
endif
gpl2lgpl := error.c error.h
-tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \
+tests := tst-dirname tst-tsearch tst-fdset tst-mntent tst-hsearch \
tst-pselect tst-insremque tst-mntent2 bug-hsearch1
tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) += tst-error1
+tests-$(OPTION_EGLIBC_FCVT) += tst-efgcvt
# eglibc: ifeq (no,$(cross-compiling))
ifeq (y,$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO))
tests: $(objpfx)tst-error1-mem
Index: src-eglibc/glibc-trunk-2/option-groups.defaults
===================================================================
--- src-eglibc/glibc-trunk-2/option-groups.defaults (revision 8199)
+++ src-eglibc/glibc-trunk-2/option-groups.defaults (working copy)
@@ -16,7 +16,10 @@ OPTION_EGLIBC_CATGETS = y
OPTION_EGLIBC_CHARSETS = y
OPTION_EGLIBC_DB_ALIASES = y
OPTION_EGLIBC_ENVZ = y
+OPTION_EGLIBC_FCVT = y
+OPTION_EGLIBC_FMTMSG = y
OPTION_EGLIBC_FSTAB = y
+OPTION_EGLIBC_FTRAVERSE = y
OPTION_EGLIBC_GETLOGIN = y
OPTION_EGLIBC_INET = y
OPTION_EGLIBC_LIBM = y
Index: src-eglibc/glibc-trunk-2/option-groups.def
===================================================================
--- src-eglibc/glibc-trunk-2/option-groups.def (revision 8199)
+++ src-eglibc/glibc-trunk-2/option-groups.def (working copy)
@@ -222,6 +222,27 @@ config OPTION_EGLIBC_ENVZ
envz_entry envz_remove
envz_get envz_strip
+config OPTION_EGLIBC_FCVT
+ bool "Functions for converting floating-point numbers to strings"
+ help
+ This option group includes functions for converting
+ floating-point numbers to strings.
+
+ This option group includes the following functions:
+
+ ecvt qecvt
+ ecvt_r qecvt_r
+ fcvt qfcvt
+ fcvt_r qfcvt_r
+ gcvt qgcvt
+
+config OPTION_EGLIBC_FMTMSG
+ bool "Functions for formatting messages"
+ help
+ This option group includes the following functions:
+
+ addseverity fmtmsg
+
config OPTION_EGLIBC_FSTAB
bool "Access functions for 'fstab'"
help
@@ -230,12 +251,26 @@ config OPTION_EGLIBC_FSTAB
not included in the POSIX standard, which provides the
'getmntent' family of functions instead.
- This option group includues the following functions:
+ This option group includes the following functions:
endfsent getfsspec
getfsent setfsent
getfsfile
+config OPTION_EGLIBC_FTRAVERSE
+ bool "Functions for traversing file hierarchies"
+ help
+ This option group includes functions for traversing file
+ UNIX file hierachies.
+
+ This option group includes the following functions:
+
+ fts_open ftw
+ fts_read nftw
+ fts_children ftw64
+ fts_set nftw64
+ fts_close
+
config OPTION_EGLIBC_GETLOGIN
bool "The getlogin function"
depends OPTION_EGLIBC_UTMP
Index: src-eglibc/glibc-trunk-2/io/Makefile
===================================================================
--- src-eglibc/glibc-trunk-2/io/Makefile (revision 8199)
+++ src-eglibc/glibc-trunk-2/io/Makefile (working copy)
@@ -50,12 +50,13 @@ routines := \
ttyname ttyname_r isatty \
link linkat symlink symlinkat readlink readlinkat \
unlink unlinkat rmdir \
- ftw ftw64 fts poll ppoll \
+ poll ppoll \
posix_fadvise posix_fadvise64 \
posix_fallocate posix_fallocate64 \
sendfile sendfile64 \
utimensat futimens
routines-$(OPTION_EGLIBC_BSD) += lchmod
+routines-$(OPTION_EGLIBC_FTRAVERSE) += ftw ftw64 fts
aux := have_o_cloexec
@@ -66,14 +67,16 @@ static-only-routines = stat fstat lstat
fstatat fstatat64 mknod mknodat
others := pwd
-test-srcs := ftwtest
+test-srcs-$(OPTION_EGLIBC_FTRAVERSE) := ftwtest
tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \
- tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 tst-statvfs \
+ tst-fcntl tst-statvfs \
tst-openat tst-unlinkat tst-fstatat tst-futimesat \
tst-renameat tst-fchownat tst-fchmodat tst-faccessat \
tst-symlinkat tst-linkat tst-readlinkat tst-mkdirat \
- tst-mknodat tst-mkfifoat tst-ttyname_r bug-ftw5 \
+ tst-mknodat tst-mkfifoat tst-ttyname_r \
tst-posix_fallocate
+tests-$(OPTION_EGLIBC_FTRAVERSE) += bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 \
+ bug-ftw5
distribute := ftwtest-sh
@@ -102,7 +105,9 @@ test-stat2-ARGS = Makefile . $(objpfx)te
tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp
# eglibc: ifeq ($(cross-compiling),no)
+ifeq (y,$(OPTION_EGLIBC_FTRAVERSE))
tests: $(objpfx)ftwtest.out
+endif
ifeq ($(cross-compiling),yes)
# EGLIBC's cross-testing support does not require the build and host