From: nsz Date: Tue, 20 Sep 2011 16:23:12 +0000 (+0200) Subject: update sizeof script X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;ds=sidebyside;h=de4035ca705b5c7fd1ec69e56206487ef80f2a3a;p=musl-tables update sizeof script --- diff --git a/Makefile b/Makefile index 3335e99..fe4a91c 100644 --- a/Makefile +++ b/Makefile @@ -5,15 +5,8 @@ all: tables sizeof clean: rm -f sizeof*.o sizeof-glibc sizeof-musl sizeof.diff tab_*.html -tables: tags syms - MUSL=$(MUSL) ./tab_c99.sh - MUSL=$(MUSL) ./tab_posix.sh - -tags: - MUSL=$(MUSL) ./maketags.sh - -syms: - MUSL=$(MUSL) ./makesyms.sh +tables: + MUSL=$(MUSL) ./update.sh sizeof: sizeof-glibc sizeof-musl ./sizeof-glibc >data/glibc.sizeof @@ -24,11 +17,14 @@ LIBGCC=`gcc -print-file-name=libgcc.a |sed 's,/libgcc.a$$,,'` # when compiling with pcc #PCC=`pcc -v foobar.o 2>&1 |sed -n 's,.* \([^ ]*\)/lib/crtbegin.o.*,\1,p'` +sizeof.c: + ./sizeof.sh + sizeof-glibc: sizeof.c - gcc -o $@ $< + gcc -std=gnu99 -o $@ $< sizeof-musl: sizeof.c - gcc -std=gnu99 -nostdinc -fno-stack-protector -isystem $(MUSL)/include -isystem $(LIBGCC) -c -o $@.o $< - ld -o $@ $@.o $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o $(MUSL)/lib/crtn.o -L$(MUSL)/lib -lc -L$(LIBGCC) -lgcc -nostdlib + gcc -std=gnu99 -nostdinc -fno-stack-protector -isystem $(MUSL)/include -isystem $(LIBGCC) -isystem /usr/include -c -o $@.o $< + ld -o $@ $@.o -X -d -e _start -Bstatic $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o $(MUSL)/lib/crtn.o -L$(MUSL)/lib -lc -L$(LIBGCC) -lgcc -nostdlib # ld -o $@ $@.o $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o $(MUSL)/lib/crtn.o -L$(MUSL)/lib -lc -dynamic-linker $(MUSL)/lib/libc.so -L$(LIBGCC) -lgcc -nostdlib # pcc -nostdinc -isystem $(MUSL)/include -isystem $(PCC)/include -c -o $@.o $< # ld -X -d -e _start -Bstatic -o $@ $@.o $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o $(PCC)/lib/crtbegin.o $(PCC)/lib/crtend.o -L$(MUSL)/lib -lc -L$(PCC)/lib -lpcc -nostdlib diff --git a/sizeof.c b/sizeof.c index 4c1d725..fee47e2 100644 --- a/sizeof.c +++ b/sizeof.c @@ -1,51 +1,48 @@ #define _GNU_SOURCE 1 -#define _LARGEFILE64_SOURCE 1 -#define _FILE_OFFSET_BITS 64 - +#define _LARGEFILE64_SOURCE 1 +#define _FILE_OFFSET_BITS 64 #include -#include #include +#include +#include +#include #include -//#include -//#include -#include -//#include -#include -//#include -#include -//#include -#include -//#include -#include -//#include -#include -//#include -//#include -#include -//#include -//#include -//#include -#include -//#include -#include -//#include -//#include -#include +#include +#include +#include +#include +#include #include +#include #include +#include +#include +#include #include +//#include +#include +#include +#include #include #include #include #include #include #include +#include +#include +#include +#include +#include #include #include #include +#include #include #include +#include +#include #include #include #include @@ -59,53 +56,102 @@ #include #include #include +#include #include #include #include +#include #include +#include +#include #include #include #include #include +#include #include #include #include #include #include +#include #include +#include #include #include +#include #include +#include +#include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include +#include +#include +#include #include #include #include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include #include #include #include +#include +#include #include +#include #include +#include +#include #include +#include #include +#include #include #include +#include +#include +#include #include +#include #include #include +#include #include #define p(x) printf("%s\t%u\n", #x, sizeof(x)); int main(){ +p(ACTION) //p(CODE) //p(DIR) +p(ENTRY) p(Elf32_Addr) p(Elf32_Conflict) p(Elf32_Dyn) @@ -163,6 +209,7 @@ p(Elf_Options) p(Elf_Options_Hw) //p(FILE) p(HEADER) +p(VISIT) p(__uint16_t) p(__uint32_t) p(__uint64_t) @@ -176,7 +223,8 @@ p(clockid_t) p(dev_t) p(div_t) p(elf_fpregset_t) -//p(elf_fpxregset_t) +p(elf_fpregset_t) +p(elf_fpxregset_t) p(elf_greg_t) p(elf_gregset_t) p(epoll_data_t) @@ -188,6 +236,7 @@ p(fexcept_t) p(fpos_t) p(fsblkcnt_t) p(fsfilcnt_t) +p(fsid_t) p(gid_t) p(glob_t) p(iconv_t) @@ -272,7 +321,7 @@ p(res_state) p(rlim_t) p(sa_family_t) p(scrnmap_t) -//p(sem_t) +p(sem_t) p(sig_atomic_t) p(sighandler_t) p(siginfo_t) @@ -294,10 +343,12 @@ p(struct __res_state) //p(struct __ucontext) p(struct _ns_flagdata) p(struct addrinfo) +p(struct aiocb) p(struct arpd_request) p(struct arphdr) p(struct arpreq) p(struct arpreq_old) +p(struct bandinfo) p(struct cmsghdr) p(struct console_font_op) p(struct consolefontdesc) @@ -432,7 +483,15 @@ p(struct sockaddr_storage) p(struct sockaddr_un) p(struct spwd) p(struct stat) -//p(struct statvfs) +p(struct statfs) +p(struct statvfs) +p(struct str_list) +p(struct str_mlist) +p(struct strbuf) +p(struct strfdinsert) +p(struct strioctl) +p(struct strpeek) +p(struct strrecvfd) p(struct sysinfo) p(struct termios) p(struct timespec) @@ -449,7 +508,7 @@ p(struct unimapinit) p(struct unipair) p(struct user) p(struct user_fpregs_struct) -//p(struct user_fpxregs_struct) +p(struct user_fpxregs_struct) p(struct user_regs_struct) p(struct utimbuf) p(struct utmpx) @@ -494,9 +553,10 @@ p(union epoll_data) p(union sigval) p(ushort) p(va_list) -p(wchar_t) -//p(wctrans_t) -//p(wctype_t) +p(va_list) +p(wctrans_t) +p(wctype_t) p(wint_t) p(wordexp_t) +p(wchar_t) return 0;} diff --git a/sizeof.sh b/sizeof.sh new file mode 100755 index 0000000..ee3b137 --- /dev/null +++ b/sizeof.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +export LC_ALL=C +MUSL=${MUSL:-../musl} + +awk -F'\t' '$3 ~ /^[sut]$/ { + print $1 +}' data/musl.tags >/tmp/m.type +echo 'wchar_t' >>/tmp/m.type + +( + cd $MUSL/include + find . -name '*.h' | sed 's,^\./,,' >/tmp/m.header +) + +echo '#define _GNU_SOURCE 1' >sizeof.c +echo '#define _LARGEFILE64_SOURCE 1' >>sizeof.c +echo '#define _FILE_OFFSET_BITS 64' >>sizeof.c +echo '#include ' >>sizeof.c +echo '#include ' >>sizeof.c +echo '' >>sizeof.c + +sort /tmp/m.header |uniq |awk ' + /^features\.h$/ { printf "//" } + { print "#include <" $0 ">" }' >>sizeof.c +echo '#define p(x) printf("%s\\t%u\\n", #x, sizeof(x));' >>sizeof.c +echo 'int main(){' >>sizeof.c +sed 's/.*/p(&)/' /tmp/m.type |awk ' + /p\(CODE\)/ || + /p\(DIR\)/ || + /p\(FILE\)/ || + /p\(struct __CODE\)/ || + /p\(struct __fpstate\)/ || + /p\(struct __ptcb\)/ || + /p\(struct __siginfo\)/ || + /p\(struct __ucontext\)/ || + /p\(struct in6_mutinfo\)/ || + /p\(struct npttimeval\)/ { printf "//" } + { print }' >>sizeof.c +echo 'return 0;}' >>sizeof.c + diff --git a/tab_c99.html b/tab_c99.html index 2e7b494..f5cd51c 100644 --- a/tab_c99.html +++ b/tab_c99.html @@ -1,5 +1,5 @@

musl vs c99 api

-

commit

commit 03a8362930c3c4fe49ee6b9cb2ba9f28153b15d3
Date: Tue Sep 20 10:58:18 2011 -0400

fix broken siginfo_t with _GNU_SOURCE defined

this bug was introduced in a recent patch. the problem we're working
around is that broken GNU software wants to use "struct siginfo"
rather than "siginfo_t", but "siginfo" is not in the reserved
namespace and thus not legal for the standard header to use. +

commit

commit 2318207adcad74283881ffcefbad92797a2495aa
Date: Tue Sep 20 12:14:06 2011 -0400

fix incorrect include guard in mqueue.h

legend

  • status: musl implementation status summary
    • (empty) - implemented
    • nosym - prototype found in include files (see decl) but not in libc.a (see sym)
    • nodecl - symbol is in libc.a but not declared in a public header
    • missing - neither in include files (see decl) nor in libc.a (see sym)
  • sym: external symbol kind as found by `nm libc.a` (symbol kind only reported once)
    • C - symbol is common (uninitialized data)
    • D - symbol is in the initialized data section
    • R - symbol is in the read only data section
    • T - symbol is in the text section
    • V - weak object
    • W - weak symbol
  • decl: kind of declaration as found by `ctags -R include` (every occurance is reported, arch specific definitions are not linked)
    • d - macro definition
    • t - typedef
    • s - struct declaration
    • u - union declaration
    • p - function prototype
    • x - external and forward variable declaration

table

muslc99
statussymdeclnameheaderprotosection
missing  NDEBUGassert.h B.1 Diagnostics diff --git a/tab_posix.html b/tab_posix.html index 7410fb4..7784cfd 100644 --- a/tab_posix.html +++ b/tab_posix.html @@ -1,5 +1,5 @@

musl vs posix api

-

commit

commit 03a8362930c3c4fe49ee6b9cb2ba9f28153b15d3
Date: Tue Sep 20 10:58:18 2011 -0400

fix broken siginfo_t with _GNU_SOURCE defined

this bug was introduced in a recent patch. the problem we're working
around is that broken GNU software wants to use "struct siginfo"
rather than "siginfo_t", but "siginfo" is not in the reserved
namespace and thus not legal for the standard header to use. +

commit

commit 2318207adcad74283881ffcefbad92797a2495aa
Date: Tue Sep 20 12:14:06 2011 -0400

fix incorrect include guard in mqueue.h

legend

  • status: musl implementation status summary
    • (empty) - implemented
    • nosym - prototype found in include files (see decl) but not in libc.a (see sym)
    • nodecl - symbol is in libc.a but not declared in a public header
    • missing - neither in include files (see decl) nor in libc.a (see sym)
  • sym: external symbol kind as found by `nm libc.a` (symbol kind only reported once)
    • C - symbol is common (uninitialized data)
    • D - symbol is in the initialized data section
    • R - symbol is in the read only data section
    • T - symbol is in the text section
    • V - weak object
    • W - weak symbol
  • decl: kind of declaration as found by `ctags -R include` (every occurance is reported)
    • d - macro definition
    • p - function prototype
    • x - external and forward variable declaration

(STREAMS and posix_trace* apis are excluded)

table

muslposix
statussymdeclnameheaderoptiondesc
  d FD_CLR sys/select.h pselect, select - synchronous I/O multiplexing