toolchain: The glorious return of glibc, ver 2.21

It's the eglibc packaging with a bit of spit-polishing. And testing. :-)

[blogic: merged glibc and eglibc into 1 and made eglibc a glibc variant]

Signed-off-by: Jeff Waugh <jdub@bethesignal.org>
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 44701
This commit is contained in:
John Crispin 2015-03-12 19:50:57 +00:00
parent eff1859f8e
commit 3e2f578353
36 changed files with 540 additions and 61 deletions

View file

@ -135,7 +135,7 @@ menu "Global build settings"
choice choice
prompt "Binary stripping method" prompt "Binary stripping method"
default USE_STRIP if EXTERNAL_TOOLCHAIN default USE_STRIP if EXTERNAL_TOOLCHAIN
default USE_STRIP if USE_GLIBC || USE_EGLIBC || USE_MUSL default USE_STRIP if USE_GLIBC || USE_MUSL
default USE_SSTRIP default USE_SSTRIP
help help
Select the binary stripping method you wish to use. Select the binary stripping method you wish to use.
@ -156,7 +156,6 @@ menu "Global build settings"
bool "sstrip" bool "sstrip"
depends on !DEBUG depends on !DEBUG
depends on !USE_GLIBC depends on !USE_GLIBC
depends on !USE_EGLIBC
help help
This will install binaries stripped using sstrip. This will install binaries stripped using sstrip.
endchoice endchoice
@ -187,7 +186,7 @@ menu "Global build settings"
choice choice
prompt "Preferred standard C++ library" prompt "Preferred standard C++ library"
default USE_LIBSTDCXX if USE_EGLIBC default USE_LIBSTDCXX if USE_GLIBC
default USE_UCLIBCXX default USE_UCLIBCXX
help help
Select the preferred standard C++ library for all packages that support this. Select the preferred standard C++ library for all packages that support this.

View file

@ -5,7 +5,7 @@
# See /LICENSE for more information. # See /LICENSE for more information.
# #
PKG_DEFAULT_DEPENDS = +libc +USE_EGLIBC:librt +USE_EGLIBC:libpthread PKG_DEFAULT_DEPENDS = +libc +USE_GLIBC:librt +USE_GLIBC:libpthread
ifneq ($(PKG_NAME),toolchain) ifneq ($(PKG_NAME),toolchain)
PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2))) PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2)))

View file

@ -55,7 +55,7 @@ endef
VERSION_TAINT_SPECS := \ VERSION_TAINT_SPECS := \
-ALL:no-all \ -ALL:no-all \
-IPV6:no-ipv6 \ -IPV6:no-ipv6 \
+USE_EGLIBC:eglibc \ +USE_GLIBC:glibc \
+USE_MKLIBS:mklibs \ +USE_MKLIBS:mklibs \
+BUSYBOX_CUSTOM:busybox \ +BUSYBOX_CUSTOM:busybox \
+OVERRIDE_PKGS:override \ +OVERRIDE_PKGS:override \

View file

@ -420,12 +420,12 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
$(CP) $(TOOLCHAIN_DIR)/lib/libstdc++.so.* $(1)/usr/lib/ $(CP) $(TOOLCHAIN_DIR)/lib/libstdc++.so.* $(1)/usr/lib/
endef endef
use_libutil=$(if $(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),libutil) use_libutil=$(if $(CONFIG_GLIBC_USE_VERSION_2_21)$(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),libutil)
use_libnsl=$(if $(CONFIG_EGLIBC_OPTION_EGLIBC_NIS),libnsl) use_libnsl=$(if $(CONFIG_GLIBC_USE_VERSION_2_21)$(CONFIG_EGLIBC_OPTION_EGLIBC_NIS),libnsl)
use_nsswitch=$(if $(CONFIG_EGLIBC_OPTION_EGLIBC_NSSWITCH),libnss_dns libnss_files) use_nsswitch=$(if $(CONFIG_GLIBC_USE_VERSION_2_21)$(CONFIG_EGLIBC_OPTION_EGLIBC_NSSWITCH),libnss_dns libnss_files)
define Package/eglibc/install define Package/glibc/install
$(CP) ./eglibc-files/* $(1)/ $(CP) ./glibc-files/* $(1)/
rm -f $(1)/etc/localtime rm -f $(1)/etc/localtime
$(LN) /tmp/localtime $(1)/etc/localtime $(LN) /tmp/localtime $(1)/etc/localtime
$(INSTALL_DIR) $(1)/lib $(INSTALL_DIR) $(1)/lib

View file

@ -0,0 +1,13 @@
passwd:files
shadow:files
group:files
hosts:dns files
bootparams:files
ethers:files
netmasks:files
networks:files
protocols:files
rpc:files
services:files
automount:files
aliases:files

View file

@ -211,14 +211,13 @@ comment "C Library"
choice choice
prompt "C Library implementation" if TOOLCHAINOPTS prompt "C Library implementation" if TOOLCHAINOPTS
default LIBC_USE_EGLIBC if (aarch64 || aarch64_be) default LIBC_USE_GLIBC if (aarch64 || aarch64_be)
default LIBC_USE_UCLIBC
help help
Select the C library implementation. Select the C library implementation.
config LIBC_USE_EGLIBC config LIBC_USE_GLIBC
bool "Use eglibc" bool "Use glibc"
select USE_EGLIBC select USE_GLIBC
depends on !avr32 depends on !avr32
config LIBC_USE_UCLIBC config LIBC_USE_UCLIBC
@ -233,7 +232,7 @@ choice
endchoice endchoice
source "toolchain/eglibc/Config.in" source "toolchain/glibc/Config.in"
source "toolchain/uClibc/Config.in" source "toolchain/uClibc/Config.in"
source "toolchain/musl/Config.in" source "toolchain/musl/Config.in"
@ -256,7 +255,7 @@ config INSIGHT
help help
Enable if you want to build insight-gdb. Enable if you want to build insight-gdb.
config USE_EGLIBC config USE_GLIBC
bool bool
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (aarch64 || aarch64_be || octeon) default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (aarch64 || aarch64_be || octeon)
@ -273,26 +272,26 @@ config USE_EXTERNAL_LIBC
source "toolchain/gcc/Config.version" source "toolchain/gcc/Config.version"
source "toolchain/eglibc/Config.version" source "toolchain/glibc/Config.version"
source "toolchain/uClibc/Config.version" source "toolchain/uClibc/Config.version"
source "toolchain/musl/Config.version" source "toolchain/musl/Config.version"
config LIBC config LIBC
string string
default "eglibc" if USE_EGLIBC default "glibc" if USE_GLIBC
default "uClibc" if USE_UCLIBC default "uClibc" if USE_UCLIBC
default "musl" if USE_MUSL default "musl" if USE_MUSL
config LIBC_VERSION config LIBC_VERSION
string string
default EGLIBC_VERSION if USE_EGLIBC default GLIBC_VERSION if USE_GLIBC
default UCLIBC_VERSION if USE_UCLIBC default UCLIBC_VERSION if USE_UCLIBC
default MUSL_VERSION if USE_MUSL default MUSL_VERSION if USE_MUSL
config TARGET_SUFFIX config TARGET_SUFFIX
string string
default "gnueabi" if USE_EGLIBC && (arm || armeb) default "gnueabi" if USE_GLIBC && (arm || armeb)
default "gnu" if USE_EGLIBC && !(arm || armeb) default "gnu" if USE_GLIBC && !(arm || armeb)
default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb) default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb)
default "uclibc" if USE_UCLIBC && !(arm || armeb) default "uclibc" if USE_UCLIBC && !(arm || armeb)
default "muslgnueabi" if USE_MUSL && (arm || armeb) default "muslgnueabi" if USE_MUSL && (arm || armeb)

View file

@ -1,22 +0,0 @@
choice
prompt "eglibc version"
depends on TOOLCHAINOPTS && USE_EGLIBC
default EGLIBC_USE_VERSION_2_19
help
Select the version of eglibc you wish to use.
config EGLIBC_USE_VERSION_2_15
bool "eglibc 2.15"
select EGLIBC_VERSION_2_15
depends on BROKEN
config EGLIBC_USE_VERSION_2_19
bool "eglibc 2.19"
select EGLIBC_VERSION_2_19
endchoice
menu "eglibc configuration"
depends on TOOLCHAINOPTS && USE_EGLIBC
source toolchain/eglibc/config/Config.in
endmenu

26
toolchain/glibc/Config.in Normal file
View file

@ -0,0 +1,26 @@
choice
prompt "(e)glibc version"
depends on TOOLCHAINOPTS && USE_GLIBC
default EGLIBC_USE_VERSION_2_19
help
Select the version of glibc you wish to use.
config EGLIBC_USE_VERSION_2_15
bool "eglibc 2.15"
select EGLIBC_VERSION_2_15
depends on BROKEN
config EGLIBC_USE_VERSION_2_19
bool "eglibc 2.19"
select EGLIBC_VERSION_2_19
config GLIBC_USE_VERSION_2_21
bool "glibc 2.21"
select GLIBC_VERSION_2_21
endchoice
menu "eglibc configuration"
depends on TOOLCHAINOPTS && USE_GLIBC && (EGLIBC_USE_VERSION_2_15 || EGLIBC_USE_VERSION_2_19)
source toolchain/glibc/config/Config.in
endmenu

View file

@ -1,9 +1,10 @@
if USE_EGLIBC if USE_GLIBC
config EGLIBC_VERSION config GLIBC_VERSION
string string
default "2.15" if EGLIBC_VERSION_2_15 default "2.15" if EGLIBC_VERSION_2_15
default "2.19" if EGLIBC_VERSION_2_19 default "2.19" if EGLIBC_VERSION_2_19
default "2.21" if GLIBC_VERSION_2_21
config EGLIBC_VERSION_2_15 config EGLIBC_VERSION_2_15
bool bool
@ -12,15 +13,15 @@ config EGLIBC_VERSION_2_19
default y if !TOOLCHAINOPTS default y if !TOOLCHAINOPTS
bool bool
config EGLIBC_REVISION config GLIBC_VERSION_2_21
default y if !TOOLCHAINOPTS
bool
config GLIBC_REVISION
string string
default "18909" if EGLIBC_VERSION_2_15 default "18909" if EGLIBC_VERSION_2_15
default "25243" if EGLIBC_VERSION_2_19 default "25243" if EGLIBC_VERSION_2_19
default "4e42b5b8f8" if GLIBC_VERSION_2_21
default "" default ""
endif endif
menu "eglibc configuration"
depends on !TOOLCHAINOPTS && USE_EGLIBC
source toolchain/eglibc/config/Config.in
endmenu

View file

@ -6,19 +6,27 @@
# #
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=eglibc PKG_NAME:=glibc
PKG_VERSION:=$(call qstrip,$(CONFIG_EGLIBC_VERSION)) PKG_VERSION:=$(call qstrip,$(CONFIG_GLIBC_VERSION))
PKG_REVISION:=$(call qstrip,$(CONFIG_EGLIBC_REVISION)) PKG_REVISION:=$(call qstrip,$(CONFIG_GLIBC_REVISION))
PKG_SOURCE_PROTO:=svn PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git://sourceware.org/git/glibc.git
PKG_SOURCE_VERSION:=$(PKG_REVISION) PKG_SOURCE_VERSION:=$(PKG_REVISION)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-r$(PKG_REVISION) PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-r$(PKG_REVISION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.bz2 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.bz2
GLIBC_PATH:=
ifneq ($(CONFIG_EGLIBC_VERSION_2_15),) ifneq ($(CONFIG_EGLIBC_VERSION_2_15),)
GLIBC_PATH:=libc/
PKG_SOURCE_PROTO:=svn
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.bz2
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_15 PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_15
endif endif
ifneq ($(CONFIG_EGLIBC_VERSION_2_19),) ifneq ($(CONFIG_EGLIBC_VERSION_2_19),)
GLIBC_PATH:=libc/
PKG_SOURCE_PROTO:=svn
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.bz2
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_19 PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_19
endif endif
@ -32,7 +40,7 @@ include $(INCLUDE_DIR)/toolchain-build.mk
HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared
HOST_STAMP_CONFIGURED:=$(CUR_BUILD_DIR)/.configured HOST_STAMP_CONFIGURED:=$(CUR_BUILD_DIR)/.configured
HOST_STAMP_BUILT:=$(CUR_BUILD_DIR)/.built HOST_STAMP_BUILT:=$(CUR_BUILD_DIR)/.built
HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.eglibc_$(VARIANT)_installed HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.glibc_$(VARIANT)_installed
ifeq ($(ARCH),mips64) ifeq ($(ARCH),mips64)
ifdef CONFIG_MIPS64_ABI_N64 ifdef CONFIG_MIPS64_ABI_N64
@ -46,18 +54,19 @@ ifeq ($(ARCH),mips64)
endif endif
endif endif
EGLIBC_CONFIGURE:= \ GLIBC_CONFIGURE:= \
BUILD_CC="$(HOSTCC)" \ BUILD_CC="$(HOSTCC)" \
$(TARGET_CONFIGURE_OPTS) \ $(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \ CFLAGS="$(TARGET_CFLAGS)" \
libc_cv_slibdir="/lib" \ libc_cv_slibdir="/lib" \
use_ldconfig=no \ use_ldconfig=no \
$(HOST_BUILD_DIR)/libc/configure \ $(HOST_BUILD_DIR)/$(GLIBC_PATH)configure \
--prefix= \ --prefix= \
--build=$(GNU_HOST_NAME) \ --build=$(GNU_HOST_NAME) \
--host=$(REAL_GNU_TARGET_NAME) \ --host=$(REAL_GNU_TARGET_NAME) \
--with-headers=$(TOOLCHAIN_DIR)/include \ --with-headers=$(TOOLCHAIN_DIR)/include \
--disable-profile \ --disable-profile \
--disable-werror \
--without-gd \ --without-gd \
--without-cvs \ --without-cvs \
--enable-add-ons \ --enable-add-ons \
@ -69,31 +78,37 @@ export HOST_CFLAGS := $(HOST_CFLAGS) -idirafter $(CURDIR)/$(PATH_PREFIX)/include
define Host/SetToolchainInfo define Host/SetToolchainInfo
$(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
ifneq ($(CONFIG_GLIBC_VERSION_2_21),)
$(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.gnu.org/software/libc/,' $(TOOLCHAIN_DIR)/info.mk
else
$(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.eglibc.org/,' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.eglibc.org/,' $(TOOLCHAIN_DIR)/info.mk
endif
$(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
endef endef
define Host/Configure define Host/Configure
[ -f $(HOST_BUILD_DIR)/.autoconf ] || { \ [ -f $(HOST_BUILD_DIR)/.autoconf ] || { \
cd $(HOST_BUILD_DIR)/libc; \ cd $(HOST_BUILD_DIR)/$(GLIBC_PATH); \
autoconf --force && \ autoconf --force && \
touch $(HOST_BUILD_DIR)/.autoconf; \ touch $(HOST_BUILD_DIR)/.autoconf; \
} }
mkdir -p $(CUR_BUILD_DIR) mkdir -p $(CUR_BUILD_DIR)
grep 'CONFIG_EGLIBC_OPTION_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_EGLIBC_\\(.*\\),\\1\\2,g" > $(CUR_BUILD_DIR)/option-groups.config grep 'CONFIG_EGLIBC_OPTION_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_EGLIBC_\\(.*\\),\\1\\2,g" > $(CUR_BUILD_DIR)/option-groups.config
( cd $(CUR_BUILD_DIR); rm -f config.cache; \ ( cd $(CUR_BUILD_DIR); rm -f config.cache; \
$(EGLIBC_CONFIGURE) \ $(GLIBC_CONFIGURE) \
); );
endef endef
define Host/Prepare define Host/Prepare
$(call Host/Prepare/Default) $(call Host/Prepare/Default)
ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
ifeq ($(CONFIG_GLIBC_VERSION_2_21),)
$(SED) 's,y,n,' $(HOST_BUILD_DIR)/libc/option-groups.defaults $(SED) 's,y,n,' $(HOST_BUILD_DIR)/libc/option-groups.defaults
ifneq ($(CONFIG_EGLIBC_VERSION_2_15),) ifneq ($(CONFIG_EGLIBC_VERSION_2_15),)
ln -sf ../ports $(HOST_BUILD_DIR)/libc/ ln -sf ../ports $(HOST_BUILD_DIR)/libc/
endif endif
endif
endef endef
define Host/Clean define Host/Clean

View file

@ -0,0 +1,52 @@
--- a/sunrpc/rpc/types.h
+++ b/sunrpc/rpc/types.h
@@ -75,18 +75,23 @@ typedef unsigned long rpcport_t;
#endif
#ifndef __u_char_defined
-typedef __u_char u_char;
-typedef __u_short u_short;
-typedef __u_int u_int;
-typedef __u_long u_long;
-typedef __quad_t quad_t;
-typedef __u_quad_t u_quad_t;
-typedef __fsid_t fsid_t;
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+#if __WORDSIZE == 64
+typedef long int quad_t;
+typedef unsigned long int u_quad_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+typedef long long int quad_t;
+typedef unsigned long long int u_quad_t;
+#endif
+typedef u_quad_t fsid_t;
# define __u_char_defined
#endif
-#ifndef __daddr_t_defined
-typedef __daddr_t daddr_t;
-typedef __caddr_t caddr_t;
+#if !defined(__daddr_t_defined) && defined(linux)
+typedef long int daddr_t;
+typedef char *caddr_t;
# define __daddr_t_defined
#endif
--- a/sunrpc/rpc_main.c
+++ b/sunrpc/rpc_main.c
@@ -958,9 +958,10 @@ mkfile_output (struct commandline *cmd)
abort ();
temp = rindex (cmd->infile, '.');
cp = stpcpy (mkfilename, "Makefile.");
- if (temp != NULL)
- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
- else
+ if (temp != NULL) {
+ strncpy(cp, cmd->infile, temp - cmd->infile);
+ cp[temp - cmd->infile - 1] = 0;
+ } else
stpcpy (cp, cmd->infile);
}

View file

@ -0,0 +1,14 @@
add /usr/lib to default search path for the dynamic linker
--- a/Makeconfig
+++ b/Makeconfig
@@ -501,6 +501,9 @@ else
default-rpath = $(libdir)
endif
+# Add /usr/lib to default search path for the dynamic linker
+user-defined-trusted-dirs := /usr/lib
+
ifndef link-extra-libs
link-extra-libs = $(LDLIBS-$(@F))
link-extra-libs-static = $(link-extra-libs)

View file

@ -0,0 +1,48 @@
--- a/libc/aclocal.m4
+++ b/libc/aclocal.m4
@@ -88,6 +88,12 @@
fi
rm -fr contest*])
+dnl Test a compiler option or options with an empty input file.
+dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false])
+AC_DEFUN([LIBC_TRY_CC_OPTION],
+[AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])],
+ [$2], [$3])])
+
AC_DEFUN([LIBC_PROG_BINUTILS],
[# Was a --with-binutils option given?
if test -n "$path_binutils"; then
--- a/libc/configure
+++ b/libc/configure
@@ -7404,7 +7404,14 @@
else
libc_cv_cc_nofma=
for opt in -ffp-contract=off -mno-fused-madd; do
- LIBC_TRY_CC_OPTION($opt, libc_cv_cc_nofma=$opt; break)
+ if { ac_try='${CC-cc} $opt -xc /dev/null -S -o /dev/null'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ libc_cv_cc_nofma=$opt; break
+fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_nofma" >&5
--- a/libc/configure.in
+++ b/libc/configure.in
@@ -2238,10 +2238,9 @@
libc_cv_cc_submachine, [dnl
libc_cv_cc_submachine=no
for opt in "-march=$submachine" "-mcpu=$submachine"; do
- if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
+ LIBC_TRY_CC_OPTION([$opt], [
libc_cv_cc_submachine="$opt"
- break
- fi
+ break], [])
done])
if test "x$libc_cv_cc_submachine" = xno; then
AC_MSG_ERROR([${CC-cc} does not support $submachine])

View file

@ -0,0 +1,11 @@
--- a/libc/configure.in
+++ b/libc/configure.in
@@ -1037,7 +1037,7 @@
critic_missing="$critic_missing gcc")
AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
[GNU Make[^0-9]*\([0-9][0-9.]*\)],
- [3.79* | 3.[89]*], critic_missing="$critic_missing make")
+ [3.79* | 3.[89]* | 4.* ], critic_missing="$critic_missing make")
AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
[GNU gettext.* \([0-9]*\.[0-9.]*\)],

View file

@ -0,0 +1,110 @@
partially revert commit 4bff6e0175ed195871f4e01cc4c4c33274b8f6e3 - caused segmentation faults in dlopen
References:
http://comments.gmane.org/gmane.comp.lib.glibc.user/1227
http://sourceware.org/ml/libc-alpha/2011-06/msg00006.html
diff --git a/libc/elf/dl-close.c b/libc/elf/dl-close.c
index 4b17bf8..733cc1b 100644
--- a/libc/elf/dl-close.c
+++ b/libc/elf/dl-close.c
@@ -119,17 +119,8 @@ _dl_close_worker (struct link_map *map)
if (map->l_direct_opencount > 0 || map->l_type != lt_loaded
|| dl_close_state != not_pending)
{
- if (map->l_direct_opencount == 0)
- {
- if (map->l_type == lt_loaded)
- dl_close_state = rerun;
- else if (map->l_type == lt_library)
- {
- struct link_map **oldp = map->l_initfini;
- map->l_initfini = map->l_orig_initfini;
- _dl_scope_free (oldp);
- }
- }
+ if (map->l_direct_opencount == 0 && map->l_type == lt_loaded)
+ dl_close_state = rerun;
/* There are still references to this object. Do nothing more. */
if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0))
diff --git a/libc/elf/dl-deps.c b/libc/elf/dl-deps.c
index 51cb2fa..eddcbf0 100644
--- a/libc/elf/dl-deps.c
+++ b/libc/elf/dl-deps.c
@@ -489,6 +489,7 @@ _dl_map_object_deps (struct link_map *map,
nneeded * sizeof needed[0]);
atomic_write_barrier ();
l->l_initfini = l_initfini;
+ l->l_free_initfini = 1;
}
/* If we have no auxiliary objects just go on to the next map. */
@@ -689,6 +690,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
l_initfini[nlist] = NULL;
atomic_write_barrier ();
map->l_initfini = l_initfini;
+ map->l_free_initfini = 1;
if (l_reldeps != NULL)
{
atomic_write_barrier ();
@@ -697,7 +699,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
_dl_scope_free (old_l_reldeps);
}
if (old_l_initfini != NULL)
- map->l_orig_initfini = old_l_initfini;
+ _dl_scope_free (old_l_initfini);
if (errno_reason)
_dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
diff --git a/libc/elf/dl-libc.c b/libc/elf/dl-libc.c
index f44fa10..7563093 100644
--- a/libc/elf/dl-libc.c
+++ b/libc/elf/dl-libc.c
@@ -284,6 +284,10 @@ libc_freeres_fn (free_mem)
if (! old->dont_free)
free (old);
}
+
+ /* Free the initfini dependency list. */
+ if (l->l_free_initfini)
+ free (l->l_initfini);
}
if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0
diff --git a/libc/elf/rtld.c b/libc/elf/rtld.c
index b93a01f..2fc83ce 100644
--- a/libc/elf/rtld.c
+++ b/libc/elf/rtld.c
@@ -2277,6 +2277,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
lnp->dont_free = 1;
lnp = lnp->next;
}
+ l->l_free_initfini = 0;
if (l != &GL(dl_rtld_map))
_dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
diff --git a/libc/include/link.h b/libc/include/link.h
index e877104..b1b4065 100644
--- a/libc/include/link.h
+++ b/libc/include/link.h
@@ -192,6 +192,9 @@ struct link_map
during LD_TRACE_PRELINKING=1
contains any DT_SYMBOLIC
libraries. */
+ unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be
+ freed, ie. not allocated with
+ the dummy malloc in ld.so. */
/* Collected information about own RPATH directories. */
struct r_search_path_struct l_rpath_dirs;
@@ -240,9 +243,6 @@ struct link_map
/* List of object in order of the init and fini calls. */
struct link_map **l_initfini;
- /* The init and fini list generated at startup, saved when the
- object is also loaded dynamically. */
- struct link_map **l_orig_initfini;
/* List of the dependencies introduced through symbol binding. */
struct link_map_reldeps

View file

@ -0,0 +1,71 @@
--- a/libc/sunrpc/proto.h
+++ b/libc/sunrpc/proto.h
@@ -56,12 +56,14 @@ void add_type(int len, const char *type)
$build's C library and $host's GLIBC. */
#ifdef _CROSS_RPCGEN_
+#undef stpcpy
+
/* Rather then defining _GNU_SOURCE before including $build's <string.h>
we just declare stpcpy here. */
extern char *stpcpy (char *, const char *);
-/* Use $build's i18n support as we can't use $host's. */
-#define _(X) (gettext (X))
+/* Do not use i18n support */
+#define _(X) (X)
/* rpcgen sources check for __GNU_LIBRARY__ to tweak for GLIBC code
that rpcgen generates. The proper fix would be to rename all those checks
--- a/libc/sunrpc/rpc/types.h
+++ b/libc/sunrpc/rpc/types.h
@@ -70,18 +70,23 @@ typedef unsigned long rpcport_t;
#endif
#ifndef __u_char_defined
-typedef __u_char u_char;
-typedef __u_short u_short;
-typedef __u_int u_int;
-typedef __u_long u_long;
-typedef __quad_t quad_t;
-typedef __u_quad_t u_quad_t;
-typedef __fsid_t fsid_t;
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+#if __WORDSIZE == 64
+typedef long int quad_t;
+typedef unsigned long int u_quad_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+typedef long long int quad_t;
+typedef unsigned long long int u_quad_t;
+#endif
+typedef u_quad_t fsid_t;
# define __u_char_defined
#endif
-#ifndef __daddr_t_defined
-typedef __daddr_t daddr_t;
-typedef __caddr_t caddr_t;
+#if !defined(__daddr_t_defined) && defined(linux)
+typedef long int daddr_t;
+typedef char *caddr_t;
# define __daddr_t_defined
#endif
--- a/libc/sunrpc/rpc_main.c
+++ b/libc/sunrpc/rpc_main.c
@@ -997,9 +997,10 @@ mkfile_output (struct commandline *cmd)
abort ();
temp = rindex (cmd->infile, '.');
cp = stpcpy (mkfilename, "Makefile.");
- if (temp != NULL)
- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
- else
+ if (temp != NULL) {
+ strncpy(cp, cmd->infile, temp - cmd->infile);
+ cp[temp - cmd->infile - 1] = 0;
+ } else
stpcpy (cp, cmd->infile);
}

View file

@ -0,0 +1,27 @@
--- a/libc/timezone/zic.c
+++ b/libc/timezone/zic.c
@@ -8,6 +8,8 @@ static char elsieid[] = "@(#)zic.c 8.19"
#ifdef CROSS_ZIC
#define REPORT_BUGS_TO ""
#define PKGVERSION ""
+#undef _
+#define _(X) (X)
#else
#include "config.h"
#endif
@@ -490,6 +492,7 @@ char * argv[];
#ifdef unix
(void) umask(umask(S_IWGRP | S_IWOTH) | (S_IWGRP | S_IWOTH));
#endif /* defined unix */
+#ifndef CROSS_ZIC
#if HAVE_GETTEXT
(void) setlocale(LC_ALL, "");
#ifdef TZ_DOMAINDIR
@@ -497,6 +500,7 @@ char * argv[];
#endif /* defined TEXTDOMAINDIR */
(void) textdomain(TZ_DOMAIN);
#endif /* HAVE_GETTEXT */
+#endif
progname = argv[0];
if (TYPE_BIT(zic_t) < 64) {
(void) fprintf(stderr, "%s: %s\n", progname,

View file

@ -0,0 +1,22 @@
--- a/libc/sunrpc/Makefile
+++ b/libc/sunrpc/Makefile
@@ -175,7 +175,7 @@ $(objpfx)rpcgen: $(addprefix $(objpfx),$
$(+link)
$(addprefix $(objpfx)cross-,$(rpcgen-objs)): $(objpfx)cross-%.o: %.c
- gcc $< -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ \
+ gcc $< -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ $(HOST_CFLAGS) \
$(OUTPUT_OPTION) $(compile-mkdep-flags)
$(objpfx)cross-rpcgen: $(addprefix $(objpfx)cross-,$(rpcgen-objs))
--- a/libc/timezone/Makefile
+++ b/libc/timezone/Makefile
@@ -182,7 +182,7 @@ $(objpfx)zic: $(addprefix $(objpfx), $(z
$(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c
gcc $< -c $(OUTPUT_OPTION) $(CFLAGS-$*.c) $(CPPFLAGS-$*) \
- -DCROSS_ZIC $(compile-mkdep-flags)
+ -DCROSS_ZIC $(HOST_CFLAGS) $(compile-mkdep-flags)
$(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))
gcc $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@

View file

@ -0,0 +1,14 @@
add /usr/lib to default search path for the dynamic linker
--- a/libc/Makeconfig
+++ b/libc/Makeconfig
@@ -539,6 +539,9 @@
default-rpath = $(libdir)
endif
+# Add /usr/lib to default search path for the dynamic linker
+user-defined-trusted-dirs := /usr/lib
+
ifndef link-extra-libs
link-extra-libs = $(LDLIBS-$(@F))
link-extra-libs-static = $(link-extra-libs)

View file

@ -0,0 +1,52 @@
--- a/libc/sunrpc/rpc/types.h
+++ b/libc/sunrpc/rpc/types.h
@@ -75,18 +75,23 @@ typedef unsigned long rpcport_t;
#endif
#ifndef __u_char_defined
-typedef __u_char u_char;
-typedef __u_short u_short;
-typedef __u_int u_int;
-typedef __u_long u_long;
-typedef __quad_t quad_t;
-typedef __u_quad_t u_quad_t;
-typedef __fsid_t fsid_t;
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+#if __WORDSIZE == 64
+typedef long int quad_t;
+typedef unsigned long int u_quad_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+typedef long long int quad_t;
+typedef unsigned long long int u_quad_t;
+#endif
+typedef u_quad_t fsid_t;
# define __u_char_defined
#endif
-#ifndef __daddr_t_defined
-typedef __daddr_t daddr_t;
-typedef __caddr_t caddr_t;
+#if !defined(__daddr_t_defined) && defined(linux)
+typedef long int daddr_t;
+typedef char *caddr_t;
# define __daddr_t_defined
#endif
--- a/libc/sunrpc/rpc_main.c
+++ b/libc/sunrpc/rpc_main.c
@@ -958,9 +958,10 @@ mkfile_output (struct commandline *cmd)
abort ();
temp = rindex (cmd->infile, '.');
cp = stpcpy (mkfilename, "Makefile.");
- if (temp != NULL)
- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
- else
+ if (temp != NULL) {
+ strncpy(cp, cmd->infile, temp - cmd->infile);
+ cp[temp - cmd->infile - 1] = 0;
+ } else
stpcpy (cp, cmd->infile);
}

View file

@ -0,0 +1,14 @@
add /usr/lib to default search path for the dynamic linker
--- a/libc/Makeconfig
+++ b/libc/Makeconfig
@@ -501,6 +501,9 @@ else
default-rpath = $(libdir)
endif
+# Add /usr/lib to default search path for the dynamic linker
+user-defined-trusted-dirs := /usr/lib
+
ifndef link-extra-libs
link-extra-libs = $(LDLIBS-$(@F))
link-extra-libs-static = $(link-extra-libs)

View file

@ -0,0 +1,13 @@
Index: eglibc-2.19-r25243/libc/aclocal.m4
===================================================================
--- eglibc-2.19-r25243.orig/libc/aclocal.m4 2013-11-06 15:03:08.000000000 -0800
+++ eglibc-2.19-r25243/libc/aclocal.m4 2014-11-22 15:43:05.343256863 -0800
@@ -1,7 +1,7 @@
dnl We require that everyone use exactly the same Autoconf version so that
dnl the internal functions defined and used by the main configure script
dnl match those expected by the fragments.
-m4_define([GLIBC_AUTOCONF_VERSION], [2.68])
+m4_define([GLIBC_AUTOCONF_VERSION], [2.69])
m4_if(m4_defn([AC_AUTOCONF_VERSION]), GLIBC_AUTOCONF_VERSION, [],
[m4_fatal(m4_flatten(
Exactly version GLIBC_AUTOCONF_VERSION of Autoconf is required but you have