[Bug target/100912] powerpc64le: ieee128 long double incorrectly printed when using shared libstdc++

2021-06-07 Thread msc at linux dot ibm.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100912

--- Comment #4 from Matheus Castanho  ---
Just for completeness, setting the rpath showed the same results:

~/build/gcc> /home/mscastanho/usr/bin/g++ -g -Wl,-rpath,$HOME/usr/lib64
~/test-ieee128.cpp -o test-shared
~/build/gcc> ./test-shared
6.95329e-310

The output with LD_DEBUG=libs is very much the same as in my previous comment.

[Bug target/100912] powerpc64le: ieee128 long double incorrectly printed when using shared libstdc++

2021-06-07 Thread msc at linux dot ibm.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100912

--- Comment #3 from Matheus Castanho  ---
Using objdump -dr ~/usr/lib64/libstdc++.so.6:

[...]
000c9340 <_ZSt16__convert_from_vRKP15__locale_structPciPKcz>:
   c9340:   25 00 4c 3c addis   r2,r12,37
   c9344:   c0 c5 42 38 addir2,r2,-14912
   c9348:   a6 02 08 7c mflrr0
   c934c:   e8 ff a1 fb std r29,-24(r1)
   c9350:   f0 ff c1 fb std r30,-16(r1)
   c9354:   78 33 dd 7c mr  r29,r6
   c9358:   f8 ff e1 fb std r31,-8(r1)
   c935c:   78 2b be 7c mr  r30,r5
   c9360:   78 23 9f 7c mr  r31,r4
   c9364:   10 00 01 f8 std r0,16(r1)
   c9368:   c1 ff 21 f8 stdur1,-64(r1)
   c936c:   80 00 e1 f8 std r7,128(r1)
   c9370:   88 00 01 f9 std r8,136(r1)
   c9374:   98 00 41 f9 std r10,152(r1)
   c9378:   90 00 21 f9 std r9,144(r1)
   c937c:   00 00 63 e8 ld  r3,0(r3)
   c9380:   e1 07 ff 4b bl  b9b60
<06bf.plt_call.__uselocale@@GLIBC_2.17>
   c9384:   18 00 41 e8 ld  r2,24(r1)
   c9388:   78 eb a5 7f mr  r5,r29
   c938c:   78 f3 c4 7f mr  r4,r30
   c9390:   80 00 c1 38 addir6,r1,128
   c9394:   78 1b 69 7c mr  r9,r3
   c9398:   78 fb e3 7f mr  r3,r31
   c939c:   78 4b 3e 7d mr  r30,r9
   c93a0:   01 7f ff 4b bl  c12a0
<06bf.plt_call.vsnprintf@@GLIBC_2.17>
   c93a4:   18 00 41 e8 ld  r2,24(r1)
   c93a8:   78 1b 7f 7c mr  r31,r3
   c93ac:   78 f3 c3 7f mr  r3,r30
   c93b0:   b1 07 ff 4b bl  b9b60
<06bf.plt_call.__uselocale@@GLIBC_2.17>
   c93b4:   18 00 41 e8 ld  r2,24(r1)
   c93b8:   40 00 21 38 addir1,r1,64
   c93bc:   78 fb e3 7f mr  r3,r31
   c93c0:   10 00 01 e8 ld  r0,16(r1)
   c93c4:   e8 ff a1 eb ld  r29,-24(r1)
   c93c8:   f0 ff c1 eb ld  r30,-16(r1)
   c93cc:   f8 ff e1 eb ld  r31,-8(r1)
   c93d0:   a6 03 08 7c mtlrr0
   c93d4:   20 00 80 4e blr
   c93d8:   00 00 00 00 .long 0x0
   c93dc:   00 09 00 01 .long 0x1000900
   c93e0:   80 03 00 00 .long 0x380
   c93e4:   00 00 00 60 nop
   c93e8:   00 00 00 60 nop
   c93ec:   00 00 00 60 nop

[...]


Using LD_LIBRARY_PATH instead of LD_PRELOAD shows the same behavior:

~/build/gcc> LD_LIBRARY_PATH=~/usr/lib64/ ./test-shared 
6.95326e-310


Adding LD_DEBUG=libs shows that it is indeed using the libstdc++ I built:

~/build/gcc> LD_LIBRARY_PATH=~/usr/lib64/ LD_DEBUG=libs ./test-shared   
 38216: find library=libstdc++.so.6 [0]; searching  
 38216:  search
path=/home/mscastanho/usr/lib64/glibc-hwcaps/power9:/home/mscastanho/usr/lib64/tls/power9/altivec/dfp:/home/mscastanho/usr/lib64/tls/power9/altivec:/home/
mscastanho/usr/lib64/tls/power9/dfp:/home/mscastanho/usr/lib64/tls/power9:/home/mscastanho/usr/lib64/tls/altivec/dfp:/home/mscastanho/usr/lib64/tls/altivec:/home/mscastanho/usr/l
ib64/tls/dfp:/home/mscastanho/usr/lib64/tls:/home/mscastanho/usr/lib64/power9/altivec/dfp:/home/mscastanho/usr/lib64/power9/altivec:/home/mscastanho/usr/lib64/power9/dfp:/home/ms
castanho/usr/lib64/power9:/home/mscastanho/usr/lib64/altivec/dfp:/home/mscastanho/usr/lib64/altivec:/home/mscastanho/usr/lib64/dfp:/home/mscastanho/usr/lib64
 (LD_LIB
RARY_PATH)  
 38216:   trying
file=/home/mscastanho/usr/lib64/glibc-hwcaps/power9/libstdc++.so.6
 38216:   trying
file=/home/mscastanho/usr/lib64/tls/power9/altivec/dfp/libstdc++.so.6   
 38216:   trying
file=/home/mscastanho/usr/lib64/tls/power9/altivec/libstdc++.so.6   
 38216:   trying
file=/home/mscastanho/usr/lib64/tls/power9/dfp/libstdc++.so.6  
 
38216:   trying file=/home/mscastanho/usr/lib64/tls/power9/libstdc++.so.6   
 38216:   trying
file=/home/mscastanho/usr/lib64/tls/altivec/dfp/libstdc++.so.6 
 
38216:   trying file=/home/mscastanho/usr/lib64/tls/altivec/libstdc++.so.6  
 38216:   trying file=/home/mscastanho/usr/lib64/tls/dfp/libstdc++.so.6 
 38216:   trying file=/home/mscastanho/usr/lib64/tls/libstdc++.so.6 
 38216:   trying
file=/home/mscastanho/usr/lib64/power9/altivec/dfp/libstdc++.so.6  
 
38216:   trying
file=/home/mscastanho/usr/lib64/power9/altivec/libstdc++.so.6   
 38216:   trying
file=/home/mscastanho/usr/lib64/power9/dfp/libstdc++.so.6  
  

[Bug target/100912] powerpc64le: ieee128 long double incorrectly printed when using shared libstdc++

2021-06-05 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100912

--- Comment #2 from Jonathan Wakely  ---
Yes, or use "-Wl,-rpath,$HOME/usr/lib64" when linking.

I won't be able to test this myself until Monday

[Bug target/100912] powerpc64le: ieee128 long double incorrectly printed when using shared libstdc++

2021-06-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100912

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-06-04
  Component|libstdc++   |target
 Ever confirmed|0   |1
 Status|UNCONFIRMED |WAITING

--- Comment #1 from Andrew Pinski  ---
This sounds like it is still picking up the wrong libstdc++ really.

Can you disassemble (objdump -dr) ~/usr/lib64/libstdc++.so.6 to see which
vsnprintf is used there?

Also can you set LD_LIBRARY_PATH to ~/usr/lib64/ rather than using LD_PRELOAD
and see if that works.
The other thing to do use LD_DEBUG to figure out which libstdc++ is being used
really.