diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2011-06-24 16:24:25 +0200 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2011-06-24 16:24:25 +0200 |
commit | 7682323a3a798d6f15708f228f859a64cb869aa3 (patch) | |
tree | 0f3648e92245745c9828db3175651974b10c9ae4 | |
parent | 3004ce0c9619f89bf8e64931edd696bf4df8d2e1 (diff) | |
parent | 74da7a88552ecf518e64642c90742fddca57be00 (diff) |
Merge remote-tracking branch 'origin/master' into prelink
* origin/master: (61 commits)
fts: fix warning due to old-style function definition
ldso_tls: fix compiler warning due to missing cast
resolv: fix bug in res_init with ipv6 nameservers
config: Fix passing defconfig args
buildsys: pt-initfini.s depends on uClibc_config.h
libdl: search for ELF_RTYPE_CLASS_DLSYM in dlsym()
resolv: try next server on SERVFAIL
getaddrinfo: allow numeric service without any hints
bump version to 0.9.33-git
nptl/pthread: Correct path for machine specific pt-initfini.c
ctor/dtor nptl: Fix init and fini function compilation
Rules.mak: Rearrange appending UCLIBC_EXTRA_CFLAGS to CFLAGS
ARM: remove EABI/OABI selection
ARM: detect BX availibility at build time
ARM: #include <bits/arm_asm.h> where __USE_BX__ is used
ARM: transform the EABI/OABI choice into a boolean
ARM: remove sub-arch/variants selection from menuconfig
ARM: introduce blind options to select & force THUMB mode
ARM: reorder "Use BX" option
Fix __libc_epoll_pwait compile failure on x86
...
Conflicts:
ldso/libdl/libdl.c
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
72 files changed, 613 insertions, 579 deletions
diff --git a/Makefile.help b/Makefile.help index 1c2c96e04..d99cf9634 100644 --- a/Makefile.help +++ b/Makefile.help @@ -60,4 +60,5 @@ help: @echo ' and the include dir (usually "/usr")' @echo ' MULTILIB_DIR= - Directory component for libraries (default "lib").' @echo ' UCLIBC_EXTRA_CFLAGS - extra CFLAGS for compiling uClibc' + @echo ' UCLIBC_EXTRA_CPPFLAGS - extra CPPFLAGS for compiling uClibc' diff --git a/Makefile.in b/Makefile.in index 2f8370b0f..ad9e629e1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -161,7 +161,7 @@ headers-y += $(target-headers-sysdep) headers: $(top_builddir)include/bits/uClibc_config.h | subdirs subdirs: $(addprefix $(top_builddir),$(subdirs)) pregen-headers: $(top_builddir)include/bits/sysnum.h $(pregen-headers-y) -pregen: pregen-headers +pregen: headers pregen-headers $(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers) $(top_builddir)include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscall_h.sh | $(top_builddir)include/bits @@ -338,7 +338,7 @@ else endif ifeq ($(UCLIBC_HAS_BACKTRACE),y) # Add the AS_NEEDED entry for libubacktrace.so - if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_MAJORNAME) ] ; then \ + if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_LIBNAME) ] ; then \ echo "GROUP ( $(UBACKTRACE_ASNEEDED) )" >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \ fi endif @@ -448,8 +448,8 @@ allnoconfig: $(top_builddir)extra/config/conf $(Q)$(top_builddir)extra/config/conf -n extra/Configs/Config.in defconfig: $(top_builddir)extra/config/conf - $(Q)$(top_builddir)extra/config/conf -d extra/Configs/Config.in \ - -D extra/Configs/defconfigs/$(ARCH) + $(Q)$(top_builddir)extra/config/conf \ + -D extra/Configs/defconfigs/$(ARCH) extra/Configs/Config.in menuconfig-clean-y: $(Q)$(MAKE) -C extra/config CLEAN_extra/config @@ -233,12 +233,12 @@ cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) \ $(CFLAGS-$(notdir $<)) \ $(CFLAGS-$(notdir $@)) \ $(CFLAGS_gen.dep) -cmd_compile.i = $(cmd_compile.c:-c=-E -dD $(EXTRA_CPPFLAGS)) +cmd_compile.i = $(cmd_compile.c:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS) cmd_compile.s = $(cmd_compile.c:-c=-S) cmd_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS) $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep) cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@)) cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@)) -cmd_compile.mi= $(cmd_compile.m:-c=-E -dD $(EXTRA_CPPFLAGS)) +cmd_compile.mi= $(cmd_compile.m:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS) cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@)) $(sort $(foreach d,$(^:$(top_srcdir)=),$(collect_multi_flags))) cmd_strip = $(STRIPTOOL) $(STRIP_FLAGS) $^ @@ -105,8 +105,8 @@ export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS MULTILIB_DIR # Now config hard core MAJOR_VERSION := 0 MINOR_VERSION := 9 -SUBLEVEL := 32 -EXTRAVERSION :=-rc3-git +SUBLEVEL := 33 +EXTRAVERSION :=-git VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL) ABI_VERSION := $(MAJOR_VERSION) ifneq ($(EXTRAVERSION),) @@ -186,6 +186,7 @@ OPTIMIZATION+=$(call check_gcc,-Os,-O2) OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,) # shrinks code by about 0.1% OPTIMIZATION+=$(call check_gcc,-fmerge-all-constants) +OPTIMIZATION+=$(call check_gcc,-fstrict-aliasing) GCC_MAJOR_VER?=$(shell $(CC) -dumpversion | cut -d . -f 1) #GCC_MINOR_VER?=$(shell $(CC) -dumpversion | cut -d . -f 2) @@ -332,28 +333,9 @@ ifeq ($(TARGET_ARCH),sparc) endif ifeq ($(TARGET_ARCH),arm) - OPTIMIZATION+=-fstrict-aliasing CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN)+=-mlittle-endian CPU_CFLAGS-$(ARCH_BIG_ENDIAN)+=-mbig-endian - CPU_CFLAGS-$(CONFIG_GENERIC_ARM)+= - CPU_CFLAGS-$(CONFIG_ARM610)+=-mtune=arm610 -march=armv3 - CPU_CFLAGS-$(CONFIG_ARM710)+=-mtune=arm710 -march=armv3 - CPU_CFLAGS-$(CONFIG_ARM7TDMI)+=-mtune=arm7tdmi -march=armv4t - CPU_CFLAGS-$(CONFIG_ARM720T)+=-mtune=arm7tdmi -march=armv4t - CPU_CFLAGS-$(CONFIG_ARM920T)+=-mtune=arm9tdmi -march=armv4t - CPU_CFLAGS-$(CONFIG_ARM922T)+=-mtune=arm9tdmi -march=armv4t - CPU_CFLAGS-$(CONFIG_ARM926T)+=-mtune=arm9e -march=armv5te - CPU_CFLAGS-$(CONFIG_ARM10T)+=-mtune=arm10tdmi -march=armv5t - CPU_CFLAGS-$(CONFIG_ARM1136JF_S)+=-mtune=arm1136jf-s -march=armv6 - CPU_CFLAGS-$(CONFIG_ARM1176JZ_S)+=-mtune=arm1176jz-s -march=armv6 - CPU_CFLAGS-$(CONFIG_ARM1176JZF_S)+=-mtune=arm1176jzf-s -march=armv6 - CPU_CFLAGS-$(CONFIG_ARM_SA110)+=-mtune=strongarm110 -march=armv4 - CPU_CFLAGS-$(CONFIG_ARM_SA1100)+=-mtune=strongarm1100 -march=armv4 - CPU_CFLAGS-$(CONFIG_ARM_XSCALE)+=$(call check_gcc,-mtune=xscale,-mtune=strongarm110) - CPU_CFLAGS-$(CONFIG_ARM_XSCALE)+=-march=armv5te -Wa,-mcpu=xscale - CPU_CFLAGS-$(CONFIG_ARM_IWMMXT)+=-march=iwmmxt -Wa,-mcpu=iwmmxt -mabi=iwmmxt - CPU_CFLAGS-$(CONFIG_ARM_CORTEX_M3)+=-mcpu=cortex-m3 -mthumb - CPU_CFLAGS-$(CONFIG_ARM_CORTEX_M1)+=-mcpu=cortex-m1 -mthumb + CPU_CFLAGS-$(COMPILE_IN_THUMB_MODE)+=-mthumb endif ifeq ($(TARGET_ARCH),mips) @@ -385,7 +367,6 @@ ifeq ($(TARGET_ARCH),nios) endif ifeq ($(TARGET_ARCH),sh) - OPTIMIZATION+=-fstrict-aliasing OPTIMIZATION+= $(call check_gcc,-mprefergot,) CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN)+=-ml CPU_CFLAGS-$(ARCH_BIG_ENDIAN)+=-mb @@ -401,7 +382,6 @@ endif endif ifeq ($(TARGET_ARCH),sh64) - OPTIMIZATION+=-fstrict-aliasing CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN):=-ml CPU_CFLAGS-$(ARCH_BIG_ENDIAN):=-mb CPU_CFLAGS-$(CONFIG_SH5)+=-m5-32media @@ -546,10 +526,10 @@ endif endif # Add a bunch of extra pedantic annoyingly strict checks -XWARNINGS=$(call qstrip,$(WARNINGS)) +XWARNINGS=$(call qstrip,$(WARNINGS)) XWARNINGS+=$(foreach w,\ -Wstrict-prototypes \ - -fno-strict-aliasing \ + -Wstrict-aliasing \ , $(call check_gcc,$(w),)) ifeq ($(EXTRA_WARNINGS),y) XWARNINGS+=$(foreach w,\ @@ -587,9 +567,6 @@ CFLAGS := -include $(top_srcdir)include/libc-symbols.h \ -nostdinc -I$(top_builddir)include -I$(top_srcdir)include -I. \ -I$(top_srcdir)libc/sysdeps/linux \ -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH) -ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"") -CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS)) -endif # We need this to be checked within libc-symbols.h ifneq ($(HAVE_SHARED),y) @@ -635,6 +612,9 @@ LDFLAGS += -Wl,-s else STRIPTOOL := true -Stripping_disabled endif +ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"") +CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS)) +endif ifeq ($(DOMULTI),y) # we try to compile all sources at once into an object (IMA), but diff --git a/extra/Configs/Config.arm b/extra/Configs/Config.arm index eb27a3391..0bb2971a9 100644 --- a/extra/Configs/Config.arm +++ b/extra/Configs/Config.arm @@ -12,122 +12,27 @@ config FORCE_OPTIONS_FOR_ARCH default y select ARCH_ANY_ENDIAN -choice - prompt "Target ABI" - default CONFIG_ARM_EABI +config CONFIG_ARM_EABI + bool "Build for EABI" help - If you choose "EABI" here, functions and constants required by the - ARM EABI will be built into the library. You should choose "EABI" + If you say 'y' here, functions and constants required by the + ARM EABI will be built into the library. You should say 'y' if your compiler uses the ARM EABI, in which case you will also - need a kernel supporting the EABI system call interface, or "OABI" - for a compiler using the old Linux ABI. - -config CONFIG_ARM_OABI - bool "OABI" + need a kernel supporting the EABI system call interface. -config CONFIG_ARM_EABI - bool "EABI" + If you say 'n' here, then the library will be built for the + old Linux ABI. -endchoice +config COMPILE_IN_THUMB_MODE + bool "Build using Thumb mode" + select USE_BX + help + Say 'y' here to force building uClibc in thumb mode. + Say 'n' to use your compiler's default mode. config USE_BX bool "Use BX in function return" - default y - depends on !CONFIG_GENERIC_ARM && !CONFIG_ARM610 && !CONFIG_ARM710 - help - Use BX instruction for THUMB aware architectures. - -choice - prompt "Target Processor Type" - default CONFIG_GENERIC_ARM help - This is the processor type of your CPU. This information is used for - optimizing purposes. To build a library that will run on all ARMCPU - types (albeit not optimally fast), you can specify "Generic Arm" here. - If you pick anything other than "Generic Arm", there is no guarantee - that uClibc will even run on anything other than the selected - processor type. - - Here are the settings recommended for greatest speed: - - "Generic Arm" select this if your compiler is already setup to - optimize things properly, or if you want to run on pretty much - everything, or you just don't much care. - - For anything else, pick the ARM core type that best matches the - cpu you will be using on your device. - - If you don't know what to do, choose "Generic Arm". - -config CONFIG_GENERIC_ARM - bool "Generic Arm" - -config CONFIG_ARM610 - bool "Arm 610" - select ARCH_HAS_MMU - -config CONFIG_ARM710 - bool "Arm 710" - select ARCH_HAS_MMU - -config CONFIG_ARM7TDMI - bool "Arm 7TDMI" - select ARCH_HAS_NO_MMU - -config CONFIG_ARM720T - bool "Arm 720T" - select ARCH_HAS_MMU - -config CONFIG_ARM920T - bool "Arm 920T" - select ARCH_HAS_MMU - -config CONFIG_ARM922T - bool "Arm 922T" - select ARCH_HAS_MMU - -config CONFIG_ARM926T - bool "Arm 926T" - select ARCH_HAS_MMU - -config CONFIG_ARM10T - bool "Arm 10T" - select ARCH_HAS_MMU - -config CONFIG_ARM1136JF_S - bool "Arm 1136JF-S" - select ARCH_HAS_MMU - -config CONFIG_ARM1176JZ_S - bool "Arm 1176JZ-S" - select ARCH_HAS_MMU - -config CONFIG_ARM1176JZF_S - bool "Arm 1176JZF-S" - select ARCH_HAS_MMU - -config CONFIG_ARM_CORTEX_M3 - bool "Arm Cortex-M3" - select ARCH_HAS_NO_MMU - select USE_BX - -config CONFIG_ARM_CORTEX_M1 - bool "Arm Cortex-M1" - select ARCH_HAS_NO_MMU - select USE_BX - -config CONFIG_ARM_SA110 - bool "Intel StrongArm SA-110" - select ARCH_HAS_MMU - -config CONFIG_ARM_SA1100 - bool "Intel StrongArm SA-1100" - select ARCH_HAS_MMU - -config CONFIG_ARM_XSCALE - bool "Intel Xscale" - select ARCH_HAS_MMU - -config CONFIG_ARM_IWMMXT - bool "Intel Xscale With WMMX PXA27x" - select ARCH_HAS_MMU - -endchoice + Say 'y' to use BX to return from functions on your thumb-aware + processor. Say 'y' if you need to use interworking. Say 'n' if not. + It is safe to say 'y' even if you're not doing interworking. diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 843988959..2fa0b076d 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -942,8 +942,10 @@ config UCLIBC_LINUX_SPECIFIC bool "Linux specific functions" default y help + accept4(), capget(), capset(), fstatfs(), inotify_*(), ioperm(), iopl(), - madvise(), modify_ldt(), personality(), prctl()/arch_prctl(), + madvise(), modify_ldt(), pipe2(), personality(), + prctl()/arch_prctl(), ppoll(), readahead(), reboot(), remap_file_pages(), sched_getaffinity(), sched_setaffinity(), sendfile(), setfsgid(), setfsuid(), setresuid(), diff --git a/include/sys/socket.h b/include/sys/socket.h index 0824fc855..6037f92ae 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -227,6 +227,15 @@ extern int accept (int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len); libc_hidden_proto(accept) +#if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU +/* Similar to 'accept' but takes an additional parameter to specify flags. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int accept4 (int __fd, __SOCKADDR_ARG __addr, + socklen_t *__restrict __addr_len, int __flags); +#endif + /* Shut down all or part of the connection open on socket FD. HOW determines what to shut down: SHUT_RD = No more receptions; diff --git a/include/unistd.h b/include/unistd.h index c421cb308..956879003 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -389,6 +389,13 @@ extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n, extern int pipe (int __pipedes[2]) __THROW __wur; libc_hidden_proto(pipe) +#if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU +/* Same as pipe but apply flags passed in FLAGS to the new file + descriptors. */ +extern int pipe2 (int __pipedes[2], int __flags) __THROW __wur; +libc_hidden_proto(pipe2) +#endif + /* Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM. If SECONDS is zero, any currently scheduled alarm will be cancelled. The function returns the number of seconds remaining until the last diff --git a/ldso/include/dl-defs.h b/ldso/include/dl-defs.h index d387c0bb9..11edc4dfc 100644 --- a/ldso/include/dl-defs.h +++ b/ldso/include/dl-defs.h @@ -179,6 +179,14 @@ typedef struct { #define DL_LOOKUP_ADDRESS(ADDRESS) (ADDRESS) #endif +/* On some architectures dladdr can't use st_size of all symbols this way. */ +#define DL_ADDR_SYM_MATCH(SYM_ADDR, SYM, MATCHSYM, ADDR) \ + ((ADDR) >= (SYM_ADDR) \ + && ((((SYM)->st_shndx == SHN_UNDEF || (SYM)->st_size == 0) \ + && (ADDR) == (SYM_ADDR)) \ + || (ADDR) < (SYM_ADDR) + (SYM)->st_size) \ + && (!(MATCHSYM) || MATCHSYM < (SYM_ADDR))) + /* Use this macro to convert a pointer to a function's entry point to * a pointer to function. The pointer is assumed to have already been * relocated. LOADADDR is passed because it may contain additional diff --git a/ldso/ldso/arm/dl-startup.h b/ldso/ldso/arm/dl-startup.h index a95389d98..2dfdaffda 100644 --- a/ldso/ldso/arm/dl-startup.h +++ b/ldso/ldso/arm/dl-startup.h @@ -7,6 +7,7 @@ */ #include <features.h> +#include <bits/arm_asm.h> #if !defined(__thumb__) __asm__( diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c index 9e1415b83..5cf50d4ed 100644 --- a/ldso/ldso/dl-elf.c +++ b/ldso/ldso/dl-elf.c @@ -718,6 +718,9 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure, DL_UPDATE_LOADADDR_HDR(lib_loadaddr, new_addr + (ppnt->p_vaddr & ADDR_ALIGN), ppnt); + /* This has invalidated all pointers into the previously readonly segment. + Update any them to point into the remapped segment. */ + _dl_parse_dynamic_info(dpnt, dynamic_info, NULL, lib_loadaddr); #endif } } |