add support for alternative C libraries (currently only glibc/eglibc) other (related) changes: - kernel headers are now installed using "make headers_install" on 2.6 - target names now contain an openwrt "vendor" tag (e.g. mips-openwrt-linux-gnu) - build directory names now contain gcc/libc name/version - default cpu for x86 is now i486 (required to build glibc/eglibc)

SVN-Revision: 13931
This commit is contained in:
Nicolas Thill 2009-01-08 01:49:11 +00:00
parent 001fd43841
commit a3edea1b91
69 changed files with 2080 additions and 201 deletions

View File

@ -31,7 +31,7 @@ include $(INCLUDE_DIR)/package-bin.mk
include $(INCLUDE_DIR)/autotools.mk
override MAKEFLAGS=
CONFIG_SITE:=$(INCLUDE_DIR)/site/$(patsubst %gnueabi,%,$(REAL_GNU_TARGET_NAME))
CONFIG_SITE:=$(INCLUDE_DIR)/site/$(REAL_GNU_TARGET_NAME)
ifneq ($(CONFIG_LINUX_2_4),)
CONFIG_SITE:=$(subst linux-,linux2.4-,$(CONFIG_SITE))
endif

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/arm-linux
. $TOPDIR/include/site/linux-gnu

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/arm-linux
. $TOPDIR/include/site/linux-gnu

View File

@ -1,5 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/i386-linux
. $TOPDIR/include/site/arm-linux
. $TOPDIR/include/site/linux-uclibc

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/armeb-linux
. $TOPDIR/include/site/linux-gnu

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/armeb-linux
. $TOPDIR/include/site/linux-gnu

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/armeb-linux
. $TOPDIR/include/site/linux-uclibc

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/avr32-linux
. $TOPDIR/include/site/linux-gnu

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/cris-linux
. $TOPDIR/include/site/linux-gnu

View File

@ -23,6 +23,5 @@ ac_cv_sizeof_uint32_t=4
ac_cv_sizeof_uint64_t=8
ac_cv_sizeof_unsigned_int=4
ac_cv_sizeof_unsigned_long=4
ac_cv_sizeof_unsigned_long_long=8
ac_cv_sizeof_unsigned_short=2
ac_cv_sizeof_void_p=4

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/i486-linux
. $TOPDIR/include/site/linux-gnu

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/i486-linux
. $TOPDIR/include/site/linux-uclibc

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/i686-linux
. $TOPDIR/include/site/linux-gnu

71
include/site/linux-gnu Normal file
View File

@ -0,0 +1,71 @@
ac_atomic_add=yes
ac_atomic_sub=yes
ac_cv_c_gettext_without_libintl=yes
ac_cv_c_long_double=no
ac_cv_conv_longlong_to_float=yes
ac_cv_file__dev_zero=yes
ac_cv_func___va_copy=no
ac_cv_func__exit=yes
ac_cv_func_bcopy=yes
ac_cv_func_bzero=yes
ac_cv_func_bcmp=yes
ac_cv_func_fchmod=yes
ac_cv_func_getaddrinfo=yes
ac_cv_func_getcwd=yes
ac_cv_func_getdomainname=yes
ac_cv_func_getpgrp_void=yes
ac_cv_func_getpwuid_r=yes
ac_cv_func_index=yes
ac_cv_func_lstat_dereferences_slashed_symlink=yes
ac_cv_func_lstat_empty_string_bug=no
ac_cv_func_lstat=yes
ac_cv_func_malloc_0_nonnull=yes
ac_cv_func_malloc_works=yes
ac_cv_func_memcmp_clean=yes
ac_cv_func_memcmp_working=yes
ac_cv_func_posix_getgrgid_r=yes
ac_cv_func_posix_getpwuid_r=yes
ac_cv_func_pthread_key_delete=yes
ac_cv_func_realloc_0_nonnull=yes
ac_cv_func_realloc_works=yes
ac_cv_func_rename=yes
ac_cv_func_rindex=yes
ac_cv_func_setlocale=yes
ac_cv_func_setpgrp_void=yes
ac_cv_func_setresuid=no
ac_cv_func_setvbuf_reversed=no
ac_cv_func_stat_empty_string_bug=no
ac_cv_func_stat_ignores_trailing_slash=no
ac_cv_func_strerror=yes
ac_cv_func_strftime=yes
ac_cv_func_utimes=yes
ac_cv_func___adjtimex=yes
ac_cv_func_va_copy=no
ac_cv_func_vsnprintf=yes
ac_cv_have_accrights_in_msghdr=no
ac_cv_have_broken_snprintf=no
ac_cv_have_control_in_msghdr=yes
ac_cv_have_decl_sys_siglist=no
ac_cv_have_openpty_ctty_bug=yes
ac_cv_have_space_d_name_in_struct_dirent=yes
ac_cv_header_netinet_sctp_h=no
ac_cv_header_netinet_sctp_uio_h=no
ac_cv_int64_t=yes
ac_cv_lbl_unaligned_fail=no
ac_cv_linux_kernel_pppoe=yes
ac_cv_linux_vers=2
ac_cv_pack_bitfields_reversed=yes
ac_cv_path_LDCONFIG=
ac_cv_regexec_segfault_emptystr=no
ac_cv_sctp=no
ac_cv_sys_restartable_syscalls=yes
ac_cv_time_r_type=POSIX
ac_cv_type_suseconds_t=yes
ac_cv_uchar=no
ac_cv_uint=yes
ac_cv_uint64_t=yes
ac_cv_ulong=yes
ac_cv_ushort=yes
ac_cv_va_copy=C99
ac_cv_va_val_copy=yes
as_cv_unaligned_access=yes

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/mips-linux
. $TOPDIR/include/site/linux-gnu

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/mipsel-linux
. $TOPDIR/include/site/linux-gnu

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/powerpc-linux
. $TOPDIR/include/site/linux-gnu

View File

@ -0,0 +1,5 @@
#!/bin/sh
. $TOPDIR/include/site/x86_64-linux
. $TOPDIR/include/site/linux-gnu

View File

@ -12,7 +12,7 @@ __target_inc=1
DEVICE_TYPE?=router
# Default packages - the really basic set
DEFAULT_PACKAGES:=base-files libgcc uclibc busybox dropbear mtd uci opkg
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg
# For router targets
DEFAULT_PACKAGES.router:=dnsmasq iptables ppp ppp-mod-pppoe kmod-ipt-nathelper firewall

View File

@ -26,7 +26,7 @@ ifneq ($(DUMP),1)
LIB_SUFFIX:=64
endif
else
UCLIBC_VERSION:=<UCLIBC_VERSION>
LIBC_VERSION:=<LIBC_VERSION>
LIBGCC_VERSION:=<LIBGCC_VERSION>
endif
@ -88,22 +88,28 @@ $(call Package/gcc/Default)
DEPENDS+=@INSTALL_LIBSTDCPP
endef
define Package/uclibc/Default
define Package/libc/Default
SECTION:=libs
CATEGORY:=Base system
DEPENDS:=@!NATIVE_TOOLCHAIN
URL:=http://uclibc.org/
VERSION:=$(UCLIBC_VERSION)$(UCLIBC_PATCHVER)-$(PKG_RELEASE)
VERSION:=$(LIBC_VERSION)-$(PKG_RELEASE)
URL:=$(LIBC_URL)
endef
define Package/libc
$(call Package/libc/Default)
TITLE:=C library
endef
define Package/libpthread
$(call Package/uclibc/Default)
$(call Package/libc/Default)
TITLE:=POSIX thread library
DEPENDS:= +librt
endef
define Package/uclibc
$(call Package/uclibc/Default)
TITLE:=C library embedded systems
define Package/librt
$(call Package/libc/Default)
TITLE:=POSIX.1b RealTime extension library
endef
define Package/ldd
@ -112,10 +118,11 @@ $(call Package/uclibc/Default)
endef
define Package/ldconfig
$(call Package/uclibc/Default)
$(call Package/libc/Default)
TITLE:=Shared library path configuration
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
@ -184,40 +191,62 @@ define Package/libgcc/install
$(CP) $(TOOLCHAIN_DIR)/lib$(LIB_SUFFIX)/libgcc_s.so.* $(1)/lib/
endef
ifeq ($(word 1,$(subst ., ,$(LIBGCC_VERSION))),4)
define Package/libssp/install
define Package/libssp/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(TOOLCHAIN_DIR)/lib$(LIB_SUFFIX)/libssp.so.* $(1)/lib/
endef
endif
endef
define Package/libstdcpp/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(TOOLCHAIN_DIR)/usr/lib$(LIB_SUFFIX)/libstdc++.so.* $(1)/usr/lib/
endef
define Package/glibc/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(TOOLCHAIN_DIR)/lib$(LIB_SUFFIX)/libstdc++.so.* $(1)/lib/
$(CP) $(TOOLCHAIN_DIR)/lib/ld*.so.* $(1)/lib/
$(CP) $(TOOLCHAIN_DIR)/lib/ld-$(LIBC_VERSION).so $(1)/lib/
for file in libanl libc libcidn libcrypt libdl libm libnsl libnss_dns libnss_files libresolv libutil; do \
$(CP) $(TOOLCHAIN_DIR)/lib/$$$$file.so.* $(1)/lib/; \
$(CP) $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_VERSION).so $(1)/lib/; \
done
endef
define Package/eglibc/install
$(call Package/glibc/install,$1)
endef
define Package/uClibc/install
$(INSTALL_DIR) $(1)/lib
for file in ld$(LIB_SUFFIX)-uClibc libc libcrypt libdl libm libnsl libresolv libuClibc libutil; do \
$(CP) $(TOOLCHAIN_DIR)/lib/$$$$file.so.* $(1)/lib/; \
$(CP) $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_VERSION).so $(1)/lib/; \
done
endef
define Package/libc/install
$(call Package/$(LIBC)/install,$1)
endef
define Package/libpthread/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(TOOLCHAIN_DIR)/lib/libpthread.so.* $(1)/lib/
$(CP) $(TOOLCHAIN_DIR)/lib/libpthread-$(UCLIBC_VERSION).so $(1)/lib/
$(CP) $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_VERSION).so $(1)/lib/
endef
define Package/uclibc/install
define Package/librt/install
$(INSTALL_DIR) $(1)/lib
for file in ld$(LIB_SUFFIX)-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
$(CP) $(TOOLCHAIN_DIR)/lib/$$$$file.so.* $(1)/lib/; \
$(CP) $(TOOLCHAIN_DIR)/lib/$$$$file-$(UCLIBC_VERSION).so $(1)/lib/; \
done
$(CP) $(TOOLCHAIN_DIR)/lib/librt.so.* $(1)/lib/
$(CP) $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_VERSION).so $(1)/lib/
endef
define Package/ldd/install
$(INSTALL_DIR) $(1)/bin/
$(CP) $(TOOLCHAIN_DIR)/target-utils/ldd $(1)/bin/
$(INSTALL_DIR) $(1)/usr/bin/
$(CP) $(TOOLCHAIN_DIR)/usr/bin/ldd $(1)/usr/bin/
endef
define Package/ldconfig/install
$(INSTALL_DIR) $(1)/bin/
$(CP) $(TOOLCHAIN_DIR)/target-utils/ldconfig $(1)/bin/
$(INSTALL_DIR) $(1)/sbin/
$(CP) $(TOOLCHAIN_DIR)/sbin/ldconfig $(1)/sbin/
endef
ifneq ($(DUMP),1)
@ -225,10 +254,11 @@ ifneq ($(DUMP),1)
endif
$(eval $(call BuildPackage,base-files$(TARGET)))
$(eval $(call BuildPackage,libc))
$(eval $(call BuildPackage,libgcc))
$(eval $(call BuildPackage,libssp))
$(eval $(call BuildPackage,libstdcpp))
$(eval $(call BuildPackage,libpthread))
$(eval $(call BuildPackage,uclibc))
$(eval $(call BuildPackage,librt))
$(eval $(call BuildPackage,ldd))
$(eval $(call BuildPackage,ldconfig))

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -37,7 +37,7 @@ define Package/kexec-tools/config
endef
CONFIGURE_ARGS = \
--target=$(CONFIG_KEXEC_TOOLS_TARGET_NAME)-linux-uclibc \
--target=$(CONFIG_KEXEC_TOOLS_TARGET_NAME)-linux-$(TARGET_SUFFIX) \
--host=$(GNU_TARGET_NAME)-uclibc \
--build=$(GNU_HOST_NAME) \
--program-prefix="" \
@ -49,7 +49,9 @@ CONFIGURE_ARGS = \
--libexecdir=/usr/lib \
--sysconfdir=/etc \
CONFIGURE_VARS += BUILD_CC=$(HOSTCC)
CONFIGURE_VARS += \
BUILD_CC=$(HOSTCC) \
TARGET_CC=$(TARGET_CC) \
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) all

View File

@ -34,11 +34,14 @@ _SINGLE=export MAKEFLAGS=$(space);
ARCH:=$(call qstrip,$(shell echo $(CONFIG_ARCH) | sed -e 's/i[3-9]86/i386/'))
BOARD:=$(call qstrip,$(CONFIG_TARGET_BOARD))
TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION))
TARGET_SUFFIX=$(call qstrip,$(CONFIG_TARGET_SUFFIX))
BUILD_SUFFIX:=$(call qstrip,$(CONFIG_BUILD_SUFFIX))
GCCV:=$(call qstrip,$(CONFIG_GCC_VERSION))
LIBC:=$(call qstrip,$(CONFIG_LIBC))
LIBCV:=$(call qstrip,$(CONFIG_LIBC_VERSION))
SUBDIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})
OPTIMIZE_FOR_CPU=$(ARCH)
OPTIMIZE_FOR_CPU=$(shell echo $(ARCH) | sed -e 's/i386/i486/')
ifeq ($(ARCH),powerpc)
FPIC:=-fPIC
@ -51,29 +54,29 @@ BIN_DIR:=$(TOPDIR)/bin
INCLUDE_DIR:=$(TOPDIR)/include
SCRIPT_DIR:=$(TOPDIR)/scripts
BUILD_DIR_BASE:=$(TOPDIR)/build_dir
BUILD_DIR:=$(BUILD_DIR_BASE)/$(ARCH)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
BUILD_DIR:=$(BUILD_DIR_BASE)/target-$(ARCH)_$(LIBC)-$(LIBCV)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
BUILD_DIR_HOST:=$(BUILD_DIR_BASE)/host
BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(ARCH)_gcc$(GCCV)
STAGING_DIR:=$(TOPDIR)/staging_dir/$(ARCH)
BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(ARCH)_gcc-$(GCCV)_$(LIBC)-$(LIBCV)
STAGING_DIR:=$(TOPDIR)/staging_dir/target-$(ARCH)_$(LIBC)-$(LIBCV)
STAGING_DIR_HOST:=$(TOPDIR)/staging_dir/host
TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(ARCH)_gcc$(GCCV)
TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(ARCH)_gcc-$(GCCV)_$(LIBC)-$(LIBCV)
PACKAGE_DIR:=$(BIN_DIR)/packages/$(ARCH)
STAMP_DIR:=$(BUILD_DIR)/stamp
STAMP_DIR_HOST=$(BUILD_DIR_HOST)/stamp
TARGET_DIR:=$(BUILD_DIR)/root-$(BOARD)
IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/ipkg
TARGET_PATH:=$(TOOLCHAIN_DIR)/bin:$(STAGING_DIR_HOST)/bin:$(STAGING_DIR)/host/bin:$(PATH)
TARGET_PATH:=$(TOOLCHAIN_DIR)/usr/bin:$(STAGING_DIR_HOST)/bin:$(STAGING_DIR)/host/bin:$(PATH)
TARGET_CFLAGS:=$(TARGET_OPTIMIZATION)$(if $(CONFIG_DEBUG), -g3)
TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include
TARGET_LDFLAGS:=-L$(TOOLCHAIN_DIR)/lib -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
TARGET_LDFLAGS:=-L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
LIBGCC_S=$(if $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so),-lgcc_s,$(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.a))
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
-include $(TOOLCHAIN_DIR)/info.mk
REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux-uclibc$(if $(CONFIG_EABI_SUPPORT),gnueabi)
GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
TARGET_CROSS:=$(if $(TARGET_CROSS),$(TARGET_CROSS),$(OPTIMIZE_FOR_CPU)-linux-uclibc$(if $(CONFIG_EABI_SUPPORT),gnueabi)-)
REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))
GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-openwrt-linux
TARGET_CROSS:=$(if $(TARGET_CROSS),$(TARGET_CROSS),$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))-)
TARGET_CFLAGS+= -fhonour-copts
endif

View File

@ -41,6 +41,30 @@ menuconfig EXTRA_TARGET_ARCH
source "toolchain/binutils/Config.in"
source "toolchain/gcc/Config.in"
choice
prompt "LIBC implementation" if TOOLCHAINOPTS
default USE_UCLIBC
help
Select the LIBC implementation.
config USE_EGLIBC
bool "Use eglibc"
depends !avr32
select NO_STRIP
config USE_GLIBC
bool "Use glibc"
depends !avr32
select NO_STRIP
config USE_UCLIBC
bool "Use uClibc"
endchoice
source "toolchain/eglibc/Config.in"
source "toolchain/glibc/Config.in"
source "toolchain/uClibc/Config.in"
config GDB
@ -82,7 +106,7 @@ config TARGET_OPTIMIZATION
prompt "Target Optimizations" if TOOLCHAINOPTS
default "-O2 -pipe -march=i686 -funit-at-a-time" if TARGET_x86_mediacenter
default "-O2 -pipe -march=i486 -funit-at-a-time" if TARGET_x86
default "-Os -pipe -march=i486 -funit-at-a-time" if TARGET_rdc
default "-Os -pipe -march=i486 -funit-at-a-time" if TARGET_rdc || TARGET_uml
default "-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time" if TARGET_ar71xx
default "-Os -pipe -mips32 -mtune=mips32 -funit-at-a-time" if mipsel || mips
default "-Os -pipe -march=armv5te -mtune=xscale -funit-at-a-time" if TARGET_ixp4xx || TARGET_iop32x || TARGET_pxa || TARGET_orion
@ -91,5 +115,32 @@ config TARGET_OPTIMIZATION
help
Optimizations to use when building for the target host.
config USE_UCLIBC
bool
default y if !TOOLCHAINOPTS
source "toolchain/gcc/Config.version"
source "toolchain/eglibc/Config.version"
source "toolchain/glibc/Config.version"
source "toolchain/uClibc/Config.version"
config LIBC
string
default "eglibc" if USE_EGLIBC
default "glibc" if USE_GLIBC
default "uClibc" if USE_UCLIBC
config LIBC_VERSION
string
default EGLIBC_VERSION if USE_EGLIBC
default GLIBC_VERSION if USE_GLIBC
default UCLIBC_VERSION if USE_UCLIBC
config TARGET_SUFFIX
string
default "gnueabi" if (USE_EGLIBC || USE_GLIBC) && EABI_SUPPORT
default "gnu" if (USE_EGLIBC || USE_GLIBC) && !EABI_SUPPORT
default "uclibc-gnueabi" if USE_UCLIBC && EABI_SUPPORT
default "uclibc" if USE_UCLIBC && !EABI_SUPPORT

View File

@ -1,26 +1,49 @@
#
# Copyright (C) 2007 OpenWrt.org
# Copyright (C) 2007-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# Main makefile for the toolchain
#
# Steps:
# 1) toolchain/binutils/install
# build & install binutils
# 2) toolchain/gcc/prepare
# build & install a minimal gcc, needed for steps 3 & 4
# 3) toolchain/kernel-headers/install
# install kernel headers, needed for step 4
# 4) toolchain/libc/prepare
# build & install libc headers & support files, needed for step 5
# 5) toolchain/gcc/compile
# build & install an initial gcc, needed for step 6
# 6) toolchain/libc/compile
# build & install the final libc
# 7) toolchain/gcc/install
# build & install the final gcc
# 8) toolchain/libc/install
# build & install libc utilities
#
curdir:=toolchain
# subdirectories to descend into
$(curdir)/builddirs := kernel-headers $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_NATIVE_TOOLCHAIN),,binutils gcc uClibc)
$(curdir)/builddirs-compile:=. $(filter-out kernel-headers,$($(curdir)/builddirs))
$(curdir)/builddirs := kernel-headers $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_NATIVE_TOOLCHAIN),,binutils gcc $(LIBC) $(if $(CONFIG_GLIBC_PORTS),glibc-ports))
$(curdir)/builddirs-compile:=$($(curdir)/builddirs-prepare)
$(curdir)/builddirs-install:=$($(curdir)/builddirs-compile)
# builddir dependencies
$(curdir)/uClibc/prepare:=$(curdir)/kernel-headers/prepare
$(curdir)/$(LIBC)/prepare:=$(curdir)/kernel-headers/install
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
$(curdir)/binutils/prepare:=$(curdir)/uClibc/prepare
$(curdir)/gcc/prepare:=$(curdir)/binutils/install
$(curdir)/uClibc/compile:=$(curdir)/gcc/compile
$(curdir)/gcc/install:=$(curdir)/uClibc/compile
$(curdir)/uClibc/install:=$(curdir)/gcc/install
$(curdir)/kernel-headers/install:=$(curdir)/gcc/prepare
$(curdir)/gcc/compile:=$(curdir)/$(LIBC)/prepare
$(curdir)/$(LIBC)/compile:=$(curdir)/gcc/compile
$(curdir)/gcc/install:=$(curdir)/$(LIBC)/compile
$(curdir)/$(LIBC)/install:=$(curdir)/gcc/install
ifneq ($(CONFIG_GLIBC_PORTS),)
$(curdir)/glibc/prepare:=$(curdir)/glibc-ports/prepare
endif
endif
ifneq ($(ARCH),)
@ -29,7 +52,7 @@ ifneq ($(ARCH),)
set -x; \
mkdir -p "$$dir"; \
cd "$$dir"; \
mkdir -p bin lib include stamp; \
mkdir -p stamp lib usr/include usr/lib ; \
); done
@grep GCC_VERSION $@ >/dev/null 2>&1 || $(INSTALL_DATA) $(TOPDIR)/toolchain/info.mk $@
@touch $@

View File

@ -23,20 +23,28 @@ PATCH_DIR:=./patches/$(PKG_VERSION)
STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
override CONFIG_AUTOREBUILD=
include $(INCLUDE_DIR)/host-build.mk
EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-uclibc)
EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX))
define Build/Prepare
$(call Build/Prepare/Default)
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
endef
define Build/Configure
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
(cd $(PKG_BUILD_DIR); \
./configure \
--prefix=$(STAGING_DIR_HOST) \
--prefix=$(TOOLCHAIN_DIR)/usr \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
--with-sysroot=$(TOOLCHAIN_DIR) \
--disable-multilib \
--disable-werror \
--disable-nls \
$(EXTRA_TARGET) \
@ -53,4 +61,10 @@ define Build/Install
$(MAKE) -C $(PKG_BUILD_DIR) install
endef
define Build/Clean
rm -rf \
$(PKG_BUILD_DIR) \
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
endef
$(eval $(call HostBuild))

View File

@ -0,0 +1,40 @@
choice
prompt "eglibc version"
depends on TOOLCHAINOPTS && USE_EGLIBC
default EGLIBC_VERSION_2_8
help
Select the version of eglibc you wish to use.
config EGLIBC_VERSION_2_6_1
bool "eglibc 2.6.1"
config EGLIBC_VERSION_2_7
bool "eglibc 2.7"
config EGLIBC_VERSION_2_8
bool "eglibc 2.8"
config EGLIBC_VERSION_2_9
bool "eglibc 2.9"
config EGLIBC_VERSION_TRUNK
bool "eglibc trunk"
endchoice
config EGLIBC_REVISION
string
prompt "eglibc revision"
depends on TOOLCHAINOPTS && USE_EGLIBC
default "5887" if EGLIBC_VERSION_2_6_1
default "5886" if EGLIBC_VERSION_2_7
default "6913" if EGLIBC_VERSION_2_8
default "7430" if EGLIBC_VERSION_2_9
default "HEAD" if EGLIBC_VERSION_TRUNK
default ""
menu "eglibc configuration"
depends on TOOLCHAINOPTS && USE_EGLIBC
source toolchain/eglibc/config/Config.in
endmenu

View File

@ -0,0 +1,9 @@
config EGLIBC_VERSION
string
depends on USE_EGLIBC
default "2.6.1" if EGLIBC_VERSION_2_6_1
default "2.7" if EGLIBC_VERSION_2_7
default "2.8" if EGLIBC_VERSION_2_8
default "2.9" if EGLIBC_VERSION_2_9
default "trunk"

168
toolchain/eglibc/Makefile Normal file
View File

@ -0,0 +1,168 @@
#
# Copyright (C) 2006-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=eglibc
PKG_VERSION:=$(call qstrip,$(CONFIG_EGLIBC_VERSION))
PKG_REVISION:=$(call qstrip,$(CONFIG_EGLIBC_REVISION))
PKG_SOURCE_PROTO:=svn
PKG_SOURCE_VERSION:=$(PKG_REVISION)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-r$(PKG_REVISION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.bz2
ifeq ($(PKG_VERSION),2.6.1)
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_6
endif
ifeq ($(PKG_VERSION),2.7)
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_7
endif
ifeq ($(PKG_VERSION),2.8)
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_8
endif
ifeq ($(PKG_VERSION),2.9)
PKG_SOURCE_URL:=svn://svn.eglibc.org/branches/eglibc-2_9
endif
ifeq ($(PKG_VERSION),trunk)
PKG_SOURCE_URL:=svn://svn.eglibc.org/trunk
endif
PATCH_DIR:=./patches/$(PKG_VERSION)
STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_SOURCE_SUBDIR)
override CONFIG_AUTOREBUILD=
include $(INCLUDE_DIR)/host-build.mk
STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.eglibc_built
STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.eglibc_installed
PKG_BUILD_DIR1:=$(PKG_BUILD_DIR)-initial
PKG_BUILD_DIR2:=$(PKG_BUILD_DIR)-final
# XXX: {e,}glibc does not build w/ -Os
# http://sourceware.org/bugzilla/show_bug.cgi?id=5203
EGLIBC_CFLAGS:=$(subst -Os,-O2,$(TARGET_CFLAGS))
EGLIBC_CONFIGURE:= \
BUILD_CC="$(HOSTCC)" \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(EGLIBC_CFLAGS)" \
$(PKG_BUILD_DIR)/libc/configure \
--prefix=/usr \
--build=$(GNU_HOST_NAME) \
--host=$(REAL_GNU_TARGET_NAME) \
--with-headers=$(TOOLCHAIN_DIR)/usr/include \
--disable-profile \
--without-gd \
--without-cvs \
--enable-add-ons \
ifeq ($(CONFIG_SOFT_FLOAT),)
EGLIBC_CONFIGURE+= --with-fp
else
EGLIBC_CONFIGURE+= --without-fp
endif
EGLIBC_MAKE:= \
$(MAKE) \
define Build/SetToolchainInfo
$(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.eglibc.org/,' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,^\(LIBC_PATCHVER\)=.*,\1=$(PKG_EXTRAVERSION),' $(TOOLCHAIN_DIR)/info.mk
endef
define Stage1/Configure
mkdir -p $(PKG_BUILD_DIR1)
$(CP) $(PKG_BUILD_DIR)/libc/option-groups.config $(PKG_BUILD_DIR1)/
( cd $(PKG_BUILD_DIR1); rm -f config.cache; \
$(EGLIBC_CONFIGURE) \
);
endef
define Stage1/Compile
endef
define Stage1/Install
mkdir -p $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/{include,lib}
$(EGLIBC_MAKE) -C $(PKG_BUILD_DIR1) \
install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \
install-bootstrap-headers=yes \
install-headers
$(EGLIBC_MAKE) -C $(PKG_BUILD_DIR1) \
csu/subdir_lib
( cd $(PKG_BUILD_DIR1); \
$(CP) csu/crt1.o csu/crti.o csu/crtn.o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/lib/ \
)
$(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \
-o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/lib/libc.so
endef
define Stage2/Configure
mkdir -p $(PKG_BUILD_DIR2)
$(CP) $(PKG_BUILD_DIR)/libc/option-groups.config $(PKG_BUILD_DIR2)/
( cd $(PKG_BUILD_DIR2); rm -f config.cache; \
$(EGLIBC_CONFIGURE) \
);
endef
define Stage2/Compile
$(EGLIBC_MAKE) -C $(PKG_BUILD_DIR2) all
endef
define Stage2/Install
$(EGLIBC_MAKE) -C $(PKG_BUILD_DIR2) \
install_root="$(TOOLCHAIN_DIR)" \
install
( cd $(TOOLCHAIN_DIR) ; \
for d in lib usr/lib ; do \
for f in libc.so libpthread.so libgcc_s.so ; do \
if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \
$(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \
fi \
done \
done \
)
endef
define Build/Prepare
$(call Build/SetToolchainInfo)
$(call Build/Prepare/Default)
ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
$(SED) 's,y,n,' $(PKG_BUILD_DIR)/libc/option-groups.defaults
grep 'CONFIG_EGLIBC_OPTION_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_EGLIBC_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR)/libc/option-groups.config
ln -sf ../ports $(PKG_BUILD_DIR)/libc/
( cd $(PKG_BUILD_DIR)/libc; autoconf --force )
$(call Stage1/Configure)
$(call Stage1/Compile)
$(call Stage1/Install)
endef
define Build/Configure
endef
define Build/Compile
$(call Stage2/Configure)
$(call Stage2/Compile)
$(call Stage2/Install)
endef
define Build/Install
endef
define Build/Clean
rm -rf $(PKG_BUILD_DIR) $(PKG_BUILD_DIR1) $(PKG_BUILD_DIR2) \
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
endef
$(eval $(call HostBuild))

View File

@ -0,0 +1,726 @@
config EGLIBC_OPTION_EGLIBC_ADVANCED_INET6
bool "IPv6 Advanced Sockets API support (RFC3542)"
default y
depends EGLIBC_OPTION_EGLIBC_INET
help
This option group includes the functions specified by RFC 3542,
"Advanced Sockets Application Program Interface (API) for
IPv6".
This option group includes the following functions:
inet6_opt_append
inet6_opt_find
inet6_opt_finish
inet6_opt_get_val
inet6_opt_init
inet6_alloc
inet6_append
inet6_find
inet6_init
inet6_next
inet6_space
inet6_opt_next
inet6_opt_set_val
inet6_rth_add
inet6_rth_getaddr
inet6_rth_init
inet6_rth_reverse
inet6_rth_segments
inet6_rth_space
config EGLIBC_OPTION_EGLIBC_BACKTRACE
bool "Functions for producing backtraces"
default y
help
This option group includes functions for producing a list of
the function calls that are currently active in a thread, from
within the thread itself. These functions are often used
within signal handlers, to produce diagnostic output.
This option group includes the following functions:
backtrace
backtrace_symbols
backtrace_symbols_fd
config EGLIBC_OPTION_EGLIBC_BSD
bool "BSD-specific functions, and their compatibility stubs"
default y
help
This option group includes functions specific to BSD kernels.
A number of these functions have stub versions that are also
included in libraries built for non-BSD systems for
compatibility.
This option group includes the following functions:
chflags
fchflags
lchmod
revoke
setlogin
config EGLIBC_OPTION_EGLIBC_CXX_TESTS
bool "Tests that link against the standard C++ library."
default y
depends EGLIBC_OPTION_POSIX_WIDE_CHAR_DEVICE_IO
depends EGLIBC_OPTION_EGLIBC_LIBM
help
This option group does not include any C library functions;
instead, it controls which EGLIBC tests an ordinary 'make
tests' runs. With this group disabled, tests that would
normally link against the standard C++ library are not
run.
The standard C++ library depends on the math library 'libm' and
the wide character I/O functions included in EGLIBC. If those
option groups are disabled, this test must also be disabled.
config EGLIBC_OPTION_EGLIBC_CATGETS
bool "Functions for accessing message catalogs"
default y
depends EGLIBC_OPTION_EGLIBC_LOCALE_CODE
help
This option group includes functions for accessing message
catalogs: catopen, catclose, and catgets.
This option group depends on the EGLIBC_LOCALE_CODE
option group; if you disable that, you must also disable this.
config EGLIBC_OPTION_EGLIBC_CHARSETS
bool "iconv/gconv character set conversion libraries"
default y
help
This option group includes support for character sets other
than ASCII (ANSI_X3.4-1968) and Unicode and ISO-10646 in their
various encodings. This affects both the character sets
supported by the wide and multibyte character functions, and
those supported by the 'iconv' functions.
With this option group disabled, EGLIBC supports only the
following character sets:
ANSI_X3.4 - ASCII
ANSI_X3.4-1968
ANSI_X3.4-1986
ASCII
CP367
CSASCII
IBM367
ISO-IR-6
ISO646-US
ISO_646.IRV:1991
OSF00010020
US
US-ASCII
10646-1:1993 - ISO 10646, in big-endian UCS4 form
10646-1:1993/UCS4
CSUCS4
ISO-10646
ISO-10646/UCS4
OSF00010104
OSF00010105
OSF00010106
UCS-4
UCS-4BE
UCS4
UCS-4LE - ISO 10646, in little-endian UCS4 form
ISO-10646/UTF-8 - ISO 10646, in UTF-8 form
ISO-10646/UTF8
ISO-IR-193
OSF05010001
UTF-8
UTF8
ISO-10646/UCS2 - ISO 10646, in target-endian UCS2 form
OSF00010100
OSF00010101
OSF00010102
UCS-2
UCS2
UCS-2BE - ISO 10646, in big-endian UCS2 form
UNICODEBIG
UCS-2LE - ISO 10646, in little-endian UCS2 form
UNICODELITTLE
WCHAR_T - EGLIBC's internal form (target-endian,
32-bit ISO 10646)
config EGLIBC_OPTION_EGLIBC_DB_ALIASES
bool "Functions for accessing the mail aliases database"
default y
help
This option group includues functions for looking up mail
aliases in '/etc/aliases' or using nsswitch. It includes the
following functions:
endaliasent
getaliasbyname
getaliasbyname_r
getaliasent
getaliasent_r
setaliasent
When this option group is disabled, the NSS service libraries
also lack support for querying their mail alias tables.
config EGLIBC_OPTION_EGLIBC_ENVZ
bool "Functions for handling envz-style environment vectors."
default y
help
This option group contains functions for creating and operating
on envz vectors. An "envz vector" is a vector of strings in a
contiguous block of memory, where each element is a name-value
pair, and elements are separated from their neighbors by null
characters.
This option group includes the following functions:
envz_add envz_merge
envz_entry envz_remove
envz_get envz_strip
config EGLIBC_OPTION_EGLIBC_FSTAB
bool "Access functions for 'fstab'"
default y
help
This option group includes functions for reading the mount
point specification table, '/etc/fstab'. These functions are
not included in the POSIX standard, which provides the
'getmntent' family of functions instead.
This option group includues the following functions:
endfsent getfsspec
getfsent setfsent
getfsfile
config EGLIBC_OPTION_EGLIBC_GETLOGIN
bool "The getlogin function"
default y
depends EGLIBC_OPTION_EGLIBC_UTMP
help
This function group includes the 'getlogin' and 'getlogin_r'
functions, which return the user name associated by the login
activity with the current process's controlling terminal.
With this option group disabled, the 'glob' function will not
fall back on 'getlogin' to find the user's login name for tilde
expansion when the 'HOME' environment variable is not set.
config EGLIBC_OPTION_EGLIBC_INET
bool "Networking support"
default y
help
This option group includes networking-specific functions and
data. With EGLIBC_INET disabled, the EGLIBC
installation and API changes as follows:
- The following libraries are not installed:
libanl
libnsl
libnss_compat
libnss_dns
libnss_hesiod
libnss_nis
libnss_nisplus
libresolv
- The following functions and variables are omitted from libc:
authdes_create hstrerror svc_fdset
authdes_getucred htonl svc_getreq
authdes_pk_create htons svc_getreq_common
authnone_create if_freenameindex svc_getreq_poll
authunix_create if_indextoname svc_getreqset
authunix_create_default if_nameindex svc_max_pollfd
bindresvport if_nametoindex svc_pollfd
callrpc in6addr_any svcraw_create
cbc_crypt in6addr_loopback svc_register
clnt_broadcast inet6_opt_append svc_run
clnt_create inet6_opt_find svc_sendreply
clnt_pcreateerror inet6_opt_finish svctcp_create
clnt_perrno inet6_opt_get_val svcudp_bufcreate
clnt_perror inet6_opt_init svcudp_create
clntraw_create inet6_alloc svcudp_enablecache
clnt_spcreateerror inet6_append svcunix_create
clnt_sperrno inet6_find svcunixfd_create
clnt_sperror inet6_init svc_unregister
clnttcp_create inet6_next user2netname
clntudp_bufcreate inet6_space xdecrypt
clntudp_create inet6_opt_next xdr_accepted_reply
clntunix_create inet6_opt_set_val xdr_array
des_setparity inet6_rth_add xdr_authdes_cred
ecb_crypt inet6_rth_getaddr xdr_authdes_verf
endaliasent inet6_rth_init xdr_authunix_parms
endhostent inet6_rth_reverse xdr_bool
endnetent inet6_rth_segments xdr_bytes
endnetgrent inet6_rth_space xdr_callhdr
endprotoent inet_addr xdr_callmsg
endrpcent inet_aton xdr_char
endservent inet_lnaof xdr_cryptkeyarg
ether_aton inet_makeaddr xdr_cryptkeyarg2
ether_aton_r inet_netof xdr_cryptkeyres
ether_hostton inet_network xdr_des_block
ether_line inet_nsap_addr xdr_double
ether_ntoa inet_nsap_ntoa xdr_enum
ether_ntoa_r inet_ntoa xdr_float
ether_ntohost inet_ntop xdr_free
freeaddrinfo inet_pton xdr_getcredres
freeifaddrs innetgr xdr_hyper
gai_strerror iruserok xdr_int
getaddrinfo iruserok_af xdr_int16_t
getaliasbyname key_decryptsession xdr_int32_t
getaliasbyname_r key_decryptsession_pk xdr_int64_t
getaliasent key_encryptsession xdr_int8_t
getaliasent_r key_encryptsession_pk xdr_keybuf
gethostbyaddr key_gendes xdr_key_netstarg
gethostbyaddr_r key_get_conv xdr_key_netstres
gethostbyname key_secretkey_is_set xdr_keystatus
gethostbyname2 key_setnet xdr_long
gethostbyname2_r key_setsecret xdr_longlong_t
gethostbyname_r netname2host xdrmem_create
gethostent netname2user xdr_netnamestr
gethostent_r ntohl xdr_netobj
getifaddrs ntohs xdr_opaque
getipv4sourcefilter passwd2des xdr_opaque_auth
get_myaddress pmap_getmaps xdr_pmap
getnameinfo pmap_getport xdr_pmaplist
getnetbyaddr pmap_rmtcall xdr_pointer
getnetbyaddr_r pmap_set xdr_quad_t
getnetbyname pmap_unset xdrrec_create
getnetbyname_r rcmd xdrrec_endofrecord
getnetent rcmd_af xdrrec_eof
getnetent_r registerrpc xdrrec_skiprecord
getnetgrent res_init xdr_reference
getnetgrent_r rexec xdr_rejected_reply
getnetname rexec_af xdr_replymsg
getprotobyname rexecoptions xdr_rmtcall_args
getprotobyname_r rpc_createerr xdr_rmtcallres
getprotobynumber rresvport xdr_short
getprotobynumber_r rresvport_af xdr_sizeof
getprotoent rtime xdrstdio_create
getprotoent_r ruserok xdr_string
getpublickey ruserok_af xdr_u_char
getrpcbyname ruserpass xdr_u_hyper
getrpcbyname_r setaliasent xdr_u_int
getrpcbynumber sethostent xdr_uint16_t
getrpcbynumber_r setipv4sourcefilter xdr_uint32_t
getrpcent setnetent xdr_uint64_t
getrpcent_r setnetgrent xdr_uint8_t
getrpcport setprotoent xdr_u_long
getsecretkey setrpcent xdr_u_longlong_t
getservbyname setservent xdr_union
getservbyname_r setsourcefilter xdr_unixcred
getservbyport svcauthdes_stats xdr_u_quad_t
getservbyport_r svcerr_auth xdr_u_short
getservent svcerr_decode xdr_vector
getservent_r svcerr_noproc xdr_void
getsourcefilter svcerr_noprog xdr_wrapstring
h_errlist svcerr_progvers xencrypt
h_errno svcerr_systemerr xprt_register
herror svcerr_weakauth xprt_unregister
h_nerr svc_exit
host2netname svcfd_create
- The rpcgen, nscd, and rpcinfo commands are not installed.
- The 'rpc' file (a text file listing RPC services) is not installed.
Socket-related system calls do not fall in this option group,
because many are also used for other inter-process
communication mechanisms. For example, the 'syslog' routines
use Unix-domain sockets to communicate with the syslog daemon;
syslog is valuable in non-networked contexts.
config EGLIBC_OPTION_EGLIBC_LIBM
bool "libm (math library)"
default y
help
This option group includes the 'libm' library, containing
mathematical functions. If this option group is omitted, then
an EGLIBC installation does not include shared or unshared versions
of the math library.
Note that this does not remove all floating-point related
functionality from EGLIBC; for example, 'printf' and 'scanf'
can still print and read floating-point values with this option
group disabled.
Note that the ISO Standard C++ library 'libstdc++' depends on
EGLIBC's math library 'libm'. If you disable this option
group, you will not be able to build 'libstdc++' against the
resulting EGLIBC installation.
config EGLIBC_OPTION_EGLIBC_LOCALES
bool "Locale definitions"
default y
help
This option group includes all locale definitions other than
that for the "C" locale. If this option group is omitted, then
only the "C" locale is supported.
config EGLIBC_OPTION_EGLIBC_LOCALE_CODE
bool "Locale functions"
default y
depends EGLIBC_OPTION_POSIX_C_LANG_WIDE_CHAR
help
This option group includes locale support functions, programs,
and libraries. With EGLIBC_LOCALE_FUNCTIONS disabled,
EGLIBC supports only the 'C' locale (also known as 'POSIX'),
and ignores the settings of the 'LANG' and 'LC_*' environment
variables.
With EGLIBC_LOCALE_CODE disabled, the following
functions are omitted from libc:
duplocale localeconv nl_langinfo rpmatch strfmon_l
freelocale newlocale nl_langinfo_l strfmon uselocale
Furthermore, only the LC_CTYPE and LC_TIME categories of the
standard "C" locale are available.
The EGLIBC_CATGETS option group depends on this option
group; if you disable EGLIBC_LOCALE_CODE, you must also
disable EGLIBC_CATGETS.
config EGLIBC_OPTION_EGLIBC_NIS
bool "Support for NIS, NIS+, and the special 'compat' services."
default y
depends EGLIBC_OPTION_EGLIBC_INET
depends EGLIBC_OPTION_EGLIBC_SUNRPC
help
This option group includes the NIS, NIS+, and 'compat' Name
Service Switch service libraries. When it is disabled, those
services libraries are not installed; you should remove any
references to them from your 'nsswitch.conf' file.
This option group depends on the EGLIBC_INET option
group; you must enable that to enable this option group.
config EGLIBC_OPTION_EGLIBC_NSSWITCH
bool "Name service switch (nsswitch) support"
default y
help
This option group includes support for the 'nsswitch' facility.
With this option group enabled, all EGLIBC functions for
accessing various system databases (passwords and groups;
networking; aliases; public keys; and so on) consult the
'/etc/nsswitch.conf' configuration file to decide how to handle
queries.
With this option group disabled, EGLIBC uses a fixed list of
services to satisfy queries on each database, as requested by
configuration files specified when EGLIBC is built. Your
'option-groups.config' file must set the following two
variables:
EGLIBC_NSSWITCH_FIXED_CONFIG
Set this to the name of a file whose contents observe the
same syntax as an ordinary '/etc/nsswitch.conf' file. The
EGLIBC build process parses this file just as EGLIBC would
at run time if EGLIBC_NSSWITCH were enabled, and
produces a C library that uses the nsswitch service
libraries to search for database entries as this file
specifies, instead of consulting '/etc/nsswitch.conf' at run
time.
This should be an absolute filename. The EGLIBC build
process may use it from several different working
directories. It may include references to Makefile
variables like 'common-objpfx' (the top of the build tree,
with a trailing slash), or '..' (the top of the source tree,
with a trailing slash).
The EGLIBC source tree includes a sample configuration file
named 'nss/fixed-nsswitch.conf'; for simple configurations,
you will probably want to delete references to databases not
needed on your system.
EGLIBC_NSSWITCH_FIXED_FUNCTIONS
The EGLIBC build process uses this file to decide which
functions to make available from which service libraries.
The file 'nss/fixed-nsswitch.functions' serves as a sample
configuration file for this setting, and explains its syntax
and meaning in more detail.
This should be an absolute file name. The EGLIBC build
process may use it from several different working
directories. It may include references to Makefile
variables like 'common-objpfx' (the top of the build tree,
with a trailing slash), or '..' (the top of the source tree,
with a trailing slash).
Be sure to mention each function in each service you wish to
use. If you do not mention a service's function here, the
EGLIBC database access functions will not find it, even if
it is listed in the EGLIBC_NSSWITCH_FIXED_CONFIG
file.
In this arrangement, EGLIBC will not use the 'dlopen' and
'dlsym' functions to find database access functions. Instead,
libc hard-codes references to the service libraries' database
access functions. You must explicitly link your program
against the name service libraries (those whose names start
with 'libnss_', in the sysroot's '/lib' directory) whose
functions you intend to use. This arrangement helps
system-wide static analysis tools decide which functions a
system actually uses.
Note that some nsswitch service libraries require other option
groups to be enabled; for example, the EGLIBC_INET
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 EGLIBC_OPTION_EGLIBC_RCMD
bool "Support for 'rcmd' and related library functions"
default y
depends EGLIBC_OPTION_EGLIBC_INET
help
This option group includes functions for running commands on
remote machines via the 'rsh' protocol, and doing authentication
related to those functions. This also includes functions that
use the 'rexec' protocol.
This option group includes the following functions:
rcmd ruserok
rcmd_af ruserok_af
rexec iruserok
rexec_af iruserok_af
rresvport ruserpass
rresvport_af
config EGLIBC_OPTION_EGLIBC_SPAWN
bool "Support for POSIX posix_spawn functions"
default y
help
This option group includes the POSIX functions for executing
programs in child processes without using 'fork' or 'vfork'.
This option group includes the following functions:
posix_spawn
posix_spawnattr_destroy
posix_spawnattr_getflags
posix_spawnattr_getpgroup
posix_spawnattr_getschedparam
posix_spawnattr_getschedpolicy
posix_spawnattr_getsigdefault
posix_spawnattr_getsigmask
posix_spawnattr_init
posix_spawnattr_setflags
posix_spawnattr_setpgroup
posix_spawnattr_setschedparam
posix_spawnattr_setschedpolicy
posix_spawnattr_setsigdefault
posix_spawnattr_setsigmask
posix_spawn_file_actions_addclose
posix_spawn_file_actions_adddup2
posix_spawn_file_actions_addopen
posix_spawn_file_actions_destroy
posix_spawn_file_actions_init
posix_spawnp
This option group also provides the ability for the iconv,
localedef, and locale programs to operate transparently on
compressed charset definitions. When this option group is
disabled, those programs will only operate on uncompressed
charmap files.
config EGLIBC_OPTION_EGLIBC_STREAMS
bool "Support for accessing STREAMS."
default y
help
This option group includes functions for reading and writing
messages to and from STREAMS. The STREAMS interface provides a
uniform mechanism for implementing networking services and other
character-based I/O. (STREAMS are not to be confused with
<stdio.h> FILE objects, also called 'streams'.)
This option group includes the following functions:
getmsg putpmsg
getpmsg fattach
isastream fdetach
putmsg
config EGLIBC_OPTION_EGLIBC_SUNRPC
bool "Support for the Sun 'RPC' protocol."
default y
depends EGLIBC_OPTION_EGLIBC_INET
help
This option group includes support for the Sun RPC protocols,
including the 'rpcgen' and 'rpcinfo' programs.
config EGLIBC_OPTION_EGLIBC_UTMP
bool "Older access functions for 'utmp' login records"
default y
help
This option group includes the older 'utent' family of
functions for accessing user login records in the 'utmp' file.
POSIX omits these functions in favor of the 'utxent' family,
and they are obsolete on systems other than Linux.
This option group includes the following functions:
endutent
getutent
getutent_r
getutid
getutid_r
getutline
getutline_r
logwtmp
pututline
setutent
updwtmp
utmpname
This option group includes the following libraries:
libutil.so (and libutil.a)
config EGLIBC_OPTION_EGLIBC_UTMPX
bool "POSIX access functions for 'utmp' login records"
default y
depends EGLIBC_OPTION_EGLIBC_UTMP
help
This option group includes the POSIX functions for reading and
writing user login records in the 'utmp' file (usually
'/var/run/utmp'). The POSIX functions operate on 'struct
utmpx' structures, as opposed to the family of older 'utent'
functions, which operate on 'struct utmp' structures.
This option group includes the following functions:
endutxent
getutmp
getutmpx
getutxent
getutxid
getutxline
pututxline
setutxent
updwtmpx
utmpxname
config EGLIBC_OPTION_EGLIBC_WORDEXP
bool "Shell-style word expansion"
default y
help
This option group includes the 'wordexp' function for
performing word expansion in the manner of the shell, and the
accompanying 'wordfree' function.
config EGLIBC_OPTION_POSIX_C_LANG_WIDE_CHAR
bool "ISO C library wide character functions, excluding I/O"
default y
help
This option group includes the functions defined by the ISO C
standard for working with wide and multibyte characters in
memory. Functions for reading and writing wide and multibyte
characters from and to files call in the
POSIX_WIDE_CHAR_DEVICE_IO option group.
This option group includes the following functions:
btowc mbsinit wcscspn wcstoll
iswalnum mbsrtowcs wcsftime wcstombs
iswalpha mbstowcs wcslen wcstoul
iswblank mbtowc wcsncat wcstoull
iswcntrl swprintf wcsncmp wcstoumax
iswctype swscanf wcsncpy wcsxfrm
iswdigit towctrans wcspbrk wctob
iswgraph towlower wcsrchr wctomb
iswlower towupper wcsrtombs wctrans
iswprint vswprintf wcsspn wctype
iswpunct vswscanf wcsstr wmemchr
iswspace wcrtomb wcstod wmemcmp
iswupper wcscat wcstof wmemcpy
iswxdigit wcschr wcstoimax wmemmove
mblen wcscmp wcstok wmemset
mbrlen wcscoll wcstol
mbrtowc wcscpy wcstold
config EGLIBC_OPTION_POSIX_REGEXP
bool "Regular expressions"
default y
help
This option group includes the POSIX regular expression
functions, and the associated non-POSIX extensions and
compatibility functions.
With POSIX_REGEXP disabled, the following functions are
omitted from libc:
re_comp re_max_failures regcomp
re_compile_fastmap re_search regerror
re_compile_pattern re_search_2 regexec
re_exec re_set_registers regfree
re_match re_set_syntax rpmatch
re_match_2 re_syntax_options
Furthermore, the compatibility regexp interface defined in the
<regexp.h> header file, 'compile', 'step', and 'advance', is
omitted.
config EGLIBC_OPTION_POSIX_WIDE_CHAR_DEVICE_IO
bool "Input and output functions for wide characters"
default y
depends EGLIBC_OPTION_POSIX_C_LANG_WIDE_CHAR
help
This option group includes functions for reading and writing
wide characters to and from <stdio.h> streams.
This option group includes the following functions:
fgetwc fwprintf putwchar vwscanf
fgetws fwscanf ungetwc wprintf
fputwc getwc vfwprintf wscanf
fputws getwchar vfwscanf
fwide putwc vwprintf
This option group further includes the following unlocked
variants of the above functions:
fgetwc_unlocked getwc_unlocked
fgetws_unlocked getwchar_unlocked
fputwc_unlocked putwc_unlocked
fputws_unlocked putwchar_unlocked
Note that the GNU standard C++ library, 'libstdc++.so', uses
some of these functions; you will not be able to link or run
C++ programs if you disable this option group.
This option group also affects the behavior of the following
functions:
fdopen
fopen
fopen64
freopen
freopen64
These functions all take an OPENTYPE parameter which may
contain a string of the form ",ccs=CHARSET", indicating that
the underlying file uses the character set named CHARSET.
This produces a wide-oriented stream, which is only useful
when the functions included in this option group are present.
If the user attempts to open a file specifying a character set
in the OPENTYPE parameter, and EGLIBC was built with this
option group disabled, the function returns NULL, and sets
errno to EINVAL.

View File

@ -0,0 +1,11 @@
diff -ruN eglibc-2.6-orig/ports/sysdeps/unix/sysv/linux/arm/ioperm.c eglibc-2.6/ports/sysdeps/unix/sysv/linux/arm/ioperm.c
--- eglibc-2.6-orig/ports/sysdeps/unix/sysv/linux/arm/ioperm.c 2006-08-17 03:23:58.000000000 +0200
+++ eglibc-2.6/ports/sysdeps/unix/sysv/linux/arm/ioperm.c 2008-11-04 16:21:04.000000000 +0100
@@ -45,7 +45,6 @@
#include <sys/mman.h>
#include <linux/version.h>
-#include <asm/page.h>
#include <sys/sysctl.h>
#define PATH_ARM_SYSTYPE "/etc/arm_systype"

View File

@ -0,0 +1,11 @@
diff -ruN eglibc-2.7-orig/ports/sysdeps/unix/sysv/linux/arm/ioperm.c eglibc-2.7/ports/sysdeps/unix/sysv/linux/arm/ioperm.c
--- eglibc-2.7-orig/ports/sysdeps/unix/sysv/linux/arm/ioperm.c 2006-08-17 03:23:58.000000000 +0200
+++ eglibc-2.7/ports/sysdeps/unix/sysv/linux/arm/ioperm.c 2008-11-04 16:12:24.375864916 +0100
@@ -45,7 +45,6 @@
#include <sys/mman.h>
#include <linux/version.h>
-#include <asm/page.h>
#include <sys/sysctl.h>
#define PATH_ARM_SYSTYPE "/etc/arm_systype"

View File

@ -0,0 +1,13 @@
diff -ruN eglibc-2.7-orig/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h eglibc-2.7/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
--- eglibc-2.7-orig/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2007-06-06 19:48:04.000000000 +0200
+++ eglibc-2.7/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2008-11-04 16:48:29.000000000 +0100
@@ -73,6 +73,9 @@
# define DOCARGS_5 DOCARGS_4
# define UNDOCARGS_5 UNDOCARGS_4
+# define DOCARGS_6 DOCARGS_5
+# define UNDOCARGS_6 UNDOCARGS_5
+
# ifdef IS_IN_libpthread
# define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
# define CDISABLE bl PLTJMP(__pthread_disable_asynccancel)

View File

@ -0,0 +1,11 @@
diff -ruN eglibc-2.7-orig/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h eglibc-2.7/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
--- eglibc-2.7-orig/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2007-09-12 18:26:54.000000000 +0200
+++ eglibc-2.7/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2008-11-04 17:11:21.000000000 +0100
@@ -25,6 +25,7 @@
#include <atomic.h>
#include <sysdep.h>
#include <kernel-features.h>
+#include <tls.h>
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1

View File

@ -0,0 +1,13 @@
diff -ruN eglibc-2.7-orig/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h eglibc-2.7/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
--- eglibc-2.7-orig/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2007-06-06 19:48:04.000000000 +0200
+++ eglibc-2.7/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2008-11-04 16:48:29.000000000 +0100
@@ -73,6 +73,9 @@
# define DOCARGS_5 DOCARGS_4
# define UNDOCARGS_5 UNDOCARGS_4
+# define DOCARGS_6 DOCARGS_5
+# define UNDOCARGS_6 UNDOCARGS_5
+
# ifdef IS_IN_libpthread
# define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
# define CDISABLE bl PLTJMP(__pthread_disable_asynccancel)

View File

@ -0,0 +1,11 @@
diff -ruN eglibc-2.7-orig/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h eglibc-2.7/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
--- eglibc-2.7-orig/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2007-09-12 18:26:54.000000000 +0200
+++ eglibc-2.7/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2008-11-04 17:11:21.000000000 +0100
@@ -25,6 +25,7 @@
#include <atomic.h>
#include <sysdep.h>
#include <kernel-features.h>
+#include <tls.h>
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1

View File

@ -40,6 +40,7 @@ config EXTRA_GCC_CONFIG_OPTIONS
config SSP_SUPPORT
bool
depends !GCC_VERSION_3_4_6
prompt "Enable Smash Stacking Protection support" if TOOLCHAINOPTS
default n
help

View File

@ -1,8 +1,8 @@
# Makefile for to build a gcc/uClibc toolchain
#
# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
# Copyright (C) 2005-2006 Felix Fietkau <nbd@openwrt.org>
# Copyright (C) 2006-2008 OpenWrt.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -40,111 +40,163 @@ PATCH_DIR=./patches/$(PKG_VERSION)
STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
override CONFIG_AUTOREBUILD=
include $(INCLUDE_DIR)/host-build.mk
STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed
BUILD_DIR1:=$(BUILD_DIR_HOST)/gcc-$(PKG_VERSION)-initial
BUILD_DIR2:=$(BUILD_DIR_HOST)/gcc-$(PKG_VERSION)-final
PKG_BUILD_DIR0:=$(PKG_BUILD_DIR)-minimal
PKG_BUILD_DIR1:=$(PKG_BUILD_DIR)-initial
PKG_BUILD_DIR2:=$(PKG_BUILD_DIR)-final
SEP:=,
TARGET_LANGUAGES:="c$(if $(CONFIG_INSTALL_LIBSTDCPP),$(SEP)c++)$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)"
ifeq ($(CONFIG_SSP_SUPPORT),y)
SSP:=--enable-libssp
GCC_CONFIGURE_COMMON:= \
SHELL="$(BASH)" \
$(PKG_BUILD_DIR)/configure \
--prefix=$(TOOLCHAIN_DIR)/usr \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
--with-gnu-ld \
--enable-target-optspace \
--disable-libmudflap \
--disable-multilib \
--disable-nls \
$(SOFT_FLOAT_CONFIG_OPTION) \
$(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
ifneq ($(CONFIG_SSP_SUPPORT),)
GCC_CONFIGURE_COMMON+= \
--enable-libssp
else
SSP:=--disable-libssp
GCC_CONFIGURE_COMMON+= \
--disable-libssp
endif
EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-biarch --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-uclibc)
ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
GCC_CONFIGURE_COMMON+= \
--enable-biarch \
--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
endif
define Stage1/Configure
$(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,GCC_VERSION=.*,GCC_VERSION=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
mkdir -p $(BUILD_DIR1)
(cd $(BUILD_DIR1); rm -f config.cache; \
SHELL="$(BASH)" \
$(PKG_BUILD_DIR)/configure \
--prefix=$(TOOLCHAIN_DIR) \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
ifeq ($(LIBC),uClibc)
GCC_CONFIGURE_COMMON+= \
--disable-__cxa_atexit
else
GCC_CONFIGURE_COMMON+= \
--enable-__cxa_atexit
endif
GCC_CONFIGURE_STAGE0:= \
$(GCC_CONFIGURE_COMMON) \
--with-newlib \
--without-headers \
--enable-languages=c \
--disable-libgomp \
--disable-libssp \
--disable-shared \
--disable-threads \
GCC_CONFIGURE_STAGE1:= \
$(GCC_CONFIGURE_COMMON) \
--with-newlib \
--with-sysroot=$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \
--enable-languages=c \
--disable-shared \
--with-sysroot=$(BUILD_DIR_HOST)/uClibc_dev/ \
--disable-__cxa_atexit \
--enable-target-optspace \
--with-gnu-ld \
--disable-nls \
--disable-libmudflap \
--disable-multilib \
$(SSP) \
$(EXTRA_TARGET) \
$(SOFT_FLOAT_CONFIG_OPTION) \
$(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
);
endef
define Stage1/Compile
export SHELL="$(BASH)"; $(MAKE) -C $(BUILD_DIR1) all-gcc
endef
define Stage1/Install
export SHELL="$(BASH)"; $(MAKE) -C $(BUILD_DIR1) install-gcc
endef
--disable-threads \
define Stage2/Configure
mkdir -p $(BUILD_DIR2) $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)
# Important! Required for limits.h to be fixed.
rm -rf $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
ln -sf ../include $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
rm -rf $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib
ln -sf ../lib $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib
(cd $(BUILD_DIR2); rm -f config.cache; \
SHELL="$(BASH)" \
$(PKG_BUILD_DIR)/configure \
--prefix=$(TOOLCHAIN_DIR) \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
GCC_CONFIGURE_STAGE2:= \
$(GCC_CONFIGURE_COMMON) \
--enable-languages=$(TARGET_LANGUAGES) \
--enable-shared \
--disable-__cxa_atexit \
--enable-target-optspace \
--with-gnu-ld \
--disable-nls \
--disable-libmudflap \
--disable-multilib \
$(SSP) \
$(EXTRA_TARGET) \
$(SOFT_FLOAT_CONFIG_OPTION) \
$(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
--enable-threads \
--with-slibdir=$(TOOLCHAIN_DIR)/lib \
GCC_MAKE:= \
export SHELL="$(BASH)"; \
$(MAKE) \
define Build/SetToolchainInfo
$(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,GCC_VERSION=.*,GCC_VERSION=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
endef
define Stage0/Configure
mkdir -p $(PKG_BUILD_DIR0)
(cd $(PKG_BUILD_DIR0); rm -f config.cache; \
$(GCC_CONFIGURE_STAGE0) \
);
endef
define Stage0/Compile
$(GCC_MAKE) -C $(PKG_BUILD_DIR0) all-gcc
endef
define Stage0/Install
$(GCC_MAKE) -C $(PKG_BUILD_DIR0) install-gcc
endef
define Stage1/Configure
mkdir -p $(PKG_BUILD_DIR1)
(cd $(PKG_BUILD_DIR1); rm -f config.cache; \
$(GCC_CONFIGURE_STAGE1) \
);
endef
define Stage1/Compile
$(GCC_MAKE) -C $(PKG_BUILD_DIR1) all-build-libiberty all-gcc
endef
define Stage1/Install
$(GCC_MAKE) -C $(PKG_BUILD_DIR1) install-gcc
# XXX: glibc insists on linking against libgcc_eh
( cd $(TOOLCHAIN_DIR)/usr/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) ; \
[ -e libgcc_eh.a ] || ln -sf libgcc.a libgcc_eh.a ; \
)
endef
define Stage2/Configure
mkdir -p $(PKG_BUILD_DIR2) $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)
# Important! Required for limits.h to be fixed.
rm -rf $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/sys-include
ln -sf ../include $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/sys-include
rm -rf $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
ln -sf ../lib $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
(cd $(PKG_BUILD_DIR2); rm -f config.cache; \
$(GCC_CONFIGURE_STAGE2) \
);
endef
define Stage2/Compile
export SHELL="\$(BASH)"; \$(MAKE) -C \$(BUILD_DIR2) all
$(GCC_MAKE) -C $(PKG_BUILD_DIR2) all
endef
define SetupExtraArch
for app in $(TOOLCHAIN_DIR)/bin/$(OPTIMIZE_FOR_CPU)*-{gcc,gcc-*,g++}; do \
for app in $(TOOLCHAIN_DIR)/usr/bin/$(OPTIMIZE_FOR_CPU)*-{gcc,gcc-*,g++}; do \
[ -e $$$$app ] || continue; \
old_base=$$$$(basename $$$$app); \
new_base=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-$$$${old_base##$(OPTIMIZE_FOR_CPU)-}; \
sed -e "s/@CC_BASE@/$$$$old_base/" \
-e 's/@EXTRA_ARCH_OPTS@/$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_OPTS))/' \
./files/alternate-arch-cc.in > \
$(TOOLCHAIN_DIR)/bin/$$$$new_base; \
chmod a+x $(TOOLCHAIN_DIR)/bin/$$$$new_base; \
$(TOOLCHAIN_DIR)/usr/bin/$$$$new_base; \
chmod a+x $(TOOLCHAIN_DIR)/usr/bin/$$$$new_base; \
done
endef
define Stage2/Install
$(MAKE) -C $(BUILD_DIR2) \
SHELL="$(BASH)" \
install
$(GCC_MAKE) -C $(PKG_BUILD_DIR2) install
# Set up the symlinks to enable lying about target name.
set -e; \
(cd $(TOOLCHAIN_DIR); \
(cd $(TOOLCHAIN_DIR)/usr; \
ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
cd bin; \
for app in $(REAL_GNU_TARGET_NAME)-* ; do \
@ -155,21 +207,28 @@ define Stage2/Install
$(if $(CONFIG_EXTRA_TARGET_ARCH),$(call SetupExtraArch))
endef
define Build/Prepare
$(call Build/SetToolchainInfo)
$(call Build/Prepare/Default)
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
$(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(PKG_BUILD_DIR)/gcc/version.c
$(SED) 's,\(bug_report_url.. = "\).*\(";\),\1<URL:https://dev.openwrt.org/>\2,' $(PKG_BUILD_DIR)/gcc/version.c
(cd $(PKG_BUILD_DIR)/libstdc++-v3; autoconf;);
$(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(PKG_BUILD_DIR)/libstdc++-v3/configure
$(call Stage0/Configure)
$(call Stage0/Compile)
$(call Stage0/Install)
endef
define Build/Configure
$(call Stage1/Configure)
endef
define Build/Compile
$(call Stage1/Configure)
$(call Stage1/Compile)
$(if $(wildcard $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gcc),,$(call Stage1/Install))
$(call Stage1/Install)
endef
define Build/Install
@ -181,11 +240,13 @@ endef
define Build/Clean
rm -rf \
$(PKG_BUILD_DIR) \
$(BUILD_DIR1) \
$(BUILD_DIR2) \
$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME) \
$(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gc* \
$(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-c*
$(PKG_BUILD_DIR0) \
$(PKG_BUILD_DIR1) \
$(PKG_BUILD_DIR2) \
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
$(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME) \
$(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gc* \
$(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-c*
endef
$(eval $(call HostBuild))

View File

@ -0,0 +1,58 @@
#
# Copyright (C) 2006-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=glibc-ports
PKG_VERSION:=$(call qstrip,$(CONFIG_GLIBC_VERSION))
ifeq ($(PKG_VERSION),2.3.6)
PKG_MD5SUM:=40dce745d34ff80401da2fdfe58f6d53
endif
ifeq ($(PKG_VERSION),2.6.1)
PKG_MD5SUM:=53d88ca624642dd267752ccce77b19d0
endif
ifeq ($(PKG_VERSION),2.7)
PKG_MD5SUM:=eaeb8527b8fa286c2d887157214f9998
endif
PKG_SOURCE_URL:=@GNU/glibc/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_CAT:=bzcat
PATCH_DIR:=./patches/$(PKG_VERSION)
STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
override CONFIG_AUTOREBUILD=
include $(INCLUDE_DIR)/host-build.mk
STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.glibc-ports_built
STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.glibc-ports_installed
define Build/Prepare
$(call Build/Prepare/Default)
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
endef
define Build/Configure
endef
define Build/Compile
endef
define Build/Install
endef
define Build/Clean
rm -rf \
$(PKG_BUILD_DIR) \
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
endef
$(eval $(call HostBuild))

View File

@ -0,0 +1,13 @@
http://sourceware.org/ml/crossgcc/2008-05/msg00014.html
diff -durN glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/arm/ioperm.c glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/ioperm.c
--- glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/arm/ioperm.c 2005-06-10 13:12:09.000000000 +0200
+++ glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/ioperm.c 2008-05-18 16:19:45.000000000 +0200
@@ -45,7 +45,6 @@
#include <sys/mman.h>
#include <linux/version.h>
-#include <asm/page.h>
#include <sys/sysctl.h>
#define PATH_ARM_SYSTYPE "/etc/arm_systype"

View File

@ -0,0 +1,13 @@
diff -durN glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
--- glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2005-11-16 20:22:59.000000000 +0100
+++ glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2007-09-06 13:53:16.000000000 +0200
@@ -132,3 +132,9 @@
# define NO_CANCELLATION 1
#endif
+
+#ifndef __ASSEMBLER__
+# define RTLD_SINGLE_THREAD_P \
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) == 0, 1)
+#endif

View File

@ -0,0 +1,11 @@
diff -ruN glibc-ports-2.7-orig/sysdeps/mips/mips32/Makefile glibc-ports-2.7/sysdeps/mips/mips32/Makefile
--- glibc-ports-2.7-orig/ports/sysdeps/mips/mips32/Makefile 2003-03-29 09:15:28.000000000 +0100
+++ glibc-ports-2.7/sysdeps/mips/mips32/Makefile 2008-10-01 17:04:40.475005748 +0200
@@ -1,3 +1,7 @@
+ifeq ($(filter -DBOOTSTRAP_GCC,$(CFLAGS)),)
ifeq ($(filter -mabi=32,$(CC)),)
CC += -mabi=32
endif
+else
+CC += -D"_MIPS_SZPTR=32"
+endif

View File

@ -0,0 +1,21 @@
From: http://sourceware.org/ml/crossgcc/2008-10/msg00044.html
From: http://sources.redhat.com/ml/libc-ports/2007-06/msg00005.html
2007-06-07 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/nofpu/Makefile: Remove fe_nomask from libm-support.
diff -urN glibc-ports-2.6.1.orig/sysdeps/powerpc/nofpu/Makefile glibc-ports-2.6.1/sysdeps/powerpc/nofpu/Makefile
--- glibc-ports-2.6.1.orig/sysdeps/powerpc/nofpu/Makefile 2006-11-22 09:13:11.000000000 -0600
+++ glibc-ports-2.6.1/sysdeps/powerpc/nofpu/Makefile 2007-06-07 09:53:05.708240976 -0500
@@ -6,7 +6,7 @@
endif
ifeq ($(subdir),math)
-libm-support += fenv_const fe_nomask
+libm-support += fenv_const
CPPFLAGS += -I../soft-fp/
# The follow CFLAGS are a work around for GCC Bugzilla Bug 29253
# "expand_abs wrong default code for floating point"

View File

@ -0,0 +1,13 @@
http://sourceware.org/ml/crossgcc/2008-05/msg00014.html
diff -durN glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/arm/ioperm.c glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/ioperm.c
--- glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/arm/ioperm.c 2005-06-10 13:12:09.000000000 +0200
+++ glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/ioperm.c 2008-05-18 16:19:45.000000000 +0200
@@ -45,7 +45,6 @@
#include <sys/mman.h>
#include <linux/version.h>
-#include <asm/page.h>
#include <sys/sysctl.h>
#define PATH_ARM_SYSTYPE "/etc/arm_systype"

View File

@ -0,0 +1,13 @@
diff -durN glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
--- glibc-ports-2.6.1.orig/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2005-11-16 20:22:59.000000000 +0100
+++ glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2007-09-06 13:53:16.000000000 +0200
@@ -126,3 +126,9 @@
# define NO_CANCELLATION 1
#endif
+
+#ifndef __ASSEMBLER__
+# define RTLD_SINGLE_THREAD_P \
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) == 0, 1)
+#endif

View File

@ -0,0 +1,15 @@
http://sourceware.org/ml/libc-ports/2008-02/msg00005.html
diff -durN glibc-ports-2.7.orig/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h glibc-ports-2.7/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
--- glibc-ports-2.7.orig/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2007-06-06 19:27:04.000000000 +0200
+++ glibc-ports-2.7/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2008-05-18 16:57:21.000000000 +0200
@@ -73,6 +73,9 @@
# define DOCARGS_5 DOCARGS_4
# define UNDOCARGS_5 UNDOCARGS_4
+# define DOCARGS_6 DOCARGS_5
+# define UNDOCARGS_6 UNDOCARGS_5
+
# ifdef IS_IN_libpthread
# define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
# define CDISABLE bl PLTJMP(__pthread_disable_asynccancel)

View File

@ -0,0 +1,13 @@
http://www.nabble.com/arm-linux-compilation-failure-and-possible-fix-td19229074.html
diff -durN glibc-ports-2.7.orig/sysdeps/unix/sysv/linux/arm/ioperm.c glibc-ports-2.7/sysdeps/unix/sysv/linux/arm/ioperm.c
--- glibc-ports-2.7.orig/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h.orig 2008-10-04 20:46:13.000000000 +0200
+++ glibc-ports-2.7/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2008-10-04 20:45:40.000000000 +0200
@@ -25,6 +25,7 @@
#include <atomic.h>
#include <sysdep.h>
#include <kernel-features.h>
+#include <tls.h>
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1

View File

@ -0,0 +1,11 @@
diff -ruN glibc-ports-2.7-orig/sysdeps/mips/mips32/Makefile glibc-ports-2.7/sysdeps/mips/mips32/Makefile
--- glibc-ports-2.7-orig/sysdeps/mips/mips32/Makefile 2003-03-29 09:15:28.000000000 +0100
+++ glibc-ports-2.7/sysdeps/mips/mips32/Makefile 2008-10-01 17:04:40.475005748 +0200
@@ -1,3 +1,7 @@
+ifeq ($(filter -DBOOTSTRAP_GCC,$(CFLAGS)),)
ifeq ($(filter -mabi=32,$(CC)),)
CC += -mabi=32
endif
+else
+CC += -D"_MIPS_SZPTR=32"
+endif

17
toolchain/glibc/Config.in Normal file
View File

@ -0,0 +1,17 @@
choice
prompt "glibc version"
depends on TOOLCHAINOPTS && USE_GLIBC
default GLIBC_VERSION_2_6_1
help
Select the version of glibc you wish to use.
config GLIBC_VERSION_2_3_6
bool "glibc 2.3.6"
config GLIBC_VERSION_2_6_1
bool "glibc 2.6.1"
config GLIBC_VERSION_2_7
bool "glibc 2.7"
endchoice

View File

@ -0,0 +1,15 @@
config GLIBC_VERSION
string
depends on USE_GLIBC
default "2.3.6" if GLIBC_VERSION_2_3_6
default "2.6.1" if GLIBC_VERSION_2_6_1
default "2.7" if GLIBC_VERSION_2_7
default "2.7"
config GLIBC_PORTS
bool
depends on USE_GLIBC
default y if GLIBC_VERSION_2_3_6 && (arm || armeb || mips || mipsel)
default y if GLIBC_VERSION_2_6_1 && (arm || armeb || mips || mipsel || powerpc)
default y if GLIBC_VERSION_2_7 && (arm || armeb || mips || mipsel || powerpc)
default n

179
toolchain/glibc/Makefile Normal file
View File

@ -0,0 +1,179 @@
#
# Copyright (C) 2006-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=glibc
PKG_VERSION:=$(call qstrip,$(CONFIG_GLIBC_VERSION))
ifeq ($(PKG_VERSION),2.3.6)
PKG_MD5SUM:=bfdce99f82d6dbcb64b7f11c05d6bc96
endif
ifeq ($(PKG_VERSION),2.6.1)
PKG_MD5SUM:=11cf6d3fc86dbe0890b8d00372eb6286
endif
ifeq ($(PKG_VERSION),2.7)
PKG_MD5SUM:=065c5952b439deba40083ccd67bcc8f7
endif
PKG_SOURCE_URL:=@GNU/glibc/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_CAT:=bzcat
PATCH_DIR:=./patches/$(PKG_VERSION)
STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
override CONFIG_AUTOREBUILD=
include $(INCLUDE_DIR)/host-build.mk
STAMP_BUILT:=$(TOOLCHAIN_DIR)/stamp/.glibc_built
STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.glibc_installed
PKG_BUILD_DIR1:=$(PKG_BUILD_DIR)-initial
PKG_BUILD_DIR2:=$(PKG_BUILD_DIR)-final
GLIBC_ADD_ONS+=nptl,
ifneq ($(CONFIG_GLIBC_PORTS),)
GLIBC_ADD_ONS+=ports,
define Build/Prepare/ports
ln -snf ../glibc-ports $(PKG_BUILD_DIR)/ports
endef
endif
# XXX: {e,}glibc does not build w/ -Os
# http://sourceware.org/bugzilla/show_bug.cgi?id=5203
GLIBC_CFLAGS:=$(subst -Os,-O2,$(TARGET_CFLAGS))
GLIBC_CONFIGURE_COMMON:= \
BUILD_CC="$(HOSTCC)" \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(GLIBC_CFLAGS)" \
libc_cv_forced_unwind=yes \
libc_cv_c_cleanup=yes \
libc_cv_386_tls=yes \
$(PKG_BUILD_DIR)/configure \
--prefix=/usr \
--build=$(GNU_HOST_NAME) \
--host=$(REAL_GNU_TARGET_NAME) \
--with-headers="$(TOOLCHAIN_DIR)/usr/include" \
--disable-debug \
--disable-profile \
--enable-add-ons="$(GLIBC_ADD_ONS)" \
--without-gd \
--without-cvs \
ifeq ($(CONFIG_SOFT_FLOAT),)
GLIBC_CONFIGURE_COMMON+= \
--with-fp
else
GLIBC_CONFIGURE_COMMON+= \
--without-fp
endif
GLIBC_CONFIGURE_STAGE1:= \
$(GLIBC_CONFIGURE_COMMON) \
--disable-sanity-checks \
--enable-hacker-mode \
GLIBC_CONFIGURE_STAGE2:= \
$(GLIBC_CONFIGURE_COMMON) \
GLIBC_MAKE:= \
$(MAKE) \
define Build/SetToolchainInfo
$(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.gnu.org/software/libc/,' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,^\(LIBC_PATCHVER\)=.*,\1=,' $(TOOLCHAIN_DIR)/info.mk
endef
define Stage1/Configure
mkdir -p $(PKG_BUILD_DIR1)
( cd $(PKG_BUILD_DIR1); rm -f config.cache; \
$(GLIBC_CONFIGURE_STAGE1) \
);
endef
define Stage1/Compile
endef
define Stage1/Install
$(GLIBC_MAKE) -C $(PKG_BUILD_DIR1) \
CFLAGS="-DBOOTSTRAP_GCC" \
cross-compiling=yes \
install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \
install-headers
[ -f $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/bits/stdio_lim.h ] || \
$(CP) $(PKG_BUILD_DIR1)/bits/stdio_lim.h \
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/bits/stdio_lim.h
[ -f $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/gnu/stubs.h ] || \
touch $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/gnu/stubs.h
endef
define Stage2/Configure
mkdir -p $(PKG_BUILD_DIR2)
( cd $(PKG_BUILD_DIR2); rm -f config.cache; \
$(GLIBC_CONFIGURE_STAGE2) \
);
endef
define Stage2/Compile
$(GLIBC_MAKE) -C $(PKG_BUILD_DIR2) all
endef
define Stage2/Install
$(GLIBC_MAKE) -C $(PKG_BUILD_DIR2) \
install_root="$(TOOLCHAIN_DIR)" \
install
( cd $(TOOLCHAIN_DIR) ; \
for d in lib usr/lib ; do \
for f in libc.so libpthread.so libgcc_s.so ; do \
if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \
$(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \
fi \
done \
done \
)
endef
define Build/Prepare
$(call Build/SetToolchainInfo)
$(call Build/Prepare/Default)
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
$(call Build/Prepare/ports)
$(call Stage1/Configure)
$(call Stage1/Compile)
$(call Stage1/Install)
endef
define Build/Configure
endef
define Build/Compile
$(call Stage2/Configure)
$(call Stage2/Compile)
$(call Stage2/Install)
endef
define Build/Install
endef
define Build/Clean
rm -rf \
$(PKG_BUILD_DIR) \
$(PKG_BUILD_DIR1) \
$(PKG_BUILD_DIR2) \
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
endef
$(eval $(call HostBuild))

View File

@ -0,0 +1,26 @@
From http://svn.exactcode.de/t2/trunk/package/base/glibc32/make-install-lib-all.patch
Rule to install all needed libraries, not just the ones installed by install-lib,
yet not install programs.
Needed because we can't use the main install target, as we can't build programs before
we have the final gcc installed; linking fails because libeh.a is not present,
and glibc insists on linking programs with that library.
diff -Naur glibc-2.3.4.orig/Makerules glibc-2.3.4/Makerules
--- glibc-2.3.4.orig/Makerules 2004-12-15 20:52:39.000000000 +0200
+++ glibc-2.3.4/Makerules 2005-02-19 15:16:31.415125176 +0200
@@ -844,6 +844,13 @@
installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
$(inst_libdir)/$(patsubst %,$(libtype$o),\
$(libprefix)$(libc-name)))
+
+install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \
+ $(inst_slibdir)/libc-$(version).so \
+ $(inst_libdir)/libc.so \
+ $(inst_libdir)/libc.a \
+ install-lib
+
install: $(installed-libcs)
$(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
$(make-target-directory)
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>

View File

@ -0,0 +1,37 @@
http://sourceware.org/ml/crossgcc/2005-05/msg00165.html
Fixes a MIPS build problem (unrelated to NPTL)
Message-ID: <428E8B24.1000201@realitydiluted.com>
Date: Fri, 20 May 2005 20:13:08 -0500
From: "Steven J dot Hill" <sjhill at realitydiluted dot com>
To: crossgcc at sources dot redhat dot com, toolchain at gentoo dot org,
Shay_Gal-On at pmc-sierra dot com, TheNop at gmx dot net
Subject: New NPTL patches for crosstools and MIPS NPTL patches....
Greetings.
I have uploaded the latest NPTL patch for crosstool-0.34. I have also
uploaded a tarball of the patches necessary to build a MIPS NPTL
cross toolchain. To build a MIPS NPTL toolchain you will need the
released version of binutils-2.16 and the absolute latest GCC and
glibc code from the HEAD of cvs. Use the 'demo-mips-nptl.sh' script
to build the toolchain. Please report bugs or issues to the crossgcc
mailing list. Here is the link off of my FTP site:
ftp://ftp.realitydiluted.com/crosstools/crosstool-0.34/
[Note: BOOTSTRAP_GCC is set by crosstool.sh when invoking make install-headers]
diff -ur glibc-2.4.0-20050406/sysdeps/mips/mips32/Makefile glibc-2.4.0-20050406-patched/sysdeps/mips/mips32/Makefile
--- glibc-2.4.0-20050406/sysdeps/mips/mips32/Makefile 2003-03-29 02:15:28.000000000 -0600
+++ glibc-2.4.0-20050406-patched/sysdeps/mips/mips32/Makefile 2005-04-12 21:36:51.318837655 -0500
@@ -1,3 +1,7 @@
+ifeq ($(filter -DBOOTSTRAP_GCC,$(CFLAGS)),)
ifeq ($(filter -mabi=32,$(CC)),)
CC += -mabi=32
endif
+else
+CC += -D"_MIPS_SZPTR=32"
+endif
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>

View File

@ -0,0 +1,22 @@
diff -ruN glibc-2.3.6-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S glibc-2.3.6/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S
--- glibc-2.3.6-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S 2003-07-12 00:46:12.000000000 +0200
+++ glibc-2.3.6/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S 2008-11-10 16:02:12.760497684 +0100
@@ -42,7 +42,11 @@
#define stackblock 20
#ifndef __socket
+#ifndef NO_WEAK_ALIAS
#define __socket P(__,socket)
+#else
+#define __socket socket
+#endif
#endif
.text
@@ -120,4 +124,6 @@
PSEUDO_END (__socket)
+#ifndef NO_WEAK_ALIAS
weak_alias (__socket, socket)
+#endif

View File

@ -0,0 +1,12 @@
diff -ruN glibc-2.3.6-orig/sysdeps/powerpc/powerpc32/Makefile glibc-2.3.6/sysdeps/powerpc/powerpc32/Makefile
--- glibc-2.3.6-orig/sysdeps/powerpc/powerpc32/Makefile 2003-07-12 00:46:12.000000000 +0200
+++ glibc-2.3.6/sysdeps/powerpc/powerpc32/Makefile 2008-11-10 16:02:12.760497684 +0100
@@ -21,7 +21,7 @@
ifneq ($(elf),no)
# The initfini generation code doesn't work in the presence of -fPIC, so
# we use -fpic instead which is much better.
-CFLAGS-initfini.s = -g0 -fpic -O1
+CFLAGS-initfini.s = -fpic -O1 $(fno-unit-at-a-time)
# There is no benefit to using sdata for these objects, and the user
# of the library should be able to control what goes into sdata.

View File

@ -1,4 +1,6 @@
TARGET_CROSS=
GCC_VERSION=unknown
UCLIBC_VERSION=unknown
UCLIBC_PATCHVER=
LIBC_TYPE=unknown
LIBC_URL=unknown
LIBC_VERSION=unknown
LIBC_PATCHVER=

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -11,6 +11,7 @@ BUILD_DIR := $(KERNEL_BUILD_DIR)
STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
override QUILT:=
override CONFIG_AUTOREBUILD=
@ -20,27 +21,14 @@ PKG_NAME:=linux
PKG_VERSION:=$(LINUX_VERSION)
PKG_SOURCE:=$(LINUX_SOURCE)
PKG_SOURCE_URL:=$(LINUX_SITE)
PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
PKG_MD5SUM:=$(LINUX_KERNEL_MD5SUM)
LINUX_DIR := $(PKG_BUILD_DIR)
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/kernel-defaults.mk
define Build/Configure/cris
ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/include/asm-cris/arch
ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/arch/cris/arch
endef
define Build/Configure/powerpc
if [ -d $(PKG_BUILD_DIR)/include/asm-ppc ]; then \
$(CP) $(PKG_BUILD_DIR)/include/asm-ppc/* $(PKG_BUILD_DIR)/include/asm-powerpc/; \
rm -rf $(PKG_BUILD_DIR)/include/asm-ppc; \
ln -s $(PKG_BUILD_DIR)/include/asm-powerpc $(PKG_BUILD_DIR)/include/asm-ppc; \
fi
endef
ifneq (,$(findstring uml,$(BOARD)))
ifeq ($(strip $(BOARD)),uml)
LINUX_KARCH:=$(ARCH)
endif
@ -49,6 +37,39 @@ KMAKE := $(MAKE) -C $(PKG_BUILD_DIR) \
KBUILD_HAVE_NLS=no \
CONFIG_SHELL=$(BASH)
define Build/Prepare/pre/cris
ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/include/asm-cris/arch
ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/arch/cris/arch
endef
define Build/Prepare/pre/powerpc
if [ -d $(PKG_BUILD_DIR)/include/asm-ppc ]; then \
$(CP) $(PKG_BUILD_DIR)/include/asm-ppc/* $(PKG_BUILD_DIR)/include/asm-powerpc/; \
rm -rf $(PKG_BUILD_DIR)/include/asm-ppc; \
ln -s $(PKG_BUILD_DIR)/include/asm-powerpc $(PKG_BUILD_DIR)/include/asm-ppc; \
fi
endef
ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.18)),1)
define Build/Prepare/all
mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr
$(KMAKE) \
CROSS_COMPILE=$(TARGET_CROSS) \
INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/" \
headers_install
endef
else
define Build/Prepare/all
mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include
cp -pLR \
$(BUILD_DIR_TOOLCHAIN)/linux/include/asm \
$(BUILD_DIR_TOOLCHAIN)/linux/include/asm-generic \
$(BUILD_DIR_TOOLCHAIN)/linux/include/asm-$(LINUX_KARCH) \
$(BUILD_DIR_TOOLCHAIN)/linux/include/linux \
$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/
endef
endif
define Build/Prepare
$(call Kernel/Prepare/Default)
$(SED) 's/@expr length/@-expr length/' $(PKG_BUILD_DIR)/Makefile
@ -60,7 +81,8 @@ define Build/Prepare
$(PKG_BUILD_DIR)/arch/$(LINUX_KARCH)/include/asm/. \
$(PKG_BUILD_DIR)/include/asm-$(LINUX_KARCH)/; \
fi
$(call Build/Configure/$(ARCH))
$(call Build/Prepare/pre/$(ARCH))
$(call Build/Prepare/all)
endef
define Build/Configure
@ -69,7 +91,39 @@ endef
define Build/Compile
endef
define Build/Install/all
mkdir -p $(TOOLCHAIN_DIR)/usr/include
$(CP) \
$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/* \
$(TOOLCHAIN_DIR)/usr/include/
endef
# XXX: the following is needed to build lzma-loader
define Build/Install/post/lzma
$(CP) \
$(BUILD_DIR_TOOLCHAIN)/linux/include/asm-mips/asm.h \
$(BUILD_DIR_TOOLCHAIN)/linux/include/asm-mips/regdef.h \
$(TOOLCHAIN_DIR)/usr/include/asm/
endef
define Build/Install/post/mips
$(call Build/Install/post/lzma)
endef
define Build/Install/post/mipsel
$(call Build/Install/post/lzma)
endef
define Build/Install
$(call Build/Install/all)
$(call Build/Install/post/$(ARCH))
endef
define Build/Clean
rm -rf \
$(PKG_BUILD_DIR) \
$(BUILD_DIR_TOOLCHAIN)/linux \
$(BUILD_DIR_TOOLCHAIN)/linux-dev
endef
$(eval $(call HostBuild))

View File

@ -1,7 +1,8 @@
# Choose uclibc version.
choice
prompt "uClibc Version" if TOOLCHAINOPTS
prompt "uClibc Version"
depends on TOOLCHAINOPTS && USE_UCLIBC
default UCLIBC_VERSION_0_9_29
help
Select the version of uClibc you wish to use.
@ -20,7 +21,8 @@ endchoice
config UCLIBC_EXTRA_VERSION
string
prompt "Extra uClibc version" if TOOLCHAINOPTS
prompt "Extra uClibc version"
depends on TOOLCHAINOPTS && USE_UCLIBC
default "snapshot" if UCLIBC_VERSION_SNAPSHOT
default ".2" if UCLIBC_VERSION_0_9_28
default ""

View File

@ -1,8 +1,8 @@
config UCLIBC_VERSION
string
depends on USE_UCLIBC
default "" if UCLIBC_VERSION_snapshot
default "0.9.28" if UCLIBC_VERSION_0_9_28
default "0.9.29" if UCLIBC_VERSION_0_9_29
default "0.9.29"

View File

@ -54,6 +54,7 @@ ifeq ($(PKG_VERSION_SNAPSHOT),y)
else
PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/uClibc-$(PKG_VERSION)$(PKG_EXTRAVERSION)
endif
override CONFIG_AUTOREBUILD=
include $(INCLUDE_DIR)/host-build.mk
@ -76,12 +77,13 @@ UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
-e 's/cris.*/cris/' \
)
# Remove me when there are no 2.6.23 targets
ifeq ($(findstring 86,$(ARCH)),86)
ifneq ($(LINUX_2_6_23),y)
UCLIBC_TARGET_ARCH:=x86
endif
endif
define Build/SetToolchainInfo
$(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.uclibc.org/,' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,^\(LIBC_PATCHVER\)=.*,\1=$(PKG_EXTRAVERSION),' $(TOOLCHAIN_DIR)/info.mk
endef
define Build/Prepare/Snapshot
$(PKG_UNPACK)
@ -94,25 +96,27 @@ endef
define Build/Prepare/V_0_9_28
$(SED) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_HEADERS_DIR)\",g' \
$(PKG_BUILD_DIR)/.config
ifeq ($(CONFIG_SOFT_FLOAT),y)
ifeq ($(CONFIG_SOFT_FLOAT),y)
$(SED) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(PKG_BUILD_DIR)/.config
endif
ifeq ($(CONFIG_C99_MATH),y)
endif
ifeq ($(CONFIG_C99_MATH),y)
$(SED) 's,.*DO_C99_MATH.*,DO_C99_MATH=y,g' $(PKG_BUILD_DIR)/.config
endif
endif
endef
define Build/Prepare
$(call Build/SetToolchainInfo)
@echo prepare uClibc version $(PKG_VERSION)$(PKG_EXTRAVERSION)
ifeq ($(PKG_VERSION_SNAPSHOT),y)
ifeq ($(PKG_VERSION_SNAPSHOT),y)
$(call Build/Prepare/Snapshot)
else
else
$(call Build/Prepare/Default)
endif
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
endif
$(CP) ./$(CONFIG_DIR)/$(ARCH)$(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD)) $(PKG_BUILD_DIR)/.config
ifeq ($(PKG_VERSION),0.9.28)
ifeq ($(PKG_VERSION),0.9.28)
$(call Build/Prepare/V_0_9_28)
endif
endif
$(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(LINUX_HEADERS_DIR)/include\",g' \
-e 's,.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,y),g' \
-e 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=$(if $(CONFIG_LARGEFILE),y,n),g' \
@ -120,33 +124,11 @@ endif
-e 's,^.*CONFIG_ARM_OABI.*,CONFIG_ARM_OABI=$(if $(CONFIG_EABI_SUPPORT),n,y),g' \
-e 's,^.*UCLIBC_HAS_SHADOW.*,UCLIBC_HAS_SHADOW=$(if $(CONFIG_SHADOW_PASSWORDS),y,n),g' \
$(PKG_BUILD_DIR)/.config
mkdir -p $(BUILD_DIR_HOST)/uClibc_dev/usr/include
mkdir -p $(BUILD_DIR_HOST)/uClibc_dev/usr/lib
mkdir -p $(BUILD_DIR_HOST)/uClibc_dev/lib
# if [ ! -f $(BUILD_DIR_HOST)/uClibc_dev/usr/include/linux/version.h ] ; then \
# cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/* $(BUILD_DIR_HOST)/uClibc_dev/usr/include/; \
# cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/* $(TOOLCHAIN_DIR)/include/ ; \
# cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/* $(PKG_BUILD_DIR)/include/ ; \
# fi;
if [ ! -f $(BUILD_DIR_HOST)/uClibc_dev/usr/include/linux/version.h ] ; then \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/asm $(BUILD_DIR_HOST)/uClibc_dev/usr/include/; \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/asm-$(UCLIBC_TARGET_ARCH) $(BUILD_DIR_HOST)/uClibc_dev/usr/include/; \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/asm-generic $(BUILD_DIR_HOST)/uClibc_dev/usr/include/; \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/linux $(BUILD_DIR_HOST)/uClibc_dev/usr/include/; \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/asm $(TOOLCHAIN_DIR)/include/ ; \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/asm-$(UCLIBC_TARGET_ARCH) $(TOOLCHAIN_DIR)/include/ ; \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/asm-generic $(TOOLCHAIN_DIR)/include/ ; \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/linux $(TOOLCHAIN_DIR)/include/ ; \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/asm $(PKG_BUILD_DIR)/include/ ; \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/asm-$(UCLIBC_TARGET_ARCH) $(PKG_BUILD_DIR)/include/ ; \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/asm-generic $(PKG_BUILD_DIR)/include/ ; \
cp -pLR $(BUILD_DIR_TOOLCHAIN)/linux/include/linux $(PKG_BUILD_DIR)/include/ ; \
fi;
$(MAKE) -C $(PKG_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS"
PATH=$(TARGET_PATH) $(MAKE) -C $(PKG_BUILD_DIR) \
PREFIX=$(BUILD_DIR_HOST)/uClibc_dev/ \
PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \
DEVEL_PREFIX=/usr/ \
RUNTIME_PREFIX=$(BUILD_DIR_HOST)/uClibc_dev/ \
RUNTIME_PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \
HOSTCC="$(HOSTCC)" \
CPU_CFLAGS="$(TARGET_CFLAGS)" \
pregen install_dev;
@ -157,7 +139,7 @@ endef
UCLIBC_MAKE := PATH=$(TARGET_PATH) $(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
DEVEL_PREFIX=/ \
DEVEL_PREFIX=/usr/ \
RUNTIME_PREFIX=/ \
HOSTCC="$(HOSTCC)" \
CPU_CFLAGS="$(TARGET_CFLAGS)"
@ -165,24 +147,36 @@ UCLIBC_MAKE := PATH=$(TARGET_PATH) $(MAKE) -C $(PKG_BUILD_DIR) \
define Build/Compile
$(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(PKG_BUILD_DIR)/Rules.mak
$(UCLIBC_MAKE) PREFIX= all
$(UCLIBC_MAKE) PREFIX=$(STAGING_DIR_HOST)/ install_runtime install_dev
$(SED) 's,UCLIBC_VERSION=.*,UCLIBC_VERSION=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
$(SED) 's,UCLIBC_PATCHVER=.*,UCLIBC_PATCHVER=$(PKG_EXTRAVERSION),' $(TOOLCHAIN_DIR)/info.mk
rm -rf $(TOOLCHAIN_DIR)/lib/libc.so
ln -s libc.so.0 $(TOOLCHAIN_DIR)/lib/libc.so
$(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev
ln -sf ../../lib/libc.so.0 $(TOOLCHAIN_DIR)/usr/lib/libc.so
# ( cd $(TOOLCHAIN_DIR) ; \
# for d in lib usr/lib ; do \
# for f in libc.so libpthread.so libgcc_s.so ; do \
# if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \
# $(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \
# fi \
# done \
# done \
# )
endef
define Build/Install
$(UCLIBC_MAKE) PREFIX= utils
$(INSTALL_DIR) $(TOOLCHAIN_DIR)/target-utils
$(INSTALL_DIR) $(TOOLCHAIN_DIR)/usr/bin
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/utils/ldd \
$(TOOLCHAIN_DIR)/usr/bin/
$(INSTALL_DIR) $(TOOLCHAIN_DIR)/sbin
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/utils/ldconfig \
$(TOOLCHAIN_DIR)/target-utils/
$(TOOLCHAIN_DIR)/sbin/
endef
define Build/Clean
rm -rf $(PKG_BUILD_DIR) $(BUILD_DIR_HOST)/uClibc_dev
rm -rf \
$(PKG_BUILD_DIR) \
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev
endef
$(eval $(call HostBuild))