[PATCH 1/2] Removes NSS and resolv (XCC)
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 18 May 2015 20:01:32 +0000 (16:01 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 4 Jun 2015 13:40:02 +0000 (09:40 -0400)
commitd4b8124211340f4bbd6cd3f08a20e254a769f134
treeab19ae0dc10d4989d36288d5ca02339334ee06fc
parent5cdff0ade826bc4777e0e540d03365f86919bb25
[PATCH 1/2] Removes NSS and resolv (XCC)

Glibc has a bunch of subdirs, such as nss, nis, inet, and resolv.  Some
of these won't actually work at runtime.  For instance, resolv uses
ioctl, which will always fail.

As a deeper problem, many of these subdirs might "work", but they
actually would fail or otherwise not work on Akaros.  They open files
that do not exist or attempt operations we do not support.  We've been
faking support for these operations since f2ed80b10a.

Beyond the subdirs brought in by f2ed80b10a, there are a bunch of
"mandatory" subdirs, such as pwd, shadow, grp, and gshadow.  These
provide interfaces for reading entries from files like /etc/passwd.
These all use NSS to generate the code for their functions by including
a file like nss/getXXbyYY.c.

Anyway, this commit removes resolv and nss, and anything (minus inet)
that depends on nss.  In lieu of actually removing all of pwd/grp/etc, I
replaced them all with stubs.  Since gshadow doesn't have a man page, I
just stopped building it for now.  We can stub it out later, if
necessasry.

Of special note is inet.  We want most of inet - that's in part what the
BSD shims do: things like gethostbyname.  And gethostbyname2.  And
gethostbyname2_r.  Inet also includes a lot of headers in netinet/.  So
we keep inet as a Subdir (like pwd), and just stub out anything that
uses nss.

There isn't anything wrong with nss internally (some people disagree),
but the idea here is that anything using nss was probably not right for
Akaros, and we should do something else.

An alternative approach is to remove resolv and keep nss around.
Functions from e.g. pwd will fail at runtime, unless we create
/etc/passwd files.  Though nss relies on resolv functions, so it is not
particularly simple.  This commit's stub approach may be easier.

And yet another approach would be to keep resolv around too, and hack it
up to try and work.  But I think interposing on the glibc interface is a
better place to work than at some internal function.

This won't compile without the next patch.
72 files changed:
tools/compilers/gcc-glibc/glibc-2.19-akaros/Makeconfig
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/Subdirs
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/compat-initgroups.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/ether_hton.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/ether_ntoh.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/fgetgrent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/fgetpwent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/fgetpwent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/fgetspent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/fgetspent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getaddrinfo.c
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getaliasent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getaliasent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getaliasname.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getaliasname_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getgrent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getgrent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getgrgid.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getgrgid_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getgrnam.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getgrnam_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/gethstbyad.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/gethstbyad_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/gethstbynm.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/gethstbynm2.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/gethstbynm2_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/gethstbynm_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/gethstent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/gethstent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getnetbyad.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getnetbyad_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getnetbynm.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getnetbynm_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getnetent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getnetent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getnetgrent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getproto.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getproto_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getprtent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getprtent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getprtname.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getprtname_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getpw.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getpwent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getpwent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getpwnam.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getpwnam_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getpwuid.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getpwuid_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getrpcbyname.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getrpcbyname_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getrpcbynumber.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getrpcbynumber_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getrpcent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getrpcent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getservent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getservent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getspent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getspent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getspnam.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getspnam_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getsrvbynm.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getsrvbynm_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getsrvbypt.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/getsrvbypt_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/initgroups.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/lcpwdf.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/putpwent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/putspent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sgetspent.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/sgetspent_r.c [new file with mode: 0644]
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/ulckpwdf.c [new file with mode: 0644]