Author: ps-guest Date: 2013-05-08 12:39:03 +0000 (Wed, 08 May 2013) New Revision: 5561
Added: glibc-package/trunk/debian/patches/kfreebsd/local-linuxthreads-initfini.diff glibc-package/trunk/debian/patches/kfreebsd/local-no-pldd.diff glibc-package/trunk/debian/patches/kfreebsd/local-nscd-nosendfile-fix.diff Modified: glibc-package/trunk/debian/changelog glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff glibc-package/trunk/debian/patches/series.kfreebsd-amd64 glibc-package/trunk/debian/patches/series.kfreebsd-i386 Log: kfreebsd patches Modified: glibc-package/trunk/debian/changelog =================================================================== --- glibc-package/trunk/debian/changelog 2013-05-08 12:30:04 UTC (rev 5560) +++ glibc-package/trunk/debian/changelog 2013-05-08 12:39:03 UTC (rev 5561) @@ -13,7 +13,14 @@ conditional defines on USE___THREAD and HAVE_TLS_SUPPORT. * patches/kfreebsd/local-linuxthreads-mutex-initializer.diff: New patch to define MUTEX_INITIALIZER. - * kfreebsd/local-sysdeps.diff: update to revision 4412 (from glibc-bsd). + + [ Petr Salinger ] + * patches/kfreebsd/local-linuxthreads-initfini.diff: follow upstream + changes in startup code + * patches/kfreebsd/local-no-pldd.diff: pldd is linux only utility + * patches/kfreebsd/local-nscd-nosendfile-fix.diff: handle system without + sendfile syscall + * kfreebsd/local-sysdeps.diff: update to revision 4417 (from glibc-bsd). -- Adam Conrad <adcon...@0c3.net> Tue, 07 May 2013 13:58:05 -0600 Added: glibc-package/trunk/debian/patches/kfreebsd/local-linuxthreads-initfini.diff =================================================================== --- glibc-package/trunk/debian/patches/kfreebsd/local-linuxthreads-initfini.diff (rev 0) +++ glibc-package/trunk/debian/patches/kfreebsd/local-linuxthreads-initfini.diff 2013-05-08 12:39:03 UTC (rev 5561) @@ -0,0 +1,70 @@ +--- a/linuxthreads/Makefile ++++ b/linuxthreads/Makefile +@@ -97,12 +97,11 @@ + generated-dirs := $(firstword $(subst /, , $(multidir))) + crti-objs += $(multidir)/crti.o + crtn-objs += $(multidir)/crtn.o +-omit-deps += $(multidir)/crti $(multidir)/crtn ++$(objpfx)$(multidir): ++ mkdir -p $@ + endif + extra-objs += $(crti-objs) $(crtn-objs) +-omit-deps += crti crtn +- +-CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time) ++extra-objs += pt-crti.o + endif + + librt-tests = ex10 ex11 tst-clock1 +@@ -234,7 +234,7 @@ + # a statically-linked program that hasn't already loaded it. + # Depend on ld.so too to get proper versions of ld.so symbols. + $(objpfx)libpthread.so: $(libc-link.so) $(common-objpfx)libc_nonshared.a \ +- $(if $(filter yes,$(elf)), $(elfobjdir)/ld.so) ++ $(elfobjdir)/ld.so + + # Make sure we link with the thread library. + ifeq ($(build-shared),yes) +@@ -266,33 +265,6 @@ + endif + + ifeq ($(build-shared),yes) +-vpath pt-initfini.c $(sysdirs) +- +-$(objpfx)pt-initfini.s: pt-initfini.c +- $(compile.c) -S $(CFLAGS-pt-initfini.s) -finhibit-size-directive \ +- $(patsubst -f%,-fno-%,$(exceptions)) -o $@ +- +-# We only have one kind of startup code files. Static binaries and +-# shared libraries are build using the PIC version. +-$(objpfx)crti.S: $(objpfx)pt-initfini.s +- sed -n -e '1,/@HEADER_ENDS/p' \ +- -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \ +- -e '/@TRAILER_BEGINS/,$$p' $< > $@ +-$(objpfx)crtn.S: $(objpfx)pt-initfini.s +- sed -n -e '1,/@HEADER_ENDS/p' \ +- -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \ +- -e '/@TRAILER_BEGINS/,$$p' $< > $@ +- +-$(objpfx)defs.h: $(objpfx)pt-initfini.s +- sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \ +- $(AWK) -f ../csu/defs.awk > $@ +- +-$(objpfx)crti.o: $(objpfx)crti.S $(objpfx)defs.h +- $(compile.S) -g0 $(ASFLAGS-.os) -o $@ +- +-$(objpfx)crtn.o: $(objpfx)crtn.S $(objpfx)defs.h +- $(compile.S) -g0 $(ASFLAGS-.os) -o $@ +- + ifneq ($(multidir),.) + $(objpfx)$(multidir): + @mkdir -p $(objpfx)$(multidir) +@@ -304,7 +275,7 @@ + ln -f $< $@ + endif + +-generated += crti.S crtn.S defs.h pt-initfini.s libpthread_nonshared.a ++generated += libpthread_nonshared.a + endif + + ifeq (yes,$(build-static-nss)) Added: glibc-package/trunk/debian/patches/kfreebsd/local-no-pldd.diff =================================================================== --- glibc-package/trunk/debian/patches/kfreebsd/local-no-pldd.diff (rev 0) +++ glibc-package/trunk/debian/patches/kfreebsd/local-no-pldd.diff 2013-05-08 12:39:03 UTC (rev 5561) @@ -0,0 +1,35 @@ +--- a/elf/pldd.c ++++ b/elf/pldd.c +@@ -90,6 +90,11 @@ + int + main (int argc, char *argv[]) + { ++#if !defined(__linux__) ++ fprintf (stderr," Unsupported utility\n"); ++ return 1; ++#else ++ + /* Parse and process arguments. */ + int remaining; + argp_parse (&argp, argc, argv, 0, &remaining, NULL); +@@ -194,6 +199,7 @@ + close (dfd); + + return status; ++#endif + } + + +@@ -243,6 +249,7 @@ + fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); + } + ++#if defined(__linux__) + + #define CLASS 32 + #include "pldd-xx.c" +@@ -312,3 +319,4 @@ + + return retval; + } ++#endif Added: glibc-package/trunk/debian/patches/kfreebsd/local-nscd-nosendfile-fix.diff =================================================================== --- glibc-package/trunk/debian/patches/kfreebsd/local-nscd-nosendfile-fix.diff (rev 0) +++ glibc-package/trunk/debian/patches/kfreebsd/local-nscd-nosendfile-fix.diff 2013-05-08 12:39:03 UTC (rev 5561) @@ -0,0 +1,11 @@ +--- a/nscd/netgroupcache.c ++++ b/nscd/netgroupcache.c +@@ -587,6 +587,8 @@ + # ifndef __ASSUME_SENDFILE + use_write: + # endif ++#else ++ { + #endif + writeall (fd, &dataset->resp, sizeof (innetgroup_response_header)); + } Modified: glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff =================================================================== --- glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff 2013-05-08 12:30:04 UTC (rev 5560) +++ glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff 2013-05-08 12:39:03 UTC (rev 5561) @@ -175,7 +175,7 @@ + +# Special ELF hacks. +ifeq ($(subdir),elf) -+sysdep-rtld-routines += dl-brk dl-sbrk ++sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd +sysdep_routines += sys_umtx +endif + @@ -5681,7 +5681,7 @@ +# We need some extensions to the `ldd' script. +case "$machine" in + x86_64*) -+ ldd_rewrite_script=../ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/ldd-rewrite.sed ++ ldd_rewrite_script=$dir/x86_64/ldd-rewrite.sed + ;; + *) + ;; @@ -5970,7 +5970,7 @@ +changequote(,) +case "$machine" in + x86_64*) -+ ldd_rewrite_script=../ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/ldd-rewrite.sed ++ ldd_rewrite_script=$dir/x86_64/ldd-rewrite.sed + ;; + *) + ;; @@ -6215,6 +6215,10 @@ +} +rtld_hidden_def (_dl_make_stack_executable) --- /dev/null ++++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-getcwd.c +@@ -0,0 +1 @@ ++#include "getcwd.c" +--- /dev/null +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-origin.c @@ -0,0 +1,123 @@ +/* Find path of executable. @@ -8381,7 +8385,7 @@ +libc_hidden_def (__fxstatat64) --- /dev/null +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/getcwd.c -@@ -0,0 +1,91 @@ +@@ -0,0 +1,110 @@ +/* Determine current working directory. FreeBSD version. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. @@ -8411,6 +8415,12 @@ +#include <sysdep.h> +#include <bp-checks.h> + ++/* If we compile the file for use in ld.so we don't need the feature ++ that getcwd() allocates the buffers itself. */ ++#ifdef IS_IN_rtld ++# define NO_ALLOCATION 1 ++#endif ++ +/* The system calls only makes a lookup in the VFS cache, which can easily + fail. Therefore we use the generic version as a fallback. */ +extern int __syscall_getcwd (char *__unbounded buf, unsigned int size); @@ -8434,8 +8444,11 @@ + __set_errno (EINVAL); + return NULL; + } -+ ++#ifdef NO_ALLOCATION ++ buf = NULL; ++#else + buf = (char *) malloc (len); ++#endif + if (__builtin_expect (buf == NULL, 0)) + { + __set_errno (ENOMEM); @@ -8452,7 +8465,11 @@ + + if (buf == NULL) + { ++#ifdef NO_ALLOCATION ++ buf = NULL; ++#else + buf = (char *) malloc (size); ++#endif + if (__builtin_expect (buf == NULL, 0)) + { + __set_errno (ENOMEM); @@ -8464,15 +8481,21 @@ + memcpy (buf, tmpbuf, len); + return buf; + } ++#ifdef IS_IN_rtld ++ return NULL; ++#else + return generic_getcwd (buf, size); ++#endif +} + +weak_alias (__getcwd, getcwd) + ++#ifndef IS_IN_rtld +/* Get the code for the generic version. */ +#define GETCWD_RETURN_TYPE static char * internal_function +#define __getcwd generic_getcwd +#include <sysdeps/posix/getcwd.c> ++#endif --- /dev/null +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/getdents.c @@ -0,0 +1,90 @@ @@ -10493,7 +10516,7 @@ + { "libm.so.8", FLAG_ELF_LIBC5 }, --- /dev/null +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/linuxthreads/pt-machine.h -@@ -0,0 +1,76 @@ +@@ -0,0 +1,79 @@ +/* Machine-dependent pthreads configuration and inline functions. + ix86 version for FreeBSD. + Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc. @@ -10518,6 +10541,9 @@ +#ifndef _FREEBSD_PT_MACHINE_H +#define _FREEBSD_PT_MACHINE_H 1 + ++#define HAVE___THREAD 1 ++#define USE_TLS 1 ++ +/* + some parts are common with linux/i386 version + @@ -14269,6 +14295,52 @@ + +#endif /* lowlevellock.h */ --- /dev/null ++++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/linuxthreads/pt-crti.S +@@ -0,0 +1,43 @@ ++/* Special .init and .fini section support for libpthread. ++ Copyright (C) 2012 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. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file with other ++ programs, and to distribute those programs without any restriction ++ coming from the use of this file. (The GNU Lesser General Public ++ License restrictions do apply in other respects; for example, they ++ cover modification of the file, and distribution when not linked ++ into another program.) ++ ++ Note that people who make modified versions of this file are not ++ obligated to grant this special exception for their modified ++ versions; it is their choice whether to do so. The GNU Lesser ++ General Public License gives permission to release a modified ++ version without this exception; this exception also makes it ++ possible to release a modified version which carries forward this ++ exception. ++ ++ 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/>. */ ++ ++/* Arrange for __pthread_initialize_minimal_internal to be called at ++ libpthread startup, instead of conditionally calling ++ __gmon_start__. */ ++ ++#define PREINIT_FUNCTION __pthread_initialize_minimal_internal ++#define PREINIT_FUNCTION_WEAK 0 ++ ++#include <crti.S> +--- /dev/null +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/linuxthreads/pt-sigsuspend.S @@ -0,0 +1,29 @@ +/* Internal sigsuspend system call for LinuxThreads. FreeBSD version. @@ -15604,7 +15676,7 @@ +#define ENTRY_POINT __start --- /dev/null +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/linuxthreads/pt-machine.h -@@ -0,0 +1,49 @@ +@@ -0,0 +1,52 @@ +/* Machine-dependent pthreads configuration and inline functions. + MIPS kFreeBSD version. + Copyright (C) 2001, 2002, 2003, 2004, 2010 Free Software Foundation, Inc. @@ -15628,6 +15700,9 @@ +#ifndef _FREEBSD_PT_MACHINE_H +#define _FREEBSD_PT_MACHINE_H 1 + ++#define HAVE___THREAD 1 ++#define USE_TLS 1 ++ +/* + almost all parts are common with linux version + */ @@ -22822,15 +22897,6 @@ +/* use stub only variant */ +#include <misc/stty.c> --- /dev/null -+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/svn-commit.tmp -@@ -0,0 +1,6 @@ -+ -+--Cette ligne, et les suivantes ci-dessous, seront ignorées-- -+ -+M mips/linuxthreads/tls.h -+M x86_64/linuxthreads/tls.h -+M i386/linuxthreads/tls.h ---- /dev/null +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/symlinkat.c @@ -0,0 +1,126 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. @@ -27528,7 +27594,7 @@ +/* placeholder to make linuxthreads/sysdeps/x86_64/pt-machine.h happy */ --- /dev/null +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/linuxthreads/pt-machine.h -@@ -0,0 +1,51 @@ +@@ -0,0 +1,54 @@ +/* Machine-dependent pthreads configuration and inline functions. + x86-64 FreeBSD version. + Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. @@ -27552,6 +27618,9 @@ +#ifndef _FREEBSD_PT_MACHINE_H +#define _FREEBSD_PT_MACHINE_H 1 + ++#define HAVE___THREAD 1 ++#define USE_TLS 1 ++ +/* + almost all parts are common with linux version + */ Modified: glibc-package/trunk/debian/patches/series.kfreebsd-amd64 =================================================================== --- glibc-package/trunk/debian/patches/series.kfreebsd-amd64 2013-05-08 12:30:04 UTC (rev 5560) +++ glibc-package/trunk/debian/patches/series.kfreebsd-amd64 2013-05-08 12:39:03 UTC (rev 5561) @@ -9,3 +9,6 @@ kfreebsd/local-initgroups-order.diff kfreebsd/local-linuxthreads-TLS-THREAD.diff kfreebsd/local-linuxthreads-mutex-initializer.diff +kfreebsd/local-linuxthreads-initfini.diff +kfreebsd/local-no-pldd.diff +kfreebsd/local-nscd-nosendfile-fix.diff Modified: glibc-package/trunk/debian/patches/series.kfreebsd-i386 =================================================================== --- glibc-package/trunk/debian/patches/series.kfreebsd-i386 2013-05-08 12:30:04 UTC (rev 5560) +++ glibc-package/trunk/debian/patches/series.kfreebsd-i386 2013-05-08 12:39:03 UTC (rev 5561) @@ -9,3 +9,6 @@ kfreebsd/local-initgroups-order.diff kfreebsd/local-linuxthreads-TLS-THREAD.diff kfreebsd/local-linuxthreads-mutex-initializer.diff +kfreebsd/local-linuxthreads-initfini.diff +kfreebsd/local-no-pldd.diff +kfreebsd/local-nscd-nosendfile-fix.diff -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1ua3eb-0001th...@vasks.debian.org