Re: [OpenWrt-Devel] [musl] Support for musl libc in OpenWrt

2012-11-25 Thread Florian Fainelli
Le samedi 24 novembre 2012 07:15:33, Isaac Dunham a écrit :
 On Fri, 23 Nov 2012 21:10:33 +0100
 
 Florian Fainelli flor...@openwrt.org wrote:
  Hi All,
  
  Support for musl libc in OpenWrt has been added in revision r34314,
 
 Glad to hear it!
 
  Note that the following issues are known:
  
  - unable to complete libstdc++ build due to some missing declarations
  (WIP)
 
 Are you using the default linux-gnu libstdc++, or the generic target?
 Only the latter is known to work at this point.

It is the linux-gnu libstdc++, we do not support building the generic one 
yet, might be worth supporting it now.

 
  - MIPS and MIPSel ports are not functionnal (details below)
  
  --
  MIPS and MIPSel specific issues:
  
  using qemu's binary emulation (qemu-mips[el]) against a statically
  linked binary works, a dynamic binary makes my host qemu segv. Using
  qemu-system-mips[el], the binary segfaults while being executed by the
  kernel. So far I have not had the time to debug this further.
 
 There are likely other issues, but are you using a hardfloat-compatible
 kernel (FPU emulation enabled)? 

No, we have patched the kernel do disable the hardware FPU emulation, which 
was actually the issue, because musl setjmp MIPS-specific code tried to access 
Cop1 registers. After patching setjmp not to access these it works flawlessly 
on MIPS (big-endian) but MIPS (little-endian) still segfaults while being 
executed either from the kernel or qemu-mipsel.

 At present, musl/mips relies on certain
 instructions that the kernel  ordinarily emulates when they aren't
 supported.

You mean ll/sc right? I build for MIPS32r2 so this should not be an issue.
-- 
Florian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [musl] Support for musl libc in OpenWrt

2012-11-25 Thread Szabolcs Nagy
* Florian Fainelli flor...@openwrt.org [2012-11-25 12:46:26 +0100]:
 Cop1 registers. After patching setjmp not to access these it works flawlessly 
 on MIPS (big-endian) but MIPS (little-endian) still segfaults while being 
 executed either from the kernel or qemu-mipsel.
 

so there is endian issue with dynamic linking

musl c code should not depend on endianness
(eg on x86 it works fine) so i guess the issue
is mips specific

maybe something in mips asm

or maybe there is some difference between
mips and mipsel other than the endianness?
(elf header or auxv something, or the build
toolchain is different in some way)

can you run libc.so itself?

/lib/libc.so

should print a usage message

if it works then try to run it as ldd on
a dynlinked binary
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel