patches/glibc/ports-2.12.1/460-alpha-fix-gcc-4.1-warnings.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Fri Jan 27 13:31:16 2012 +0100 (2012-01-27)
changeset 2854 a70abdbfa342
permissions -rw-r--r--
complibs/cloog: fix linking with libm

In Ubuntu 11.04 and 11.10, the default options for ld have changed.
--no-copy-dt-needed-entries and --as-needed are now enabled by default, which
causes errors like:

[EXTRA] Checking CLooG/ppl
[DEBUG] ==> Executing: 'make' '-j3' '-s' 'check'
[ALL ] Making check in .
[ALL ] config.status: creating include/cloog/cloog-config.h
[ALL ] config.status: include/cloog/cloog-config.h is unchanged
[ALL ] libtool: link: i686-build_pc-linux-gnu-gcc -Wall -fomit-frame-pointer
-pipe -o cloog cloog.o -L/<snip>/build/static/lib ./.libs/libcloog.a -lm
/<snip>/build/static/lib/libppl_c.a /<snip>/build/static/lib/libpwl.a
/<snip>/build/static/lib/libppl.a /<snip>/build/static/lib/libgmpxx.a
/<snip>/build/static/lib/libgmp.a -lstdc++
[ALL ] /usr/bin/ld: /<snip>/build/static/lib/libppl.a(MIP_Problem.o):
undefined reference to symbol 'sqrt@@GLIBC_2.0'
[ALL ] /usr/bin/ld: note: 'sqrt@@GLIBC_2.0' is defined in DSO
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libm.so so try adding
it to the linker command line
[ALL ] /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libm.so:
could not read symbols: Invalid operation
[ALL ] collect2: ld returned 1 exit status
[ERROR] make[2]: *** [cloog] Error 1
[ERROR] make[1]: *** [check-recursive] Error 1

See:
https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition

This patch fixes these errors by placing '-lm' at the right place on the command
line as libppl requires libm when linking cloog.

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
yann@2437
     1
2006-05-30  Falk Hueffner <falk@debian.org>
yann@2437
     2
yann@2437
     3
	* sysdeps/unix/sysv/linux/alpha/ioperm.c: force the architecture
yann@2437
     4
	  to ev6 in assembly code.
yann@2437
     5
yann@2437
     6
{standard input}: Assembler messages:
yann@2437
     7
{standard input}:341: Error: macro requires $at register while noat in effect
yann@2437
     8
{standard input}:374: Error: macro requires $at register while noat in effect
yann@2437
     9
{standard input}:438: Error: macro requires $at register while noat in effect
yann@2437
    10
{standard input}:471: Error: macro requires $at register while noat in effect
yann@2437
    11
make[3]: *** [/tmp/buildd/glibc-2.3.6/build-tree/alpha-libc/misc/ioperm.o] Error 1
yann@2437
    12
yann@2437
    13
Hrm. gcc puts .arch ev4 into the .s, and this overrides -mev6 for as.
yann@2437
    14
I cannot really think of anything better than
yann@2437
    15
yann@2437
    16
 ports/sysdeps/unix/sysv/linux/alpha/ioperm.c |    8 ++++----
yann@2437
    17
 1 file changed, 4 insertions(+), 4 deletions(-)
yann@2437
    18
yann@2437
    19
diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c
yann@2437
    20
--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c	2009-05-16 10:36:20.000000000 +0200
yann@2437
    21
+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c	2009-11-13 00:50:57.000000000 +0100
yann@2437
    22
@@ -178,13 +178,13 @@
yann@2437
    23
 static inline void
yann@2437
    24
 stb_mb(unsigned char val, unsigned long addr)
yann@2437
    25
 {
yann@2437
    26
-  __asm__("stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
yann@2437
    27
+  __asm__(".arch ev6; stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
yann@2437
    28
 }
yann@2437
    29
 
yann@2437
    30
 static inline void
yann@2437
    31
 stw_mb(unsigned short val, unsigned long addr)
yann@2437
    32
 {
yann@2437
    33
-  __asm__("stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
yann@2437
    34
+  __asm__(".arch ev6; stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
yann@2437
    35
 }
yann@2437
    36
 
yann@2437
    37
 static inline void
yann@2437
    38
@@ -356,7 +356,7 @@
yann@2437
    39
   unsigned long int addr = dense_port_to_cpu_addr (port);
yann@2437
    40
   unsigned char r;
yann@2437
    41
 
yann@2437
    42
-  __asm__ ("ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
yann@2437
    43
+  __asm__ (".arch ev6; ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
yann@2437
    44
   return r;
yann@2437
    45
 }
yann@2437
    46
 
yann@2437
    47
@@ -366,7 +366,7 @@
yann@2437
    48
   unsigned long int addr = dense_port_to_cpu_addr (port);
yann@2437
    49
   unsigned short r;
yann@2437
    50
 
yann@2437
    51
-  __asm__ ("ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
yann@2437
    52
+  __asm__ (".arch ev6; ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
yann@2437
    53
   return r;
yann@2437
    54
 }
yann@2437
    55
 
yann@2437
    56
diff -durN glibc-2.12.1.orig/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.12.1/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c