[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patches] NSSWITCH build failure.



Hi Jim,

I tried the build again with the same option-groups.config file as
before with eglibc svn revision 4039 and got the same build errors as
before.  :-(

I've attched the error log,

Best regards,

Steve

On Mon, 2007-10-29 at 14:29 -0700, Jim Blandy wrote:
> Steve Papacharalambous <stevep at freescale.com> writes:
> > When the NSSWITCH option group is disabled eglibc fails to build.  I am
> > using eglibc svn version r3767, and the contents of the
> > option-groups.config file is:
> 
> Hi, Steve.  I've committed the following, which I believe should
> address the build failures you encountered with
> OPTION_EGLIBC_NSSWITCH.  Let me know how it goes.
> 
> ChangeLog.eglibc:
> 2007-10-29  Jim Blandy  <jimb@xxxxxxxxxxxxxxxx>
> 
> 	* nss/gen-fixed-nsswitch.c: Don't #include "nsswitch.h".  Instead,
> 	make our own copies of the datatype and enum definitions.  Do
> 	#include "nss.h".
> 	(lookup_actions, service_library, known_function, service_user)
> 	(name_database_entry, name_database): Copy definitions from
> 	nsswitch.c.
> 	* grp/Makefile (LDLIBS-testgrp): Link against the libraries listed
> 	in nss/fixed-nsswitch-libs when OPTION_EGLIBC_NSSWITCH is
> 	disabled.
> 	* posix/Makefile (LDLIBS-globtest): Same.
> 	* option-groups.def (OPTION_EGLIBC_NSSWITCH): Doc fix.
> 
> Index: nss/gen-fixed-nsswitch.c
> ===================================================================
> --- nss/gen-fixed-nsswitch.c	(revision 4012)
> +++ nss/gen-fixed-nsswitch.c	(revision 4013)
> @@ -27,10 +27,8 @@
>  #include <assert.h>
>  #include <ctype.h>
>  
> -#define libc_hidden_proto(func)
> -
> -#include "nsswitch.h"
>  #include "gnu/lib-names.h"
> +#include "nss.h"
>  
>  
>  /* Simple utilities.  */
> @@ -82,6 +80,95 @@
>  
> 
>  
> +/* Data structures representing the configuration file in memory.  */
> +
> +/* These are copied from nsswitch.h.
> +
> +   We could simply #include that file, but this program runs on the
> +   build machine and links against the build machine's libraries,
> +   whereas that header is meant for use by target code; it uses
> +   'libc_hidden_proto', 'internal_function', and related hair.  Since
> +   we've copied the parsing code, we might as well copy the data
> +   structure definitions as well.  */
> +
> +/* Actions performed after lookup finished.  */
> +typedef enum
> +{
> +  NSS_ACTION_CONTINUE,
> +  NSS_ACTION_RETURN
> +} lookup_actions;
> +
> +
> +typedef struct service_library
> +{
> +  /* Name of service (`files', `dns', `nis', ...).  */
> +  const char *name;
> +  /* Pointer to the loaded shared library.  */
> +  void *lib_handle;
> +  /* And the link to the next entry.  */
> +  struct service_library *next;
> +} service_library;
> +
> +
> +/* For mapping a function name to a function pointer.  It is known in
> +   nsswitch.c:nss_lookup_function that a string pointer for the lookup key
> +   is the first member.  */
> +typedef struct
> +{
> +  const char *fct_name;
> +  void *fct_ptr;
> +} known_function;
> +
> +
> +typedef struct service_user
> +{
> +  /* And the link to the next entry.  */
> +  struct service_user *next;
> +  /* Action according to result.  */
> +  lookup_actions actions[5];
> +  /* Link to the underlying library object.  */
> +  service_library *library;
> +  /* Collection of known functions.
> +
> +     With OPTION_EGLIBC_NSSWITCH enabled, this is the root of a
> +     'tsearch'-style tree.
> +
> +     With OPTION_EGLIBC_NSSWITCH disabled, this is an array of
> +     pointers to known_function structures, NULL-terminated.  */
> +  union
> +  {
> +    void *tree;
> +    const known_function **array;
> +  } known;
> +  /* Name of the service (`files', `dns', `nis', ...).  */
> +  const char *name;
> +} service_user;
> +
> +/* To access the action based on the status value use this macro.  */
> +#define nss_next_action(ni, status) ((ni)->actions[2 + status])
> +
> +
> +typedef struct name_database_entry
> +{
> +  /* And the link to the next entry.  */
> +  struct name_database_entry *next;
> +  /* List of service to be used.  */
> +  service_user *service;
> +  /* Name of the database.  */
> +  const char *name;
> +} name_database_entry;
> +
> +
> +typedef struct name_database
> +{
> +  /* List of all known databases.  */
> +  name_database_entry *entry;
> +  /* List of libraries with service implementation.  */
> +  service_library *library;
> +} name_database;
> +
> +
> +
>  /* Gathering the contents of the FIXED_FUNCTIONS file.  */
>  
>  /* It should be possible to generate this list automatically by
> @@ -659,7 +746,7 @@
>          {
>            if (printed_any)
>              putc (' ', out);
> -          fprintf (out, "libnss_%s.so%s",
> +          fprintf (out, "-lnss_%s",
>                     functions[i].service,
>                     nss_shlib_revision);
>            printed_any = 1;
> Index: grp/Makefile
> ===================================================================
> --- grp/Makefile	(revision 4012)
> +++ grp/Makefile	(revision 4013)
> @@ -33,6 +33,9 @@
>  include ../Makeconfig
>  
>  tests := testgrp
> +ifneq (y,$(OPTION_EGLIBC_NSSWITCH))
> +LDLIBS-testgrp += $(shell cat $(common-objpfx)nss/fixed-nsswitch-libs)
> +endif
>  
>  ifeq (yes,$(build-shared))
>  test-srcs :=  tst_fgetgrent
> Index: option-groups.def
> ===================================================================
> --- option-groups.def	(revision 4012)
> +++ option-groups.def	(revision 4013)
> @@ -507,10 +507,9 @@
>  
>         Note that some nsswitch service libraries require other option
>         groups to be enabled; for example, the OPTION_EGLIBC_INET
> -       option group must be enabled to use the 'libnss_dns.so.2' or
> -       'libnss_nis.so.2' service libraries, which use the Domain Name
> -       System and Network Information Service network protocols to
> -       answer queries.
> +       option group must be enabled to use the 'libnss_dns.so.2'
> +       service library, which uses the Domain Name System network
> +       protocol to answer queries.
>  
>  config OPTION_EGLIBC_RCMD
>     bool "Support for 'rcmd' and related library functions"
> Index: posix/Makefile
> ===================================================================
> --- posix/Makefile	(revision 4012)
> +++ posix/Makefile	(revision 4013)
> @@ -144,6 +144,7 @@
>  $(objpfx)globtest.out: globtest.sh $(objpfx)globtest
>  	$(SHELL) -e globtest.sh $(common-objpfx) $(elf-objpfx) \
>  		 $(rtld-installed-name) '$(cross-test-wrapper)'
> +LDLIBS-globtest += $(shell cat $(common-objpfx)nss/fixed-nsswitch-libs)
>  ifeq (y,$(OPTION_EGLIBC_WORDEXP))
>  tests: $(objpfx)wordexp-tst.out
>  $(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test
-- 
Steve Papacharalambous
Developer Technology.

Registered address:
Freescale Semiconductor UK Ltd
Colvilles Road
East Kilbride
Glasgow
Scotland
G75 OTG

Registration number: SC262720
VAT number: GB831329053

(X) Public
( ) Freescale Internal Use Only
( ) Freescale Confidential Proprietary 

make  subdir=nss -C nss ..=../ subdir_lib
make[2]: Entering directory `/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss'
.././scripts/mkinstalldirs /usr/src/redhat/BUILD/csl-tc-78/build-eglibc/nss
mkdir /usr/src/redhat/BUILD/csl-tc-78/build-eglibc/nss
cd /usr/src/redhat/BUILD/csl-tc-78/build-eglibc/nss && gcc -g3 -O -Wall -I /usr/src/redhat/BUILD/csl-tc-78/build-eglibc/nss/ -DFIXED_FUNCTIONS='"/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/fixed-nsswitch.functions"'  -include ../config.h /usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c -o gen-fixed-nsswitch
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:239: error: parse error before "internal_function"
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:239: warning: type defaults to `int' in declaration of `internal_function'
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:239: warning: data definition has no type or storage class
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:240: error: parse error before "internal_function"
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:240: warning: type defaults to `int' in declaration of `internal_function'
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:240: warning: data definition has no type or storage class
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:242: error: parse error before "internal_function"
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:242: warning: type defaults to `int' in declaration of `internal_function'
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:242: warning: data definition has no type or storage class
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:246: error: parse error before "nss_parse_file"
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:247: warning: return type defaults to `int'
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c: In function `nss_parse_file':
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:257: warning: return makes integer from pointer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:290: warning: implicit declaration of function `nss_getline'
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:290: warning: assignment makes pointer from integer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:308: warning: return makes integer from pointer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c: At top level:
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:317: error: parse error before "nss_parse_service_list"
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:318: warning: return type defaults to `int'
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c: In function `nss_parse_service_list':
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:330: warning: return makes integer from pointer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:337: warning: return makes integer from pointer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:391: warning: return makes integer from pointer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:400: warning: return makes integer from pointer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:403: warning: return makes integer from pointer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:408: warning: return makes integer from pointer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:424: warning: return makes integer from pointer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c: At top level:
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:457: error: parse error before "nss_getline"
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:458: warning: return type defaults to `int'
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c: In function `nss_getline':
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:476: warning: return makes integer from pointer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:488: warning: assignment makes pointer from integer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:491: warning: return makes integer from pointer without a cast
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c: In function `generate_service_lib_list':
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:751: warning: too many arguments for format
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c: In function `main':
/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss/gen-fixed-nsswitch.c:769: warning: initialization makes pointer from integer without a cast
make[2]: *** [/usr/src/redhat/BUILD/csl-tc-78/build-eglibc/nss/gen-fixed-nsswitch] Error 1
make[2]: Leaving directory `/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc/nss'
make[1]: *** [nss/subdir_lib] Error 2
make[1]: Leaving directory `/usr/src/redhat/BUILD/csl-tc-78/eglibc-r4039/libc'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.51015 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.51015 (%build)