From 48efec5d8291e68b7e6022ed8a41ae8894ab9b9f Mon Sep 17 00:00:00 2001 From: Mark Seaborn Date: Fri, 2 Jan 2009 19:16:52 +0000 Subject: [PATCH] Allow building without --disable-shared * Apply fix from http://sourceware.org/ml/libc-alpha/2008-11/msg00030.html * Use hlt instead of abort() in ld.so -- abort() drags in stdio * make-syscalls.sh: use hidden symbols properly - libc-symbols.h behaves differently in C compared to in assembler * Override unwind-find-fde; it was being detected wrongly (needs further investigation) --- misc/Versions | 3 +++ myconfig.sh | 9 +++++---- sysdeps/i386/dl-tlsdesc.S | 3 +-- sysdeps/i386/dl-trampoline.S | 4 ++-- sysdeps/nacl/write.c | 1 + sysdeps/unix/make-syscalls.sh | 10 +++++++--- sysdeps/unix/sysv/linux/configure | 1 + 7 files changed, 20 insertions(+), 11 deletions(-) mode change 100644 => 100755 sysdeps/unix/sysv/linux/configure diff --git a/misc/Versions b/misc/Versions index b182f12311..8d888ff78e 100644 --- a/misc/Versions +++ b/misc/Versions @@ -137,4 +137,7 @@ libc { GLIBC_2.7 { mkostemp; mkostemp64; } + GLIBC_PRIVATE { + __unimplemented_syscall; + } } diff --git a/myconfig.sh b/myconfig.sh index a7e3b2aa7d..6566f8d07a 100755 --- a/myconfig.sh +++ b/myconfig.sh @@ -2,10 +2,11 @@ set -e -mkdir -p build -cd build +BUILDDIR=build +mkdir -p $BUILDDIR +cd $BUILDDIR ../configure --prefix=/usr --host=i486-linux-gnu \ CC="`pwd`/../../tools_bin/linux/sdk/nacl-sdk/bin/nacl-gcc" \ CFLAGS="-march=i486 -pipe -fstrict-aliasing -O2 -g -mno-tls-direct-seg-refs" \ - --with-headers=`pwd`/../kernel-headers \ - --disable-shared + --with-headers=`pwd`/../kernel-headers --enable-kernel=2.2.0 +# --disable-shared diff --git a/sysdeps/i386/dl-tlsdesc.S b/sysdeps/i386/dl-tlsdesc.S index 11b36a4a2d..57cd86f9a2 100644 --- a/sysdeps/i386/dl-tlsdesc.S +++ b/sysdeps/i386/dl-tlsdesc.S @@ -128,8 +128,7 @@ _dl_tlsdesc_dynamic: .Lslow: cfi_adjust_cfa_offset (28) movl %ebx, 16(%esp) - call __i686.get_pc_thunk.bx - addl $_GLOBAL_OFFSET_TABLE_, %ebx + LOAD_PIC_REG(bx) call ___tls_get_addr@PLT movl 16(%esp), %ebx jmp .Lret diff --git a/sysdeps/i386/dl-trampoline.S b/sysdeps/i386/dl-trampoline.S index 8d10c95ee6..808e224b5a 100644 --- a/sysdeps/i386/dl-trampoline.S +++ b/sysdeps/i386/dl-trampoline.S @@ -41,7 +41,7 @@ _dl_runtime_resolve: movl %eax, (%esp) # Store the function address. movl 4(%esp), %eax # Fix this when we are in a position to test it. - call abort + hlt # ret $12 # Jump to function address. cfi_endproc .size _dl_runtime_resolve, .-_dl_runtime_resolve @@ -89,7 +89,7 @@ _dl_runtime_profile: movl %eax, (%esp) # Store the function address. movl 4(%esp), %eax # Fix this when we are in a position to test it. - call abort + hlt # ret $20 # Jump to function address. /* diff --git a/sysdeps/nacl/write.c b/sysdeps/nacl/write.c index 3e7c894222..11a65357af 100644 --- a/sysdeps/nacl/write.c +++ b/sysdeps/nacl/write.c @@ -14,6 +14,7 @@ int __write(int desc, void const *buf, size_t count) errno = -result; return result; } +libc_hidden_def (__write) weak_alias (__write, write) strong_alias (__write, __libc_write) strong_alias (__write, __write_nocancel) diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh index d953d012a1..883cce64eb 100644 --- a/sysdeps/unix/make-syscalls.sh +++ b/sysdeps/unix/make-syscalls.sh @@ -161,7 +161,9 @@ shared-only-routines += $file x*) echo "\ \$(make-target-directory) - (echo 'int $strong() { return __unimplemented_syscall(\"$syscall\"); }'; \\ + (echo 'int $strong();'; \\ + echo 'libc_hidden_proto ($strong)'; \\ + echo 'int $strong() { return __unimplemented_syscall(\"$syscall\"); }'; \\ echo 'strong_alias ($strong, __${syscall}_nocancel)'; \\ echo 'libc_hidden_def ($strong)'; \\" ;; @@ -186,7 +188,7 @@ shared-only-routines += $file vcount=`expr $vcount + 1` echo " echo 'strong_alias ($strong, $source)'; \\" fi - echo " echo 'default_symbol_version($source, $base, $ver)'; \\" + echo " echo 'default_symbol_version($source, $base, $ver);'; \\" ;; *@*) base=`echo $name | sed 's/@.*//'` @@ -199,7 +201,7 @@ shared-only-routines += $file vcount=`expr $vcount + 1` echo " echo 'strong_alias ($strong, $source)'; \\" fi - echo " echo 'symbol_version($source, $base, $ver)'; \\" + echo " echo 'symbol_version($source, $base, $ver);'; \\" ;; !*) name=`echo $name | sed 's/.//'` @@ -207,6 +209,8 @@ shared-only-routines += $file echo " echo 'libc_hidden_def ($name)'; \\" ;; *) + echo " echo 'int $name();'; \\" + echo " echo 'libc_hidden_proto ($name)'; \\" echo " echo 'weak_alias ($strong, $name)'; \\" echo " echo 'libc_hidden_weak ($name)'; \\" ;; diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure old mode 100644 new mode 100755 index 253e9c57ff..1e66d3aaa1 --- a/sysdeps/unix/sysv/linux/configure +++ b/sysdeps/unix/sysv/linux/configure @@ -361,6 +361,7 @@ fi if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then libc_cv_gcc_unwind_find_fde=no fi +libc_cv_gcc_unwind_find_fde=no if test -n "$sysheaders"; then CPPFLAGS=$OLD_CPPFLAGS -- 2.11.4.GIT