diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2014-02-28 06:44:46 -0800 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2014-02-28 06:44:46 -0800 |
commit | 9949268a539861245dccd4fba3e7ba63601dd0b4 (patch) | |
tree | 493f0fdaca53d1a9b3e25688e78ca1c71be8fa33 | |
parent | 949ad730d57d30113a365cd9fa3f3a27e43f151b (diff) | |
download | glibc-9949268a539861245dccd4fba3e7ba63601dd0b4.tar.gz glibc-9949268a539861245dccd4fba3e7ba63601dd0b4.tar.xz glibc-9949268a539861245dccd4fba3e7ba63601dd0b4.zip |
Forward-port google-nsl-stub
-rw-r--r-- | README.google | 11 | ||||
-rw-r--r-- | google-nsl-stub/Makefile | 32 | ||||
-rw-r--r-- | google-nsl-stub/configure | 6 | ||||
-rw-r--r-- | google-nsl-stub/shlib-versions | 1 | ||||
-rw-r--r-- | google-nsl-stub/ypclnt.c | 42 |
5 files changed, 92 insertions, 0 deletions
diff --git a/README.google b/README.google index e2780b0bbc..5854ea3108 100644 --- a/README.google +++ b/README.google @@ -35,3 +35,14 @@ sysdeps/generic/ldsodefs.h https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=73d61e4f6c65da714c0f8a3a233725322553ceba https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=bf06bcee84d4c19a99925c0f58026a8cbd87a688 (ahh, not yet upstream) + +google-nsl-stub/Makefile +google-nsl-stub/configure +google-nsl-stub/shlib-versions +google-nsl-stub/ypclnt.c + For b/2832143 and b/10385480, add a stub libnsl library as an add-on, to + replace the libnsl removed in the previous change. Although we do not use + libnsl normally, we have precompiled third-party binaries that need to + dynamically link to it, and this stub satisfies that need. + (bmoses, google-local) + diff --git a/google-nsl-stub/Makefile b/google-nsl-stub/Makefile new file mode 100644 index 0000000000..ef5b6a6c24 --- /dev/null +++ b/google-nsl-stub/Makefile @@ -0,0 +1,32 @@ +# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# <http://www.gnu.org/licenses/>. + +# Makefile for google-nsl-stub add-on subdirectory of GNU C Library. +# Based on libidn/Makefile. + +subdir := google-nsl-stub + +extra-libs = libnsl +extra-libs-others = $(extra-libs) + +libnsl-routines := ypclnt + +include $(..)Makeconfig + +libnsl-inhibit-o = $(filter-out .os,$(object-suffixes)) + +include $(..)Rules diff --git a/google-nsl-stub/configure b/google-nsl-stub/configure new file mode 100644 index 0000000000..c901084728 --- /dev/null +++ b/google-nsl-stub/configure @@ -0,0 +1,6 @@ +# This is a shell script fragment sourced by the main configure script. +# We're obliged to give here the canonical name that will be used to +# as a subdirectory to search for in other add-ons' sysdeps trees. + +libc_add_on_canonical=google-nsl-stub +libc_add_on_subdirs=. diff --git a/google-nsl-stub/shlib-versions b/google-nsl-stub/shlib-versions new file mode 100644 index 0000000000..ca13c8c1f6 --- /dev/null +++ b/google-nsl-stub/shlib-versions @@ -0,0 +1 @@ +.*-.*-.* libnsl=1 diff --git a/google-nsl-stub/ypclnt.c b/google-nsl-stub/ypclnt.c new file mode 100644 index 0000000000..67867fe7d7 --- /dev/null +++ b/google-nsl-stub/ypclnt.c @@ -0,0 +1,42 @@ +/* Copyright (C) 2013 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* This is a Google-local stub version of nis/ypclnt.c. These functions + are required for dynamic linking of some precompiled executables. */ + +#include <stdlib.h> +#include <stdio.h> + +int yp_get_default_domain(char **domp) { + /* We duplicate glibc's error behavior and return a null pointer. */ + *domp = NULL; + return 12; /* YPERR_NODOM */ +} + +static const char err[] = "not implemented in Google-local stub"; +char *yperr_string(int incode) { + return err; +} + +int yp_match(char *indomain, char *inmap, const char *inkey, int inkeylen, + char **outval, int *outvallen) { + *outval = malloc(2); + (*outval)[0] = '\n'; + (*outval)[1] = '\0'; + *outvallen = 0; + return 0; +} |