Linux MUSL
Posted: Sat Sep 03, 2022 1:13 am
So i have been experimenting with a MUSL libc and heres some problems i have run into.
After installing libucontext from official repository:
I do know the functions just above come from a libresolv but it seems the MUSL libc does not contain it. i tried doing a quick hack of designing the function signatures by creating a gcompat patch (glibc compat layer) myself with various combos of returning -1, 0, or x > 0 but it segfaults.
I can confirm it wasnt the libucontext but instead the patch, which changes the ld-linux (ld-musl) binary from the following:
I am wondering what it would actually take to get MUSL support. or any ideas on how to get around the unfound symbols (i had previously assumed the Mod menu would be broken before i found it segfaulting with my cheap imitation)
Thanks!![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Code: Select all
dots@gentpad ~ $ factorio
Error relocating /home/dots/Games/factorio/bin/x64/factorio: setcontext: symbol not found
Error relocating /home/dots/Games/factorio/bin/x64/factorio: makecontext: symbol not found
Error relocating /home/dots/Games/factorio/bin/x64/factorio: __res_nquery: symbol not found
Error relocating /home/dots/Games/factorio/bin/x64/factorio: __dn_expand: symbol not found
Code: Select all
dots@gentpad ~ $ factorio
Error relocating /home/dots/Games/factorio/bin/x64/factorio: __res_nquery: symbol not found
Error relocating /home/dots/Games/factorio/bin/x64/factorio: __dn_expand: symbol not found
I can confirm it wasnt the libucontext but instead the patch, which changes the ld-linux (ld-musl) binary from the following:
Code: Select all
(lldb) run
Process 5712 launched: '/home/dots/Games/factorio/bin/x64/factorio' (x86_64)
Process 5712 stopped
* thread #1, name = 'ld-musl-x86_64.', stop reason = exec
frame #0: 0x00007ffff7fc3027 libc.so`_dlstart
libc.so`_dlstart:
-> 0x7ffff7fc3027 <+0>: xorq %rbp, %rbp
0x7ffff7fc302a <+3>: movq %rsp, %rdi
0x7ffff7fc302d <+6>: leaq 0x37df4(%rip), %rsi
0x7ffff7fc3034 <+13>: andq $-0x10, %rsp
(lldb) continue
Process 5712 resuming
Process 5712 stopped
* thread #1, name = 'ld-musl-x86_64.', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
frame #0: 0x000000000172b8e5
-> 0x172b8e5: andw (%rax,%r12,2), %dx
0x172b8ea: jne 0x172b848
0x172b8f0: andl $0x1, %r15d
0x172b8f4: je 0x172b910
(lldb)
Thanks!
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)