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

[commits] r10277 - in /fsf/trunk/libc: ChangeLog Makeconfig elf/Makefile stdio-common/tst-fmemopen.c



Author: eglibc
Date: Tue Apr 20 00:03:53 2010
New Revision: 10277

Log:
Import glibc-mainline for 2010-04-20

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/Makeconfig
    fsf/trunk/libc/elf/Makefile
    fsf/trunk/libc/stdio-common/tst-fmemopen.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Apr 20 00:03:53 2010
@@ -1,3 +1,13 @@
+2010-04-19  Roland McGrath  <roland@xxxxxxxxxx>
+
+	* elf/Makefile ($(objpfx)noload): Depend on libdl.so.
+
+	* Makeconfig (as-needed, no-as-needed): New variables.
+	(link-libc): Add ld.so inside --as-needed.
+
+	* stdio-common/tst-fmemopen.c (TEST_FILE): Macro removed.
+	(main): Take arguments.  Construct test file name from ARGV[0].
+
 2010-04-15  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
 	* string/test-strncmp.c (check_result): New function.

Modified: fsf/trunk/libc/Makeconfig
==============================================================================
--- fsf/trunk/libc/Makeconfig (original)
+++ fsf/trunk/libc/Makeconfig Tue Apr 20 00:03:53 2010
@@ -387,6 +387,14 @@
 have-initfini = yes
 endif
 
+ifeq ($(have-as-needed),yes)
+as-needed := -Wl,--as-needed
+no-as-needed := -Wl,--no-as-needed
+else
+as-needed :=
+no-as-needed :=
+endif
+
 # Installed name of the startup code.
 ifneq ($(have-initfini),yes)
 # When not having init/fini, there is just one startfile, called crt0.o.
@@ -484,7 +492,8 @@
 # run the linked programs.
 link-libc = -Wl,-rpath-link=$(rpath-link) \
 	    $(common-objpfx)libc.so$(libc.so-version) \
-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
+	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
+	    $(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed) $(gnulib)
 # This is how to find at build-time things that will be installed there.
 rpath-dirs = math elf dlfcn nss nis rt resolv crypt
 endif

Modified: fsf/trunk/libc/elf/Makefile
==============================================================================
--- fsf/trunk/libc/elf/Makefile (original)
+++ fsf/trunk/libc/elf/Makefile Tue Apr 20 00:03:53 2010
@@ -1,4 +1,4 @@
-# Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1995-2007,2008,2009,2010 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
@@ -654,7 +654,7 @@
 $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so)
 vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so)
 
-$(objpfx)noload: $(objpfx)testobj1.so
+$(objpfx)noload: $(objpfx)testobj1.so $(common-objpfx)dlfcn/libdl.so
 LDFLAGS-noload = -rdynamic
 $(objpfx)noload.out: $(objpfx)testobj5.so
 

Modified: fsf/trunk/libc/stdio-common/tst-fmemopen.c
==============================================================================
--- fsf/trunk/libc/stdio-common/tst-fmemopen.c (original)
+++ fsf/trunk/libc/stdio-common/tst-fmemopen.c Tue Apr 20 00:03:53 2010
@@ -8,11 +8,10 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#define TEST_FILE "test-1"
-
 int
-main (void)
+main (int argc, char **argv)
 {
+  const char *test_file;
   const char blah[] = "BLAH";
   FILE *fp;
   char *mmap_data;
@@ -20,8 +19,14 @@
   struct stat fs;
   const char *cp;
 
+  /* Construct the test file name based on ARGV[0], which will be
+     an absolute file name in the build directory.  Don't touch the
+     source directory, which might be read-only.  */
+  if (argc != 1 || asprintf (&test_file, "%s.test", argv[0]) < 0)
+    exit (99);
+
   /* setup the physical file, and use it */
-  if ((fp = fopen (TEST_FILE, "w+")) == NULL)
+  if ((fp = fopen (test_file, "w+")) == NULL)
     exit (1);
   if (fwrite (blah, 1, strlen (blah), fp) != strlen (blah))
     exit (2);
@@ -56,7 +61,7 @@
   fclose (fp);
 
   /* Now, mmap the file into a buffer, and do that too */
-  if ((fd = open (TEST_FILE, O_RDONLY)) == -1)
+  if ((fd = open (test_file, O_RDONLY)) == -1)
     exit (3);
   if (fstat (fd, &fs) == -1)
     exit (4);
@@ -105,7 +110,8 @@
 
   munmap (mmap_data, fs.st_size);
 
-  unlink (TEST_FILE);
+  unlink (test_file);
+  free (test_file);
 
   return 0;
 }