[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#725508: hppa patches for eglibc



Here is an updated hppa patch set for 2.18.

Dave

-------- Original Message --------
Subject: 	Re: Bug#725508: hppa patches for eglibc
Date: 	Fri, 21 Feb 2014 19:26:27 -0500
From: 	John David Anglin <dave.anglin@bell.net>
To: 	John David Anglin <dave.anglin@bell.net>
CC: Adam Conrad <adconrad@0c3.net>, Helge Deller <deller@gmx.de>, Carlos O'Donell <carlos@redhat.com>



On 17-Feb-14, at 7:15 PM, John David Anglin wrote:

On 17-Feb-14, at 5:51 PM, John David Anglin wrote:

On 17-Feb-14, at 4:38 PM, Adam Conrad wrote:

On Mon, Feb 17, 2014 at 04:17:51PM -0500, John David Anglin wrote:
No, I won't be able to complete a full build and check today.
If everything goes smoothly, the earliest would be tomorrow
morning.

It would be great if you could queue for a future upload.

Yeahp, works for me.  Get me clean patches against current
experimental
and I'll get them committed to SVN for you.  Also, would be
awesome if
you guys pushed more of this upstream (I'm looking at you, Carlos).


I reviewed the changes from 2.17 and removed the conflicting bits.
Attached
is what's left.  The ChangeLog entries are gone because they gave
problems.

Testing is in progress.


Build failed:

hppa-linux-gnu-gcc-4.8 gethstbyad.c -c -std=gnu99 -fgnu89-inline  -
O2 -Wall -Win
line -Wwrite-strings -fmerge-all-constants -frounding-math -g -pipe -
Wstrict-pro
totypes   -fPIC -fexceptions    -isystem /home/dave/debian/eglibc/
eglibc-2.18/debian/include  -I../include -I/home/dave/debian/eglibc/
eglibc-2.18/build-tree/hpp
a-libc/inet  -I/home/dave/debian/eglibc/eglibc-2.18/build-tree/hppa-
libc  -I../p
orts/sysdeps/unix/sysv/linux/hppa/nptl  -I../ports/sysdeps/unix/sysv/
linux/hppa
-I../ports/sysdeps/unix/sysv/linux  -I../nptl/sysdeps/unix/sysv/
linux  -I../nptl/sysdeps/pthread  -I../sysdeps/pthread  -I../sysdeps/
unix/sysv/linux  -I../sysd
eps/gnu  -I../sysdeps/unix/inet  -I../ports/sysdeps/unix/sysv  -I../
nptl/sysdeps
/unix/sysv  -I../sysdeps/unix/sysv  -I../ports/sysdeps/unix  -I../
nptl/sysdeps/u
nix  -I../sysdeps/unix  -I../sysdeps/posix  -I../ports/sysdeps/hppa/
hppa1.1  -I.
./sysdeps/wordsize-32  -I../sysdeps/ieee754/flt-32  -I../sysdeps/
ieee754/dbl-64
-I../ports/sysdeps/hppa/fpu  -I../ports/sysdeps/hppa/nptl  -I../
ports/sysdeps/h
ppa  -I../sysdeps/ieee754  -I../sysdeps/generic  -I../ports  -I../
nptl  -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/hppa-linux-
gnu/4.8/include -isystem
/usr/lib/gcc/hppa-linux-gnu/4.8/include-fixed -isystem /home/dave/
debian/eglibc/
eglibc-2.18/debian/include  -D_LIBC_REENTRANT -include ../include/
libc-symbols.h
 -DPIC -DSHARED     -o /home/dave/debian/eglibc/eglibc-2.18/build-
tree/hppa-lib
c/inet/gethstbyad.os -MD -MP -MF /home/dave/debian/eglibc/
eglibc-2.18/build-tree
/hppa-libc/inet/gethstbyad.os.dt -MT /home/dave/debian/eglibc/
eglibc-2.18/build-tree/hppa-libc/inet/gethstbyad.os
In file included from ../include/atomic.h:50:0,
                from ../ports/sysdeps/unix/sysv/linux/hppa/nptl/
lowlevellock.h:
24,
                from ../nptl/descr.h:30,
                from ../ports/sysdeps/hppa/nptl/tls.h:56,
                from ../include/netdb.h:10,
                from gethstbyad.c:19:
../nss/getXXbyYY.c: In function ‘gethostbyaddr’:
../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:68:6: error:
can’t find a register in class ‘R1_REGS’ while reloading ‘asm’
     asm volatile(       \
     ^
../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:217:13:
note: in expansion of macro ‘atomic_compare_and_exchange_val_acq’
  int val = atomic_compare_and_exchange_val_acq (futex, 1, 0);
            ^
../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:68:6: error:
can’t find a register in class ‘R1_REGS’ while reloading ‘asm’
     asm volatile(       \
     ^
../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:97:12: note: in
expansion of macro ‘atomic_compare_and_exchange_val_acq’
     ret = atomic_compare_and_exchange_val_acq(mem, newval, oldval); \
           ^
../include/atomic.h:189:7: note: in expansion of macro
‘atomic_compare_and_exchange_bool_acq’
     (atomic_compare_and_exchange_bool_acq (__atg5_memp,
__atg5_value, \
      ^
../include/atomic.h:196:45: note: in expansion of macro
‘atomic_exchange_acq’
# define atomic_exchange_rel(mem, newvalue) atomic_exchange_acq
(mem, newvalue)
                                            ^
../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:292:16:
note: in expansion of macro ‘atomic_exchange_rel’
     int val = atomic_exchange_rel (__futex, 0); \
               ^
../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:296:36:
note: in expansion of macro ‘__lll_unlock’
#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
                                   ^
../nptl/sysdeps/pthread/bits/libc-lockP.h:237:3: note: in expansion
of macro ‘lll_unlock’
  lll_unlock (NAME, LLL_PRIVATE)
  ^
../nss/getXXbyYY.c:144:3: note: in expansion of macro
‘__libc_lock_unlock’
  __libc_lock_unlock (lock);
  ^
../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:68:6: error:
‘asm’ operand has impossible constraints
     asm volatile(       \
     ^
../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:217:13:
note: in expansion of macro ‘atomic_compare_and_exchange_val_acq’
  int val = atomic_compare_and_exchange_val_acq (futex, 1, 0);
            ^
../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:68:6: error:
‘asm’ operand has impossible constraints
     asm volatile(       \
     ^
../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:97:12: note: in
expansion of macro ‘atomic_compare_and_exchange_val_acq’
     ret = atomic_compare_and_exchange_val_acq(mem, newval, oldval); \
           ^
../include/atomic.h:189:7: note: in expansion of macro
‘atomic_compare_and_exchange_bool_acq’
     (atomic_compare_and_exchange_bool_acq (__atg5_memp,
__atg5_value, \
      ^
../include/atomic.h:196:45: note: in expansion of macro
‘atomic_exchange_acq’
# define atomic_exchange_rel(mem, newvalue) atomic_exchange_acq
(mem, newvalue)
                                            ^
../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:292:16:
note: in expansion of macro ‘atomic_exchange_rel’
     int val = atomic_exchange_rel (__futex, 0); \
               ^
../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:296:36:
note: in expansion of macro ‘__lll_unlock’
#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
                                   ^
../nptl/sysdeps/pthread/bits/libc-lockP.h:237:3: note: in expansion
of macro ‘lll_unlock’
  lll_unlock (NAME, LLL_PRIVATE)
  ^
../nss/getXXbyYY.c:144:3: note: in expansion of macro
‘__libc_lock_unlock’
  __libc_lock_unlock (lock);
  ^
make[3]: *** [/home/dave/debian/eglibc/eglibc-2.18/build-tree/hppa-
libc/inet/gethstbyad.os] Error 1
make[3]: Leaving directory `/home/dave/debian/eglibc/eglibc-2.18/inet'

This is probably a GCC bug but the previous lock was preprocessed to
an expression that doesn't cause a problem:

 ({ __lll_mutex_lock (&(lock), 0); 0; });

The " __libc_lock_unlock (lock)" expands to:

 (void) ({ int *__futex = (&(lock)); int val = ({ __typeof
(*(__futex)) __atg5_oldval; __typeof (__futex) __atg5_memp =
(__futex); __typeof (*(__futex)) __atg5_value = (0); do
__atg5_oldval = *(volatile __typeof (__futex))__atg5_memp; while
(__builtin_expect (({ int ret; ret = ({ volatile int lws_errno;
volatile int lws_ret; asm
volatile( "0:                                       \n\t" "copy
%2, %%r26                       \n\t" "copy     %3, %
%r25                       \n\t" "copy     %4, %
%r24                       \n\t" "ble      " "0xb0" "(%%sr2, %
%r0)         \n\t" "ldi      " "0" ", %%r20          \n\t" "ldi
" "-11" ", %%r24                \n\t" "cmpb,=,n %%r24, %%r21,
0b                \n\t" "nop                                      \n
\t" "ldi      " "-45" ", %%r25        \n\t" "cmpb,=,n %%r25, %%r21,
0b                \n\t" "nop                                      \n
\t" "stw      %%r28, %0                       \n\t" "stw      %%r21,
%1                       \n\t" : "=m" (lws_ret), "=m" (lws_errno) :
"r" (__atg5_memp), "r" (__atg5_oldval), "r" (__atg5_value) : "r1",
"r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31",
"memory" ); if(lws_errno == -14 || lws_errno == -251) asm ("iitlbp
%r0,(%sr0, %r0)"); lws_ret; }); (ret != (int)__atg5_oldval); }),
0)); __atg5_oldval; }); if (__builtin_expect (val > 1, 0)) ({ ; long
int __ret; __ret = ({ long __sys_res; { register unsigned long __res
asm("r28"); register unsigned long __r19 asm("r19"); register
unsigned long __r23 __asm__("r23") = (unsigned long)(0); register
unsigned long __r24 __asm__("r24") = (unsigned long)((1)); register
unsigned long __r25 __asm__("r25") = (unsigned long)(((1) | 128));
register unsigned long __r26 __asm__("r26") = (unsigned long)
((__futex)); asm volatile( "       copy %%r19, %" "%r4" "\n" "
ble  0x100(%%sr2, %%r0)\n" "    ldi %1, %%r20\n" "       copy %"
"%r4" ", %%r19\n" : "=r" (__res) : "i" (((0 + 210))) , "r" (__r19) ,
"r" (__r26), "r" (__r25), "r" (__r24), "r" (__r23) : "memory",
"%r1", "%r2", "%r4" , "%r20", "%r29", "%r31" , "%r21", "%r22" );
__sys_res = (long)__res; } __sys_res; }); __ret; }); });

Carlos, do you have a patch?  It might be putting an asm in
__builtin_expect is the problem.  However, I think the issue
might be resolved if the asm was in __lll_lock_unlock() or something
similar.


Attached is an updated set of patches for 2.18.  The local-atomic.diff
patch resolves the above issue by
burying the problematic asm in a noinline function.  This isn't
optimal but it provides a working 2.18 build
with the latest version of gcc.  The other patches are unchanged from
what I sent before.

I've been running 2.18-0experimental1 now for a couple of days and
haven't observed any problems.

The expected results need to be updated but test results aren't fully
consistent from build to build.
So, could we just remove the expected results for now?

Thanks,
Dave
--
John David Anglin	dave.anglin@bell.net





0) hppa/local-longjmp-chk.diff -- delete
1) hppa/local-elf-make-cflags.diff
2) hppa/local-setjmp-namespace.diff
3) hppa/local-fanotify_mark-5i.diff
4) hppa/local-fcntl-osync.diff
5) hppa/local-atomic.diff

Attachment: local-elf-make-cflags.diff
Description: Binary data

Attachment: local-setjmp-namespace.diff
Description: Binary data

Attachment: local-fanotify_mark-5i.diff
Description: Binary data

Attachment: local-fcntl-osync.diff
Description: Binary data

Attachment: local-atomic.diff
Description: Binary data


Reply to: