mailing list of musl libc
 help / color / mirror / code / Atom feed
* any one managed to compile and run xz-5.0.8 or xz-5.2.3 ?
@ 2018-01-25  0:18 Po-yi Wang
  2018-01-25  0:29 ` Rich Felker
  2018-01-25  1:13 ` A. Wilcox
  0 siblings, 2 replies; 7+ messages in thread
From: Po-yi Wang @ 2018-01-25  0:18 UTC (permalink / raw)
  To: musl

hi

any one managed to compile and run xz with musl on ppc target ?
i've managed to compile and run "xz --version" on i486 and arm targets, 
but not on ppc target. i've tried gcc-3.4.5 and gcc-4.1.2.
gcc-3.4.5 version simply hangs, while gcc-4.1.2 version seg faults --
with seg fault, i can at least use gdb to get some info out. i do not know 
how to use gdb to trace a hanged program. anyway, this is the output for 
gcc-4.1.2 compiled version. (xz-5.0.8):

gdb src/xz/xz

GNU gdb (GDB) 7.12.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from src/xz/xz...done.
(gdb) run --version
Starting program: /tmp/build/xz-5.0.8/src/xz/xz --version

Program received signal SIGSEGV, Segmentation fault.
0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4) at 
ldso/dlstart.c:146
146             GETFUNCSYM(&dls2, __dls2, base+dyn[DT_PLTGOT]);
(gdb) bt
#0  0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4)
     at ldso/dlstart.c:146
#1  0x480778ec in _dlstart () from /lib/ld-musl-powerpc-sf.so.1
(gdb) quit
A debugging session is active.

         Inferior 1 [process 22188] will be killed.

Quit anyway? (y or n) y




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: any one managed to compile and run xz-5.0.8 or xz-5.2.3 ?
  2018-01-25  0:18 any one managed to compile and run xz-5.0.8 or xz-5.2.3 ? Po-yi Wang
@ 2018-01-25  0:29 ` Rich Felker
  2018-01-25  1:21   ` Po-yi Wang
  2018-01-25  1:37   ` Po-yi Wang
  2018-01-25  1:13 ` A. Wilcox
  1 sibling, 2 replies; 7+ messages in thread
From: Rich Felker @ 2018-01-25  0:29 UTC (permalink / raw)
  To: musl; +Cc: Po-yi Wang

On Wed, Jan 24, 2018 at 04:18:59PM -0800, Po-yi Wang wrote:
> hi
> 
> any one managed to compile and run xz with musl on ppc target ?
> i've managed to compile and run "xz --version" on i486 and arm
> targets, but not on ppc target. i've tried gcc-3.4.5 and gcc-4.1.2.
> gcc-3.4.5 version simply hangs, while gcc-4.1.2 version seg faults --
> with seg fault, i can at least use gdb to get some info out. i do
> not know how to use gdb to trace a hanged program. anyway, this is
> the output for gcc-4.1.2 compiled version. (xz-5.0.8):

Where did you get gcc 3.4.5 or 4.1.2 toolchains for musl ppc? Is any
other software working when compiled with them? If you're not using a
real cross or native musl toolchain but the musl-gcc wrapper, it
probably lacks a lot of stuff it needs to work on ppc. In particular a
ppc toolchain that will be used for dynamic-linking needs to be
configured to always use "secure-plt", and whether static or dynamic,
it needs to be using 64-bit long double. You should have hit an error
configuring musl here if the compiler doesn't match:

    checking whether compiler's long double definition matches float.h...

Please provide more details.

> gdb src/xz/xz
> 
> GNU gdb (GDB) 7.12.1
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "powerpc-unknown-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from src/xz/xz...done.
> (gdb) run --version
> Starting program: /tmp/build/xz-5.0.8/src/xz/xz --version
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4) at
> ldso/dlstart.c:146
> 146             GETFUNCSYM(&dls2, __dls2, base+dyn[DT_PLTGOT]);
> (gdb) bt
> #0  0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4)
>     at ldso/dlstart.c:146
> #1  0x480778ec in _dlstart () from /lib/ld-musl-powerpc-sf.so.1
> (gdb) quit
> A debugging session is active.
> 
>         Inferior 1 [process 22188] will be killed.
> 
> Quit anyway? (y or n) y

This is an odd place to crash, and if it's crashing here it's almost
surely crashing for all programs, not just xz, since it hasn't gotten
to the point of looking at the program being run. It could be an issue
with very-outdated binutils doing something funny at link time linking
libc.so.

Rich


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: any one managed to compile and run xz-5.0.8 or xz-5.2.3 ?
  2018-01-25  0:18 any one managed to compile and run xz-5.0.8 or xz-5.2.3 ? Po-yi Wang
  2018-01-25  0:29 ` Rich Felker
@ 2018-01-25  1:13 ` A. Wilcox
  1 sibling, 0 replies; 7+ messages in thread
From: A. Wilcox @ 2018-01-25  1:13 UTC (permalink / raw)
  To: musl


[-- Attachment #1.1: Type: text/plain, Size: 940 bytes --]

On 01/24/18 18:18, Po-yi Wang wrote:
> hi
> 
> any one managed to compile and run xz with musl on ppc target ?


Yes.


elaine / # /lib/ld-musl-powerpc.so.1
musl libc (powerpc)
Version 1.1.18
Dynamic Program Loader
Usage: /lib/ld-musl-powerpc.so.1 [options] [--] pathname [args]
elaine / # ldd /usr/bin/xz
        /lib/ld-musl-powerpc.so.1 (0x200c6000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0xf7a8f000)
        libc.musl-ppc.so.1 => /lib/ld-musl-powerpc.so.1 (0x200c6000)
elaine / # /usr/bin/xz --version
xz (XZ Utils) 5.2.3
liblzma 5.2.3


> i've managed to compile and run "xz --version" on i486 and arm targets,
> but not on ppc target. i've tried gcc-3.4.5 and gcc-4.1.2.


elaine / # gcc --version
gcc (Adelie 6.4.0) 6.4.0


Maybe such old version doesn't support what musl needs.  I'm not sure.

Best,
--arw

-- 
A. Wilcox (awilfox)
Project Lead, Adélie Linux
http://adelielinux.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 866 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: any one managed to compile and run xz-5.0.8 or xz-5.2.3 ?
  2018-01-25  0:29 ` Rich Felker
@ 2018-01-25  1:21   ` Po-yi Wang
  2018-01-25  1:37   ` Po-yi Wang
  1 sibling, 0 replies; 7+ messages in thread
From: Po-yi Wang @ 2018-01-25  1:21 UTC (permalink / raw)
  To: musl



On Wed, 24 Jan 2018, Rich Felker wrote:

> On Wed, Jan 24, 2018 at 04:18:59PM -0800, Po-yi Wang wrote:
>> hi
>>
>> any one managed to compile and run xz with musl on ppc target ?
>> i've managed to compile and run "xz --version" on i486 and arm
>> targets, but not on ppc target. i've tried gcc-3.4.5 and gcc-4.1.2.
>> gcc-3.4.5 version simply hangs, while gcc-4.1.2 version seg faults --
>> with seg fault, i can at least use gdb to get some info out. i do
>> not know how to use gdb to trace a hanged program. anyway, this is
>> the output for gcc-4.1.2 compiled version. (xz-5.0.8):
>
> Where did you get gcc 3.4.5 or 4.1.2 toolchains for musl ppc? Is any
gcc-3.4.5 from :
http://www.kegel.com/crosstool/crosstool-0.43/doc/crosstool-howto.html
gcc-4.1.2 version from :
http://clfs.org/view/CLFS-3.0.0-SYSVINIT/
(this one is originally gcc-4.9.3 but i downgraded it to compile with
"--with-float=soft", which i could not get working with gcc-4.9.3 -- i 
might try again later. it was quite some time ago.)

the environment for ppc and arm, are chrooted, with only /proc /dev/pts 
mounted. no /sys. (does not seem to pose problem for arm version)

gcc built with: (overwriting gcc-4.9.3) 
# for ppc # this version is known to built ok earlier
WGET_UNPACK gcc-4.1.2.tar.xz
rm -rf b; mkdir b ; cd b
../configure --prefix=/usr --with-local-prefix=/usr --enable-shared 
--with-float=soft \
  --disable-nls --enable-languages=c,c++ --disable-multilib 
--disable-bootstrap \
   --disable-threads --disable-libmudflap --disable-libssp 
--disable-libgomp --disable-decimal-float
# make BOOT_LDFLAGS="-static" bootstrap                 || INTERVENTION 
$LINENO
make                                                  || INTERVENTION 
$LINENO
make install                                          || INTERVENTION 
$LINENO

# fix for gdb # gdb compiled with new gcc-4.1.2
ln -sfvn libstdc++.so.6.0.8 /usr/lib/libstdc++.so.6

# kernel header:
MUSL_BASE=/usr/musl
mkdir -p $MUSL_BASE
WGET_UNPACK linux-2.6.32.tar.xz
sed -i "/strict/d" scripts/headers_install.pl
sed -i "/strict/d" scripts/headers_check.pl
make headers_check && make INSTALL_HDR_PATH=$MUSL_BASE headers_install || 
INTERVENTION $LINENO

# musl:
CFLAGS="$CFLAGS -Os" ; gcc --version ; ld --version ; echo $CFLAGS
MUSL_BASE=/usr/musl
WGET_UNPACK musl-1.1.18.tar.xz
./configure --prefix=$MUSL_BASE
make         || INTERVENTION $LINENO
make install || INTERVENTION $LINENO
cd $MUSL_BASE/bin
ln -sfvn $(type -path ar) musl-ar
ln -sfvn $(type -path strip) musl-strip

# xz-5.0.8:
WGET_UNPACK xz-5.0.8.tar.xz
LDFLAGS="-static"  CC=musl-gcc ./configure --prefix=/tools --disable-nls
LDFLAGS="-static"  CC=musl-gcc make || INTERVENTION $LINENO

> other software working when compiled with them? If you're not using a
> real cross or native musl toolchain but the musl-gcc wrapper, it
> probably lacks a lot of stuff it needs to work on ppc. In particular a
> ppc toolchain that will be used for dynamic-linking needs to be
> configured to always use "secure-plt", and whether static or dynamic,
> it needs to be using 64-bit long double. You should have hit an error
> configuring musl here if the compiler doesn't match:
>
>    checking whether compiler's long double definition matches float.h...
i remembered seeing the check when compiling musl. it must have been ok, 
othersize it refused to compile. (that is why i downgraded gcc-4.9.3)

building with gnu tools has always been a huge pain for the last 18 
years... i am using musl wrapper to compile static commands, it seems to 
work well enough. my arm board has only 256m of memory, sometimes 
configure takes longer to run then the actually compiling ... anyway, i 
have no access or information on native musl toolchain. i used to use 
uclibc wrapper, but it was too old, and the newer uclibc seem difficult 
with lots of options. i am converting glibc compiled commands to musl. i 
am about 33% done.

>
> Please provide more details.
>
>> gdb src/xz/xz
>>
>> GNU gdb (GDB) 7.12.1
>> Copyright (C) 2017 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later
>> <http://gnu.org/licenses/gpl.html>
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
>> and "show warranty" for details.
>> This GDB was configured as "powerpc-unknown-linux-gnu".
>> Type "show configuration" for configuration details.
>> For bug reporting instructions, please see:
>> <http://www.gnu.org/software/gdb/bugs/>.
>> Find the GDB manual and other documentation resources online at:
>> <http://www.gnu.org/software/gdb/documentation/>.
>> For help, type "help".
>> Type "apropos word" to search for commands related to "word"...
>> Reading symbols from src/xz/xz...done.
>> (gdb) run --version
>> Starting program: /tmp/build/xz-5.0.8/src/xz/xz --version
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4) at
>> ldso/dlstart.c:146
>> 146             GETFUNCSYM(&dls2, __dls2, base+dyn[DT_PLTGOT]);
>> (gdb) bt
>> #0  0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4)
>>     at ldso/dlstart.c:146
>> #1  0x480778ec in _dlstart () from /lib/ld-musl-powerpc-sf.so.1
>> (gdb) quit
>> A debugging session is active.
>>
>>         Inferior 1 [process 22188] will be killed.
>>
>> Quit anyway? (y or n) y
>
> This is an odd place to crash, and if it's crashing here it's almost
> surely crashing for all programs, not just xz, since it hasn't gotten
> to the point of looking at the program being run. It could be an issue
> with very-outdated binutils doing something funny at link time linking
> libc.so.
>
> Rich
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: any one managed to compile and run xz-5.0.8 or xz-5.2.3 ?
  2018-01-25  0:29 ` Rich Felker
  2018-01-25  1:21   ` Po-yi Wang
@ 2018-01-25  1:37   ` Po-yi Wang
  2018-01-25  2:04     ` Will Dietz
  1 sibling, 1 reply; 7+ messages in thread
From: Po-yi Wang @ 2018-01-25  1:37 UTC (permalink / raw)
  To: musl



On Wed, 24 Jan 2018, Rich Felker wrote:

> On Wed, Jan 24, 2018 at 04:18:59PM -0800, Po-yi Wang wrote:
>> hi
>>
>> any one managed to compile and run xz with musl on ppc target ?
>> i've managed to compile and run "xz --version" on i486 and arm
>> targets, but not on ppc target. i've tried gcc-3.4.5 and gcc-4.1.2.
>> gcc-3.4.5 version simply hangs, while gcc-4.1.2 version seg faults --
>> with seg fault, i can at least use gdb to get some info out. i do
>> not know how to use gdb to trace a hanged program. anyway, this is
>> the output for gcc-4.1.2 compiled version. (xz-5.0.8):
>
> Where did you get gcc 3.4.5 or 4.1.2 toolchains for musl ppc? Is any
> other software working when compiled with them? If you're not using a
> real cross or native musl toolchain but the musl-gcc wrapper, it
> probably lacks a lot of stuff it needs to work on ppc. In particular a
> ppc toolchain that will be used for dynamic-linking needs to be
> configured to always use "secure-plt", and whether static or dynamic,
> it needs to be using 64-bit long double. You should have hit an error
> configuring musl here if the compiler doesn't match:
>
>    checking whether compiler's long double definition matches float.h...
>
> Please provide more details.
>
>> gdb src/xz/xz
>>
>> GNU gdb (GDB) 7.12.1
>> Copyright (C) 2017 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later
>> <http://gnu.org/licenses/gpl.html>
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
>> and "show warranty" for details.
>> This GDB was configured as "powerpc-unknown-linux-gnu".
>> Type "show configuration" for configuration details.
>> For bug reporting instructions, please see:
>> <http://www.gnu.org/software/gdb/bugs/>.
>> Find the GDB manual and other documentation resources online at:
>> <http://www.gnu.org/software/gdb/documentation/>.
>> For help, type "help".
>> Type "apropos word" to search for commands related to "word"...
>> Reading symbols from src/xz/xz...done.
>> (gdb) run --version
>> Starting program: /tmp/build/xz-5.0.8/src/xz/xz --version
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4) at
>> ldso/dlstart.c:146
>> 146             GETFUNCSYM(&dls2, __dls2, base+dyn[DT_PLTGOT]);
>> (gdb) bt
>> #0  0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4)
>>     at ldso/dlstart.c:146
>> #1  0x480778ec in _dlstart () from /lib/ld-musl-powerpc-sf.so.1
>> (gdb) quit
>> A debugging session is active.
>>
>>         Inferior 1 [process 22188] will be killed.
>>
>> Quit anyway? (y or n) y
>
> This is an odd place to crash, and if it's crashing here it's almost
> surely crashing for all programs, not just xz, since it hasn't gotten
> to the point of looking at the program being run. It could be an issue
> with very-outdated binutils doing something funny at link time linking
> libc.so.
actually other program compiled so far all works: (at least --version 
works)
res/ppc/bash-4.4:         ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/dbclient:         ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/dropbear:         ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/dropbearconvert:  ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/dropbearkey:      ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/ftp-0.17:         ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/make-3.80:        ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/make-4.1:         ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/msgfmt:           ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/msgmerge:         ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/ntpserver:        ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/patch-2.7.5:      ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/scp:              ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/tar-1.22:         ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/xxd-5.7:          ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped
res/ppc/xxxd:             ELF 32-bit MSB executable, PowerPC or cisco 
4500, version 1 (SYSV), statically linked, stripped


>
> Rich
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: any one managed to compile and run xz-5.0.8 or xz-5.2.3 ?
  2018-01-25  1:37   ` Po-yi Wang
@ 2018-01-25  2:04     ` Will Dietz
  2018-01-25  2:27       ` Po-yi Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Will Dietz @ 2018-01-25  2:04 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 5488 bytes --]

Those seem to all be statically linked, do any dynamically linked programs
work?

This is particularly relevant since the crash occurs in early part of the
dynamic linker/loader.

On Wed, Jan 24, 2018, 7:38 PM Po-yi Wang <player@vcn.bc.ca> wrote:

>
>
> On Wed, 24 Jan 2018, Rich Felker wrote:
>
> > On Wed, Jan 24, 2018 at 04:18:59PM -0800, Po-yi Wang wrote:
> >> hi
> >>
> >> any one managed to compile and run xz with musl on ppc target ?
> >> i've managed to compile and run "xz --version" on i486 and arm
> >> targets, but not on ppc target. i've tried gcc-3.4.5 and gcc-4.1.2.
> >> gcc-3.4.5 version simply hangs, while gcc-4.1.2 version seg faults --
> >> with seg fault, i can at least use gdb to get some info out. i do
> >> not know how to use gdb to trace a hanged program. anyway, this is
> >> the output for gcc-4.1.2 compiled version. (xz-5.0.8):
> >
> > Where did you get gcc 3.4.5 or 4.1.2 toolchains for musl ppc? Is any
> > other software working when compiled with them? If you're not using a
> > real cross or native musl toolchain but the musl-gcc wrapper, it
> > probably lacks a lot of stuff it needs to work on ppc. In particular a
> > ppc toolchain that will be used for dynamic-linking needs to be
> > configured to always use "secure-plt", and whether static or dynamic,
> > it needs to be using 64-bit long double. You should have hit an error
> > configuring musl here if the compiler doesn't match:
> >
> >    checking whether compiler's long double definition matches float.h...
> >
> > Please provide more details.
> >
> >> gdb src/xz/xz
> >>
> >> GNU gdb (GDB) 7.12.1
> >> Copyright (C) 2017 Free Software Foundation, Inc.
> >> License GPLv3+: GNU GPL version 3 or later
> >> <http://gnu.org/licenses/gpl.html>
> >> This is free software: you are free to change and redistribute it.
> >> There is NO WARRANTY, to the extent permitted by law.  Type "show
> copying"
> >> and "show warranty" for details.
> >> This GDB was configured as "powerpc-unknown-linux-gnu".
> >> Type "show configuration" for configuration details.
> >> For bug reporting instructions, please see:
> >> <http://www.gnu.org/software/gdb/bugs/>.
> >> Find the GDB manual and other documentation resources online at:
> >> <http://www.gnu.org/software/gdb/documentation/>.
> >> For help, type "help".
> >> Type "apropos word" to search for commands related to "word"...
> >> Reading symbols from src/xz/xz...done.
> >> (gdb) run --version
> >> Starting program: /tmp/build/xz-5.0.8/src/xz/xz --version
> >>
> >> Program received signal SIGSEGV, Segmentation fault.
> >> 0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4) at
> >> ldso/dlstart.c:146
> >> 146             GETFUNCSYM(&dls2, __dls2, base+dyn[DT_PLTGOT]);
> >> (gdb) bt
> >> #0  0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4)
> >>     at ldso/dlstart.c:146
> >> #1  0x480778ec in _dlstart () from /lib/ld-musl-powerpc-sf.so.1
> >> (gdb) quit
> >> A debugging session is active.
> >>
> >>         Inferior 1 [process 22188] will be killed.
> >>
> >> Quit anyway? (y or n) y
> >
> > This is an odd place to crash, and if it's crashing here it's almost
> > surely crashing for all programs, not just xz, since it hasn't gotten
> > to the point of looking at the program being run. It could be an issue
> > with very-outdated binutils doing something funny at link time linking
> > libc.so.
> actually other program compiled so far all works: (at least --version
> works)
> res/ppc/bash-4.4:         ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/dbclient:         ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/dropbear:         ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/dropbearconvert:  ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/dropbearkey:      ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/ftp-0.17:         ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/make-3.80:        ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/make-4.1:         ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/msgfmt:           ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/msgmerge:         ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/ntpserver:        ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/patch-2.7.5:      ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/scp:              ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/tar-1.22:         ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/xxd-5.7:          ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
> res/ppc/xxxd:             ELF 32-bit MSB executable, PowerPC or cisco
> 4500, version 1 (SYSV), statically linked, stripped
>
>
> >
> > Rich
> >
>

[-- Attachment #2: Type: text/html, Size: 6900 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: any one managed to compile and run xz-5.0.8 or xz-5.2.3 ?
  2018-01-25  2:04     ` Will Dietz
@ 2018-01-25  2:27       ` Po-yi Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Po-yi Wang @ 2018-01-25  2:27 UTC (permalink / raw)
  To: musl



On Thu, 25 Jan 2018, Will Dietz wrote:

> Those seem to all be statically linked, do any dynamically linked programs
> work?
>
> This is particularly relevant since the crash occurs in early part of the
> dynamic linker/loader.

ok, i went back and check all 3 binaries, all of them dynamically linked 
for some reason, still i486 and arm worked (well "--version" worked). only 
ppc version hanged or seg faulted. even though i have passed 
LDFLAGS="-static" to configure, it still insist on compiling dynamically.
i managed to fix it with explicit command instead of make:
cd src/xz/
make clean ; LDFLAGS="-static"  CC=musl-gcc make
LDFLAGS="-static"  musl-gcc -static -std=gnu99 -pthread -Wall -Wformat=2 
-Wfloat-equal \
  -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast \
  -Wwrite-strings -Waggregate-return -Wstrict-prototypes \
  -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn \
  -Wredundant-decls -Os -s -o xz xz-args.o xz-coder.o xz-file_io.o \
  xz-hardware.o xz-list.o xz-main.o xz-message.o xz-options.o \
  xz-signals.o xz-suffix.o xz-util.o xz-tuklib_open_stdxxx.o \
  xz-tuklib_progname.o xz-tuklib_exit.o xz-tuklib_cpucores.o \
  xz-tuklib_mbstr_width.o xz-tuklib_mbstr_fw.o 
../../src/liblzma/.libs/liblzma.a -pthread

now all three targets worked (statically).
thanks.

>
> On Wed, Jan 24, 2018, 7:38 PM Po-yi Wang <player@vcn.bc.ca> wrote:
>
>>
>>
>> On Wed, 24 Jan 2018, Rich Felker wrote:
>>
>>> On Wed, Jan 24, 2018 at 04:18:59PM -0800, Po-yi Wang wrote:
>>>> hi
>>>>
>>>> any one managed to compile and run xz with musl on ppc target ?
>>>> i've managed to compile and run "xz --version" on i486 and arm
>>>> targets, but not on ppc target. i've tried gcc-3.4.5 and gcc-4.1.2.
>>>> gcc-3.4.5 version simply hangs, while gcc-4.1.2 version seg faults --
>>>> with seg fault, i can at least use gdb to get some info out. i do
>>>> not know how to use gdb to trace a hanged program. anyway, this is
>>>> the output for gcc-4.1.2 compiled version. (xz-5.0.8):
>>>
>>> Where did you get gcc 3.4.5 or 4.1.2 toolchains for musl ppc? Is any
>>> other software working when compiled with them? If you're not using a
>>> real cross or native musl toolchain but the musl-gcc wrapper, it
>>> probably lacks a lot of stuff it needs to work on ppc. In particular a
>>> ppc toolchain that will be used for dynamic-linking needs to be
>>> configured to always use "secure-plt", and whether static or dynamic,
>>> it needs to be using 64-bit long double. You should have hit an error
>>> configuring musl here if the compiler doesn't match:
>>>
>>>    checking whether compiler's long double definition matches float.h...
>>>
>>> Please provide more details.
>>>
>>>> gdb src/xz/xz
>>>>
>>>> GNU gdb (GDB) 7.12.1
>>>> Copyright (C) 2017 Free Software Foundation, Inc.
>>>> License GPLv3+: GNU GPL version 3 or later
>>>> <http://gnu.org/licenses/gpl.html>
>>>> This is free software: you are free to change and redistribute it.
>>>> There is NO WARRANTY, to the extent permitted by law.  Type "show
>> copying"
>>>> and "show warranty" for details.
>>>> This GDB was configured as "powerpc-unknown-linux-gnu".
>>>> Type "show configuration" for configuration details.
>>>> For bug reporting instructions, please see:
>>>> <http://www.gnu.org/software/gdb/bugs/>.
>>>> Find the GDB manual and other documentation resources online at:
>>>> <http://www.gnu.org/software/gdb/documentation/>.
>>>> For help, type "help".
>>>> Type "apropos word" to search for commands related to "word"...
>>>> Reading symbols from src/xz/xz...done.
>>>> (gdb) run --version
>>>> Starting program: /tmp/build/xz-5.0.8/src/xz/xz --version
>>>>
>>>> Program received signal SIGSEGV, Segmentation fault.
>>>> 0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4) at
>>>> ldso/dlstart.c:146
>>>> 146             GETFUNCSYM(&dls2, __dls2, base+dyn[DT_PLTGOT]);
>>>> (gdb) bt
>>>> #0  0x4806fab8 in _dlstart_c (sp=0xbffff4a0, dynv=0x480b2ae4)
>>>>     at ldso/dlstart.c:146
>>>> #1  0x480778ec in _dlstart () from /lib/ld-musl-powerpc-sf.so.1
>>>> (gdb) quit
>>>> A debugging session is active.
>>>>
>>>>         Inferior 1 [process 22188] will be killed.
>>>>
>>>> Quit anyway? (y or n) y
>>>
>>> This is an odd place to crash, and if it's crashing here it's almost
>>> surely crashing for all programs, not just xz, since it hasn't gotten
>>> to the point of looking at the program being run. It could be an issue
>>> with very-outdated binutils doing something funny at link time linking
>>> libc.so.
>> actually other program compiled so far all works: (at least --version
>> works)
>> res/ppc/bash-4.4:         ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/dbclient:         ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/dropbear:         ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/dropbearconvert:  ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/dropbearkey:      ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/ftp-0.17:         ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/make-3.80:        ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/make-4.1:         ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/msgfmt:           ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/msgmerge:         ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/ntpserver:        ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/patch-2.7.5:      ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/scp:              ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/tar-1.22:         ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/xxd-5.7:          ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>> res/ppc/xxxd:             ELF 32-bit MSB executable, PowerPC or cisco
>> 4500, version 1 (SYSV), statically linked, stripped
>>
>>
>>>
>>> Rich
>>>
>>
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-01-25  2:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-25  0:18 any one managed to compile and run xz-5.0.8 or xz-5.2.3 ? Po-yi Wang
2018-01-25  0:29 ` Rich Felker
2018-01-25  1:21   ` Po-yi Wang
2018-01-25  1:37   ` Po-yi Wang
2018-01-25  2:04     ` Will Dietz
2018-01-25  2:27       ` Po-yi Wang
2018-01-25  1:13 ` A. Wilcox

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).