update i386 sizeof and sizeoftags
authornsz <nsz@port70.net>
Wed, 21 Sep 2011 11:54:00 +0000 (13:54 +0200)
committernsz <nsz@port70.net>
Wed, 21 Sep 2011 11:54:00 +0000 (13:54 +0200)
Makefile
data/i386.glibc.sizeof
data/i386.musl.sizeof
data/i386.sizeof.diff
sizeof.c
sizeof.sh
tab_c99.html
tab_posix.html

index 825593e..217abb9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ tables:
 sizeof: sizeof-glibc sizeof-musl
        ./sizeof-glibc >data/glibc.sizeof
        ./sizeof-musl >data/musl.sizeof
-       diff -u data/glibc.sizeof data/musl.sizeof >data/sizeof.diff || true
+       diff -U1 data/glibc.sizeof data/musl.sizeof >data/sizeof.diff || true
 
 LIBGCC=`gcc -print-file-name=libgcc.a |sed 's,/libgcc.a$$,,'`
 # when compiling with pcc
index d27f892..0fa56ae 100644 (file)
@@ -1,4 +1,5 @@
 ACTION 4
+CODE   8
 ENTRY  8
 Elf32_Addr     4
 Elf32_Conflict 4
@@ -57,18 +58,19 @@ Elf_Options 8
 Elf_Options_Hw 8
 HEADER 12
 VISIT  4
+_Bool  1
 __uint16_t     2
 __uint32_t     4
 __uint64_t     8
 blkcnt_t       8
 blksize_t      4
-bool   1
 caddr_t        4
 cc_t   1
 clock_t        4
 clockid_t      4
 dev_t  8
 div_t  8
+double 8
 elf_fpregset_t 108
 elf_fpregset_t 108
 elf_fpxregset_t        512
@@ -80,6 +82,7 @@ fd_mask       4
 fd_set 128
 fenv_t 28
 fexcept_t      2
+float  4
 fpos_t 16
 fsblkcnt_t     8
 fsfilcnt_t     8
@@ -93,6 +96,7 @@ imaxdiv_t     16
 in_addr_t      4
 in_port_t      2
 ino_t  8
+int    4
 int16_t        2
 int32_t        4
 int64_t        8
@@ -112,6 +116,9 @@ key_t       4
 ldiv_t 8
 lldiv_t        16
 locale_t       4
+long   4
+long double    12
+long long      8
 lwpid_t        4
 mbstate_t      8
 mcontext_t     88
@@ -169,6 +176,7 @@ rlim_t      8
 sa_family_t    2
 scrnmap_t      1
 sem_t  16
+short  2
 sig_atomic_t   4
 sighandler_t   4
 siginfo_t      128
@@ -245,6 +253,7 @@ struct ip6_frag     8
 struct ip6_hbh 2
 struct ip6_hdr 40
 struct ip6_hdrctl      8
+struct ip6_mtuinfo     32
 struct ip6_opt 2
 struct ip6_opt_jumbo   6
 struct ip6_opt_nsap    4
@@ -291,6 +300,7 @@ struct nd_router_solicit    8
 struct netent  16
 struct ns_tcp_tsig_state       528
 struct ns_tsig_key     2060
+struct ntptimeval      16
 struct option  16
 struct packet_mreq     16
 struct passwd  28
@@ -394,8 +404,9 @@ union sigval        4
 ushort 2
 va_list        4
 va_list        4
+void*  4
+wchar_t        4
 wctrans_t      4
 wctype_t       4
 wint_t 4
 wordexp_t      12
-wchar_t        4
index 0bf94a9..14d16a4 100644 (file)
@@ -1,4 +1,5 @@
 ACTION 4
+CODE   8
 ENTRY  8
 Elf32_Addr     4
 Elf32_Conflict 4
@@ -57,18 +58,19 @@ Elf_Options 8
 Elf_Options_Hw 8
 HEADER 12
 VISIT  4
+_Bool  1
 __uint16_t     2
 __uint32_t     4
 __uint64_t     8
 blkcnt_t       8
 blksize_t      4
-bool   1
 caddr_t        4
 cc_t   1
 clock_t        4
 clockid_t      4
 dev_t  8
 div_t  8
+double 8
 elf_fpregset_t 108
 elf_fpregset_t 108
 elf_fpxregset_t        512
@@ -80,6 +82,7 @@ fd_mask       4
 fd_set 128
 fenv_t 32
 fexcept_t      2
+float  4
 fpos_t 16
 fsblkcnt_t     8
 fsfilcnt_t     8
@@ -93,6 +96,7 @@ imaxdiv_t     16
 in_addr_t      4
 in_port_t      2
 ino_t  8
+int    4
 int16_t        2
 int32_t        4
 int64_t        8
@@ -112,6 +116,9 @@ key_t       4
 ldiv_t 8
 lldiv_t        16
 locale_t       4
+long   4
+long double    12
+long long      8
 lwpid_t        4
 mbstate_t      8
 mcontext_t     88
@@ -169,6 +176,7 @@ rlim_t      8
 sa_family_t    2
 scrnmap_t      1
 sem_t  16
+short  2
 sig_atomic_t   4
 sighandler_t   4
 siginfo_t      128
@@ -245,6 +253,7 @@ struct ip6_frag     8
 struct ip6_hbh 2
 struct ip6_hdr 40
 struct ip6_hdrctl      8
+struct ip6_mtuinfo     32
 struct ip6_opt 2
 struct ip6_opt_jumbo   6
 struct ip6_opt_nsap    4
@@ -291,6 +300,7 @@ struct nd_router_solicit    8
 struct netent  16
 struct ns_tcp_tsig_state       528
 struct ns_tsig_key     2060
+struct ntptimeval      16
 struct option  16
 struct packet_mreq     16
 struct passwd  28
@@ -394,8 +404,9 @@ union sigval        4
 ushort 2
 va_list        4
 va_list        4
+void*  4
+wchar_t        4
 wctrans_t      4
 wctype_t       4
 wint_t 4
 wordexp_t      12
-wchar_t        4
index 653b51a..8c7eb1d 100644 (file)
@@ -1,49 +1,29 @@
---- data/glibc.sizeof  2011-09-20 18:22:17.000000000 +0200
-+++ data/musl.sizeof   2011-09-20 18:22:17.000000000 +0200
-@@ -78,7 +78,7 @@
- eventfd_t     8
- fd_mask       4
+--- data/glibc.sizeof  2011-09-21 13:50:37.000000000 +0200
++++ data/musl.sizeof   2011-09-21 13:50:37.000000000 +0200
+@@ -82,3 +82,3 @@
  fd_set        128
 -fenv_t        28
 +fenv_t        32
  fexcept_t     2
- fpos_t        16
- fsblkcnt_t    8
-@@ -160,7 +160,7 @@
- pthread_t     4
- ptrdiff_t     4
+@@ -169,3 +169,3 @@
  quad_t        8
 -regex_t       32
 +regex_t       28
  register_t    4
- regmatch_t    8
- regoff_t      4
-@@ -302,8 +302,8 @@
- struct rr_pco_use     32
- struct rr_result      24
+@@ -314,4 +314,4 @@
  struct rtentry        84
 -struct rusage 72
 -struct sched_param    4
 +struct rusage 136
 +struct sched_param    28
  struct sembuf 6
- struct semid_ds       64
- struct seminfo        40
-@@ -319,7 +319,7 @@
- struct sockaddr_in    16
- struct sockaddr_in6   28
+@@ -331,3 +331,3 @@
  struct sockaddr_ll    20
 -struct sockaddr_storage       128
 +struct sockaddr_storage       132
  struct sockaddr_un    110
- struct spwd   36
- struct stat   96
-@@ -332,7 +332,7 @@
- struct strioctl       16
- struct strpeek        28
+@@ -344,3 +344,3 @@
  struct strrecvfd      20
 -struct sysinfo        64
 +struct sysinfo        348
  struct termios        60
- struct timespec       8
- struct timestamp      40
index fee47e2..1016849 100644 (file)
--- a/sizeof.c
+++ b/sizeof.c
@@ -1,6 +1,7 @@
 #define _GNU_SOURCE 1
 #define _LARGEFILE64_SOURCE 1
 #define _FILE_OFFSET_BITS 64
+#define SYSLOG_NAMES 1
 #include <stddef.h>
 #include <sys/types.h>
 
 #define p(x) printf("%s\t%u\n", #x, sizeof(x));
 int main(){
 p(ACTION)
-//p(CODE)
+p(CODE)
 //p(DIR)
 p(ENTRY)
 p(Elf32_Addr)
@@ -210,18 +211,19 @@ p(Elf_Options_Hw)
 //p(FILE)
 p(HEADER)
 p(VISIT)
+p(_Bool)
 p(__uint16_t)
 p(__uint32_t)
 p(__uint64_t)
 p(blkcnt_t)
 p(blksize_t)
-p(bool)
 p(caddr_t)
 p(cc_t)
 p(clock_t)
 p(clockid_t)
 p(dev_t)
 p(div_t)
+p(double)
 p(elf_fpregset_t)
 p(elf_fpregset_t)
 p(elf_fpxregset_t)
@@ -233,6 +235,7 @@ p(fd_mask)
 p(fd_set)
 p(fenv_t)
 p(fexcept_t)
+p(float)
 p(fpos_t)
 p(fsblkcnt_t)
 p(fsfilcnt_t)
@@ -246,6 +249,7 @@ p(imaxdiv_t)
 p(in_addr_t)
 p(in_port_t)
 p(ino_t)
+p(int)
 p(int16_t)
 p(int32_t)
 p(int64_t)
@@ -265,6 +269,9 @@ p(key_t)
 p(ldiv_t)
 p(lldiv_t)
 p(locale_t)
+p(long)
+p(long double)
+p(long long)
 p(lwpid_t)
 p(mbstate_t)
 p(mcontext_t)
@@ -322,6 +329,7 @@ p(rlim_t)
 p(sa_family_t)
 p(scrnmap_t)
 p(sem_t)
+p(short)
 p(sig_atomic_t)
 p(sighandler_t)
 p(siginfo_t)
@@ -390,7 +398,6 @@ p(struct ih_idseq)
 p(struct ih_pmtu)
 p(struct ih_rtradv)
 p(struct in6_addr)
-//p(struct in6_mutinfo)
 p(struct in6_pktinfo)
 p(struct in6_rtmsg)
 p(struct in_addr)
@@ -404,6 +411,7 @@ p(struct ip6_frag)
 p(struct ip6_hbh)
 p(struct ip6_hdr)
 p(struct ip6_hdrctl)
+p(struct ip6_mtuinfo)
 p(struct ip6_opt)
 p(struct ip6_opt_jumbo)
 p(struct ip6_opt_nsap)
@@ -448,9 +456,9 @@ p(struct nd_redirect)
 p(struct nd_router_advert)
 p(struct nd_router_solicit)
 p(struct netent)
-//p(struct npttimeval)
 p(struct ns_tcp_tsig_state)
 p(struct ns_tsig_key)
+p(struct ntptimeval)
 p(struct option)
 p(struct packet_mreq)
 p(struct passwd)
@@ -554,9 +562,10 @@ p(union sigval)
 p(ushort)
 p(va_list)
 p(va_list)
+p(void*)
+p(wchar_t)
 p(wctrans_t)
 p(wctype_t)
 p(wint_t)
 p(wordexp_t)
-p(wchar_t)
 return 0;}
index ee3b137..399794c 100755 (executable)
--- a/sizeof.sh
+++ b/sizeof.sh
@@ -6,7 +6,16 @@ MUSL=${MUSL:-../musl}
 awk -F'\t' '$3 ~ /^[sut]$/ {
        print $1
 }' data/musl.tags >/tmp/m.type
+echo 'short' >>/tmp/m.type
+echo 'int' >>/tmp/m.type
+echo 'long' >>/tmp/m.type
+echo 'long long' >>/tmp/m.type
+echo 'float' >>/tmp/m.type
+echo 'double' >>/tmp/m.type
+echo 'long double' >>/tmp/m.type
 echo 'wchar_t' >>/tmp/m.type
+echo '_Bool' >>/tmp/m.type
+echo 'void*' >>/tmp/m.type
 
 (
        cd $MUSL/include
@@ -16,6 +25,7 @@ echo 'wchar_t' >>/tmp/m.type
 echo '#define _GNU_SOURCE 1' >sizeof.c
 echo '#define _LARGEFILE64_SOURCE 1' >>sizeof.c
 echo '#define _FILE_OFFSET_BITS 64' >>sizeof.c
+echo '#define SYSLOG_NAMES 1' >>sizeof.c
 echo '#include <stddef.h>' >>sizeof.c
 echo '#include <sys/types.h>' >>sizeof.c
 echo '' >>sizeof.c
@@ -25,17 +35,8 @@ sort /tmp/m.header |uniq |awk '
        { 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
+sort /tmp/m.type |awk '
+       /^struct __(CODE|fpstate|ptcb|siginfo|ucontext)$/ ||
+       /^(DIR|FILE)$/ { printf "//" }
+       { print "p(" $0 ")" }' >>sizeof.c
 echo 'return 0;}' >>sizeof.c
-
index c10f281..b02e6e4 100644 (file)
@@ -1,5 +1,5 @@
 <h3>musl vs c99 api</h3>
-<h4>commit</h4><p>commit <a href="http://git.etalabs.net/cgi-bin/gitweb.cgi?p=musl;a=commit;h=d23a543d8acfedb7c0284888d72c4aa347b8c46e">d23a543d8acfedb7c0284888d72c4aa347b8c46e</a><br>Date:   Tue Sep 20 14:51:56 2011 -0400<br><br>    make stdbool.h conform to c99
+<h4>commit</h4><p>commit <a href="http://git.etalabs.net/cgi-bin/gitweb.cgi?p=musl;a=commit;h=fd9e01e92a5d665e5b6c3221cd67970038cf7a6c">fd9e01e92a5d665e5b6c3221cd67970038cf7a6c</a><br>Date:   Tue Sep 20 20:02:48 2011 -0400<br><br>    fix some header typos
 <h4>legend</h4><ul><li>status: musl implementation status summary<ul><li>(empty) - implemented<li>nosym - prototype found in include files (see decl) but not in libc.a (see sym)<li>nodecl - symbol is in libc.a but not declared in a public header<li>missing - neither in include files (see decl) nor in libc.a (see sym)</ul><li>sym: external symbol kind as found by `nm libc.a` (symbol kind only reported once)<ul><li>C - symbol is common (uninitialized data)<li>D - symbol is in the initialized data section<li>R - symbol is in the read only data section<li>T - symbol is in the text section<li>V - weak object<li>W - weak symbol</ul><li>decl: kind of declaration as found by `ctags -R include` (every occurance is reported, arch specific definitions are not linked)<ul><li>d - macro definition<li>t - typedef<li>s - struct declaration<li>u - union declaration<li>p - function prototype<li>x - external and forward variable declaration</ul></ul>
 <h4>table</h4><table border=1><tr><th colspan=3>musl<th colspan=4>c99<tr><th>status<th>sym<th>decl<th>name<th>header<th>proto<th>section
 <tr><td>missing<td>&#160;<td>&#160;<td>NDEBUG<td>assert.h<td>&#160;<td>B.1 Diagnostics
index 324d362..4289416 100644 (file)
@@ -1,5 +1,5 @@
 <h3>musl vs posix api</h3>
-<h4>commit</h4><p>commit <a href="http://git.etalabs.net/cgi-bin/gitweb.cgi?p=musl;a=commit;h=d23a543d8acfedb7c0284888d72c4aa347b8c46e">d23a543d8acfedb7c0284888d72c4aa347b8c46e</a><br>Date:   Tue Sep 20 14:51:56 2011 -0400<br><br>    make stdbool.h conform to c99
+<h4>commit</h4><p>commit <a href="http://git.etalabs.net/cgi-bin/gitweb.cgi?p=musl;a=commit;h=fd9e01e92a5d665e5b6c3221cd67970038cf7a6c">fd9e01e92a5d665e5b6c3221cd67970038cf7a6c</a><br>Date:   Tue Sep 20 20:02:48 2011 -0400<br><br>    fix some header typos
 <h4>legend</h4><ul><li>status: musl implementation status summary<ul><li>(empty) - implemented<li>nosym - prototype found in include files (see decl) but not in libc.a (see sym)<li>nodecl - symbol is in libc.a but not declared in a public header<li>missing - neither in include files (see decl) nor in libc.a (see sym)</ul><li>sym: external symbol kind as found by `nm libc.a` (symbol kind only reported once)<ul><li>C - symbol is common (uninitialized data)<li>D - symbol is in the initialized data section<li>R - symbol is in the read only data section<li>T - symbol is in the text section<li>V - weak object<li>W - weak symbol</ul><li>decl: kind of declaration as found by `ctags -R include` (every occurance is reported)<ul><li>d - macro definition<li>p - function prototype<li>x - external and forward variable declaration</ul></ul><p>(STREAMS and posix_trace* apis are excluded)
 <h4>table</h4><table border=1><tr><th colspan=3>musl<th colspan=4>posix<tr><th>status<th>sym<th>decl<th>name<th>header<th>option<th>desc
 <tr><td>&#160;<td>&#160;<td><a href="http://git.etalabs.net/cgi-bin/gitweb.cgi?p=musl;a=blob;f=include/sys/select.h#l27">d</a> <td><a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/FD_CLR.html">FD_CLR</a><td> <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_select.h.html">sys/select.h</a><td>&#160;<td>pselect, select - synchronous I/O multiplexing