Bug#335821: glibc: ftbfs [sparc] tls-macros.h:735:3: error: #error No support for this architecture so far.

2005-11-12 Thread Aurelien Jarno
Hi,

Please find attached a dpatch file to fix this bug. The code is taken
from upstream CVS. I still don't see why previous version of the glibc
were built successfully, the tls support was probably broken for them.

I am currently building a test version, but it takes very long as I am
building a lot of things at the same time on the machine. However, the
sparc-sparc64 flavour has already been built, so I suppose the build 
will success. I will send you another mail to confirm that.

Bye,
Aurelien

-- 
  .''`.  Aurelien Jarno | GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineer
 `. `'   [EMAIL PROTECTED] | [EMAIL PROTECTED]
   `-people.debian.org/~aurel32 | www.aurel32.net
#! /bin/sh -e

# DP: TLS code for sparc64, taken from CVS

if [ $# -ne 2 ]; then
echo 2 `basename $0`: script expects -patch|-unpatch as argument
exit 1
fi
case $1 in
-patch) patch -d $2 -f --no-backup-if-mismatch -p1  $0;;
-unpatch) patch -d $2 -f --no-backup-if-mismatch -R -p1  $0;;
*)
echo 2 `basename $0`: script expects -patch|-unpatch as argument
exit 1
esac
exit 0

--- glibc-2.3.5.orig/elf/tls-macros.h   2005-11-12 03:47:57.0 +0100
+++ glibc-2.3.5/elf/tls-macros.h2005-11-12 03:56:01.0 +0100
@@ -440,6 +440,74 @@
o5, o7, cc);\
  __o0; })
 
+#elif defined __sparc__  defined __arch64__
+
+# define TLS_LE(x) \
+  ({ int *__l;   \
+ asm (sethi %%tle_hix22( #x ), %0 : =r (__l)); \
+ asm (xor %1, %%tle_lox10( #x ), %0 : =r (__l) : r (__l));   \
+ asm (add %%g7, %1, %0 : =r (__l) : r (__l));
  \
+ __l; })
+
+# ifdef __PIC__
+#  define TLS_LOAD_PIC \
+  ({ long pc, got;   \
+ asm (sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t
  \
+ rd %%pc, %0\n\t   \
+ add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t \
+ add %1, %0, %1\n\t\
+ : =r (pc), =r (got));   \
+ got; })
+# else
+#  define TLS_LOAD_PIC \
+   ({ long got;
  \
+  asm (.hidden _GLOBAL_OFFSET_TABLE_\n\t   \
+  sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t\
+  or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0   \
+  : =r (got)); \
+  got; })
+# endif
+
+# define TLS_IE(x) \
+  ({ int *__l;   \
+ asm (sethi %%tie_hi22( #x ), %0 : =r (__l));
  \
+ asm (add %1, %%tie_lo10( #x ), %0 : =r (__l) : r (__l));\
+ asm (ldx [%1 + %2], %0, %%tie_ldx( #x ) \
+ : =r (__l) : r (TLS_LOAD_PIC), r (__l));  \
+ asm (add %%g7, %1, %0, %%tie_add( #x ) : =r (__l) : r (__l));\
+ __l; })
+
+# define TLS_LD(x) \
+  ({ int *__l; register void *__o0 asm (%o0);
  \
+ long __o;   \
+ asm (sethi %%tldm_hi22( #x ), %0 : =r (__l)); \
+ asm (add %1, %%tldm_lo10( #x ), %0 : =r (__l) : r (__l));   \
+ asm (add %1, %2, %0, %%tldm_add( #x )   \
+ : =r (__o0) : r (TLS_LOAD_PIC), r (__l)); \
+ asm (call __tls_get_addr, %%tgd_call( #x )\n\t
  \
+  nop  \
+ : =r (__o0) : 0 (__o0)  \
+ : g1, g2, g3, g4, g5, g6, o1, o2, o3, o4,   \
+   o5, o7, cc);\
+ asm (sethi %%tldo_hix22( #x ), %0 : =r (__o));\
+ asm (xor %1, %%tldo_lox10( #x ), %0 : =r (__o) : r (__o));
  \
+ asm (add %1, %2, %0, %%tldo_add( #x ) : =r (__l)  \
+ : r (__o0), r (__o));   \
+ __l; })
+
+# define TLS_GD(x) \
+  ({ int *__l; register void *__o0 asm (%o0);
  \
+ asm (sethi %%tgd_hi22( #x ), %0 : =r (__l));
  \
+ asm (add %1, %%tgd_lo10( #x ), %0 : =r (__l) : r (__l));\
+ asm (add %1, %2, %0, %%tgd_add( #x )\
+ : =r (__o0) : r (TLS_LOAD_PIC), r (__l)); \
+ asm (call __tls_get_addr, %%tgd_call( #x )\n\t
  \
+  nop 

Bug#335821: glibc: ftbfs [sparc] tls-macros.h:735:3: error: #error No support for this architecture so far.

2005-11-12 Thread Daniel Jacobowitz
On Sat, Nov 12, 2005 at 06:26:13PM +0100, Aurelien Jarno wrote:
 Hi,
 
 Please find attached a dpatch file to fix this bug. The code is taken
 from upstream CVS. I still don't see why previous version of the glibc
 were built successfully, the tls support was probably broken for them.

I worked out before why this used to work, but I foolishly didn't write
it down.  It was complicated and took me a couple hours to work out :-)
Ah, yes:

  * Merge makefile patch from Goswin Brederlow
[EMAIL PROTECTED] to fail earlier if builds fail
(but omit the bit for make -k check) (Closes: #325460).

I believe we just failed to detect the error.  Which didn't matter
since this header is included only in testcases.

I'm committing your patch to SVN.


-- 
Daniel Jacobowitz
CodeSourcery, LLC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#335821: glibc: ftbfs [sparc] tls-macros.h:735:3: error: #error No support for this architecture so far.

2005-10-25 Thread Blars Blarson
Package: glibc
Version: 2.3.5-7
Severity: serious
Justification: no longer builds from source


glibc failed to build on a sparc buildd, duplicated on my sparc pbuilder.


gcc-4.0 -m64 tst-tlsmod2.c -c -std=gnu99 -O2 -O3 -Wall -Winline 
-Wstrict-prototypes -Wwrite-strings -fstrict-aliasing -g -g1 -pipe 
-fcall-used-g6  -fPIC-I../include -I. 
-I/build/buildd/glibc-2.3.5/build-tree/sparc-sparc64/elf -I.. -I../libio  
-I/build/buildd/glibc-2.3.5/build-tree/sparc-sparc64 
-I../sysdeps/sparc/sparc64/elf 
-I../linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64 
-I../linuxthreads/sysdeps/unix/sysv/linux/sparc 
-I../linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread 
-I../sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv 
-I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/sparc/sparc64 
-I../linuxthreads/sysdeps/sparc -I../sysdeps/unix/sysv/linux/sparc/sparc64 
-I../sysdeps/unix/sysv/linux/wordsize-64 -I../sysdeps/unix/sysv/linux/sparc 
-I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common 
-I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv 
-I../sysdeps/unix/sparc -I../sysdeps/unix -I../sysdeps/posix 
-I../sysdeps/sparc/sparc64/fpu -I../sysdeps/sparc/sparc64 
-I../sysdeps/wordsize-64 -I../sysdeps/ieee754/ldbl-128 
-I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 
-I../sysdeps/sparc/sparc64/soft-fp -I../sysdeps/sparc/fpu -I../sysdeps/sparc 
-I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -nostdinc 
-isystem /usr/lib/gcc/sparc-linux-gnu/4.0.2/include -isystem 
/build/buildd/glibc-2.3.5/debian/include -D_LIBC_REENTRANT -include 
../include/libc-symbols.h  -DPIC -DSHARED  -DNOT_IN_libc=1 -DNOT_IN_libc   -o 
/build/buildd/glibc-2.3.5/build-tree/sparc-sparc64/elf/tst-tlsmod2.os -MD -MP 
-MF /build/buildd/glibc-2.3.5/build-tree/sparc-sparc64/elf/tst-tlsmod2.os.dt 
-MT /build/buildd/glibc-2.3.5/build-tree/sparc-sparc64/elf/tst-tlsmod2.os
In file included from tst-tlsmod1.c:6:
tls-macros.h:735:3: error: #error No support for this architecture so far.
tst-tlsmod1.c: In function 'in_dso':
tst-tlsmod1.c:27: warning: implicit declaration of function 'TLS_IE'
tst-tlsmod1.c:27: error: 'foo' undeclared (first use in this function)
tst-tlsmod1.c:27: error: (Each undeclared identifier is reported only once
tst-tlsmod1.c:27: error: for each function it appears in.)
tst-tlsmod1.c:27: warning: assignment makes pointer from integer without a cast
tst-tlsmod1.c:28: error: 'bar' undeclared (first use in this function)
tst-tlsmod1.c:28: warning: assignment makes pointer from integer without a cast
tst-tlsmod1.c:45: warning: implicit declaration of function 'TLS_GD'
tst-tlsmod1.c:45: warning: assignment makes pointer from integer without a cast
tst-tlsmod1.c:46: warning: assignment makes pointer from integer without a cast
tst-tlsmod1.c:47: error: 'baz' undeclared (first use in this function)
tst-tlsmod1.c:47: warning: assignment makes pointer from integer without a cast
make[3]: *** 
[/build/buildd/glibc-2.3.5/build-tree/sparc-sparc64/elf/tst-tlsmod1.os] Error 1
make[3]: *** Waiting for unfinished jobs
In file included from tst-tlsmod2.c:6:
tls-macros.h:735:3: error: #error No support for this architecture so far.
tst-tlsmod2.c: In function 'in_dso':
tst-tlsmod2.c:21: warning: implicit declaration of function 'TLS_GD'
tst-tlsmod2.c:21: error: 'foo' undeclared (first use in this function)
tst-tlsmod2.c:21: error: (Each undeclared identifier is reported only once
tst-tlsmod2.c:21: error: for each function it appears in.)
tst-tlsmod2.c:21: warning: assignment makes pointer from integer without a cast
make[3]: *** 
[/build/buildd/glibc-2.3.5/build-tree/sparc-sparc64/elf/tst-tlsmod2.os] Error 1



Bug#335821: glibc: ftbfs [sparc] tls-macros.h:735:3: error: #error No support for this architecture so far.

2005-10-25 Thread Daniel Jacobowitz
On Tue, Oct 25, 2005 at 07:09:00PM -0700, Blars Blarson wrote:
 Package: glibc
 Version: 2.3.5-7
 Severity: serious
 Justification: no longer builds from source
 
 
 glibc failed to build on a sparc buildd, duplicated on my sparc pbuilder.

Yes... I have not quite figured out why this did not happen in the
past, but it's pretty obvious why it happens now.  We need to add
sparc64 support to tls-macros.h and then it seems likely that will be
enough to fix it.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]