This is the mail archive of the libc-hacker@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix for testsuite with configure --disable-shared



I run configure --enable-static-nss --disable-shared --enable-add-ons
--disable-profile to just build static libraries on Linux/ix86.

After fixing the problem in debug (see separate email), I run `make
test' and encounted several problems:

The first problem was in grp and caused by --enable-static-nss:
/opt/egcs/bin/gcc -nostdlib -nostartfiles -o /usr/glibc/src/buildreport/19990319/grp/testgrp     /usr/glibc/src/buildreport/19990319/csu/crt1.o /usr/glibc/src/buildreport/19990319/csu/crti.o `/opt/egcs/bin/gcc --print-file-name=crtbegin.o` /usr/glibc/src/buildreport/19990319/grp/testgrp.o  /usr/glibc/src/buildreport/19990319/libc.a  -lgcc /usr/glibc/src/buildreport/19990319/libc.a -lgcc `/opt/egcs/bin/gcc --print-file-name=crtend.o` /usr/glibc/src/buildreport/19990319/csu/crtn.o
/usr/glibc/src/buildreport/19990319/libc.a(nsswitch.o): In function `__nss_database_lookup':
/usr/glibc/src/libc/nss/nsswitch.c:115: undefined reference to `_nss_files_getaliasent_r'

I had to disable most (all?) of the shell scripts used for tests since
these shell scripts call the dynamic linker directly.  I considered
that rewriting all test to work with without the dynamic linker wasn't
worth the hazzle.

I'm not sure if there isn't a better way to fix these problems then my 
patches.  Feel free to suggest alternatives.

I just tried a `make install' and this failed with db/libdb.so.  I'll
patch the installation after the other patches have been integrated -
if nobody produces patches before me.

Andreas

1999-03-19  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* rt/Makefile: Link against static library if no shared lib is
	available.

	* localedata/Makefile: The shells scripts implementing the test
 	require the dynamic linker which is not available with
 	--disable-shared.  Skip the test if --disable-shared is given.

	* linuxthreads/Makefile: Link test against static libpthread if no 
 	shared lib is available.

	* iconvdata/Makefile (tests): Run iconv-test only if we're
	building shared libraries.
	* elf/Makefile (tests): Likewise for elf tests.

	* posix/Makefile: The test frameworks globtest and wordexp-test
	require the dynamic linker which is not available with
	--disable-shared.  Skip the test if --disable-shared is given.

	* grp/Makefile (otherlibs): For static nss build link against
	necessary libs.

--- grp/Makefile.~1~	Mon Oct 19 07:21:22 1998
+++ grp/Makefile	Fri Mar 19 14:21:48 1999
@@ -1,4 +1,4 @@
-# Copyright (C) 1991, 1992, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1991, 1992, 1996, 1997, 1998, 1999  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
@@ -30,6 +30,12 @@
 
 include ../Rules
 
+ifeq (yes,$(build-static-nss))
+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
+	     $(resolvobjdir)/libresolv.a
+endif
+
+
 ifeq ($(have-thread-library),yes)
 
 CFLAGS-getgrgid_r.c = -DUSE_NSCD=1
--- posix/Makefile.~1~	Sat Jan 23 13:56:57 1999
+++ posix/Makefile	Fri Mar 19 17:44:01 1999
@@ -56,9 +56,12 @@
 include ../Makeconfig
 
 aux		:= init-posix environ
-tests		:= tstgetopt testfnm runtests wordexp-test runptests	     \
+tests		:= tstgetopt testfnm runtests runptests	     \
 		   tst-preadwrite test-vfork
+ifeq (yes,$(build-shared))
 test-srcs	:= globtest
+tests           += wordexp-test
+endif
 others		:= getconf
 install-bin	:= getconf
 ifeq (yes,$(build-static))
@@ -75,6 +78,8 @@
 include ../Rules
 
 ifeq (no,$(cross-compiling))
+# globtest and wordexp-test currently only works with shared libraries
+ifeq (yes,$(build-shared))
 .PHONY: do-globtest do-wordexp-test
 tests: do-globtest do-wordexp-test
 do-globtest: $(objpfx)globtest
@@ -84,6 +89,7 @@
 	$(SHELL) -e wordexp-tst.sh $(common-objpfx) $(elf-objpfx) \
 		 $(rtld-installed-name)
 endif
+endif
 
 CFLAGS-regex.c = -Wno-unused -Wno-strict-prototypes
 CFLAGS-getaddrinfo.c = -DRESOLVER
--- iconvdata/Makefile.~1~	Mon Mar  1 18:33:55 1999
+++ iconvdata/Makefile	Fri Mar 19 17:54:01 1999
@@ -232,7 +232,9 @@
 
 include ../Rules
 
+ifeq (yes,$(build-shared))
 tests: $(objpfx)iconv-test.out
+endif
 
 $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
 			 $(addprefix $(objpfx),$(modules.so)) \
--- elf/Makefile.~1~	Mon Mar  1 18:33:55 1999
+++ elf/Makefile	Fri Mar 19 17:59:38 1999
@@ -77,7 +77,9 @@
 install-rootsbin += ldconfig
 endif
 
+ifeq (yes,$(build-shared))
 tests = loadtest restest1 preloadtest loadfail multiload
+endif
 modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		testobj1_1 failobj
 extra-objs += $(modules-names:=.os)

--- linuxthreads/Makefile.~1~	Tue Dec  1 07:43:49 1998
+++ linuxthreads/Makefile	Fri Mar 19 18:04:04 1999
@@ -1,4 +1,4 @@
-# Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999 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
@@ -53,9 +53,15 @@
 $(objpfx)libpthread.so: $(common-objpfx)libc.so
 
 # Make sure we link with the thread library.
-$(objpfx)ex1: $(objpfx)libpthread.so
-$(objpfx)ex2: $(objpfx)libpthread.so
-$(objpfx)ex3: $(objpfx)libpthread.so
-$(objpfx)ex4: $(objpfx)libpthread.so
-$(objpfx)ex5: $(objpfx)libpthread.so
-$(objpfx)ex6: $(objpfx)libpthread.so
+ifeq ($(build-shared),yes)
+libpthread = $(objpfx)libpthread.so
+else
+libpthread = $(objpfx)libpthread.a
+endif
+
+$(objpfx)ex1: $(libpthread)
+$(objpfx)ex2: $(libpthread)
+$(objpfx)ex3: $(libpthread)
+$(objpfx)ex4: $(libpthread)
+$(objpfx)ex5: $(libpthread)
+$(objpfx)ex6: $(libpthread)

--- localedata/Makefile.~1~	Wed Feb 17 07:17:28 1999
+++ localedata/Makefile	Fri Mar 19 18:19:34 1999
@@ -69,6 +69,7 @@
 
 
 ifeq (no,$(cross-compiling))
+ifeq (yes,$(build-shared))
 .PHONY: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch
 tests: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch
 do-collate-test: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
@@ -81,6 +82,7 @@
 do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch do-tst-fmon
 	$(SHELL) -e $< $(common-objpfx)
 endif
+endif
 
 # Sometimes the whole collection of locale files should be installed.
 LOCALEDEF=$(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef

--- rt/Makefile.~1~	Sat May 16 07:35:06 1998
+++ rt/Makefile	Fri Mar 19 20:10:48 1999
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999 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
@@ -49,4 +49,8 @@
 # a statically-linked program that hasn't already loaded it.
 $(objpfx)librt.so: $(common-objpfx)libc.so $(shared-thread-library)
 
+ifeq (yes,$(build-shared))
 $(objpfx)tst-aio: $(objpfx)librt.so $(shared-thread-library)
+else
+$(objpfx)tst-aio: $(objpfx)librt.a $(static-thread-library)
+endif
\ No newline at end of file

-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]