Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

choosenim does not work on Linux with musl #216

Closed
refacto opened this issue Aug 31, 2020 · 6 comments · Fixed by #225 or #238
Closed

choosenim does not work on Linux with musl #216

refacto opened this issue Aug 31, 2020 · 6 comments · Fixed by #225 or #238

Comments

@refacto
Copy link

refacto commented Aug 31, 2020

As in the title, trying to run curl https://nim-lang.org/choosenim/init.sh -sSf | sh on a musl based Linux distro results in:

choosenim-init: Downloading choosenim-0.6.0_linux_amd64
sh: /tmp/choosenim-0.6.0_linux_amd64: not found

This is because choosenim is linked against glibc:

thermi:~$ ldd /tmp/choosenim-0.6.0_linux_amd64 
        /lib64/ld-linux-x86-64.so.2 (0x7fc250e12000)
        librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7fc250e12000)
        libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7fc250e12000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fc250e12000)
Error relocating /tmp/choosenim-0.6.0_linux_amd64: __fdelt_chk: symbol not found
Error relocating /tmp/choosenim-0.6.0_linux_amd64: __poll_chk: symbol not found
Error relocating /tmp/choosenim-0.6.0_linux_amd64: __strdup: symbol not found
Error relocating /tmp/choosenim-0.6.0_linux_amd64: __memcpy_chk: symbol not found
Error relocating /tmp/choosenim-0.6.0_linux_amd64: gnu_dev_major: symbol not found
Error relocating /tmp/choosenim-0.6.0_linux_amd64: __longjmp_chk: symbol not found
Error relocating /tmp/choosenim-0.6.0_linux_amd64: gnu_dev_minor: symbol not found
Error relocating /tmp/choosenim-0.6.0_linux_amd64: __fprintf_chk: symbol not found
Error relocating /tmp/choosenim-0.6.0_linux_amd64: gnu_dev_makedev: symbol not found
Error relocating /tmp/choosenim-0.6.0_linux_amd64: __sprintf_chk: symbol not found
@refacto
Copy link
Author

refacto commented Aug 31, 2020

Tested with Alpine Linux edge, updated on 2020-08-31.

@dom96
Copy link
Owner

dom96 commented Aug 31, 2020

Ouch. Guess we need to statically link with glibc and/or musl.

@dom96
Copy link
Owner

dom96 commented Oct 1, 2020

So, musl isn't working because libarchive cannot work with it:

/home/dom/.cache/nim/nimterop/nimarchive/libarchive/LibArchive/lib/libarchive.a(archive_entry.o): In function `archive_entry_devmajor':
        ... /workspace/srcdir/libarchive/libarchive/archive_entry.c:344: undefined reference to `gnu_dev_major'

It's the error I got when I tried to compile with musl-gcc which is the same error you are seeing.

@refacto
Copy link
Author

refacto commented Oct 22, 2020

That's good, choosenim now works, but it installs an incompatible nim:

thermi:~$ ldd ./.nimble/bin/nim
        /lib64/ld-linux-x86-64.so.2 (0x7fdf85ddc000)
        librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7fdf85ddc000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fdf85ddc000)
Error relocating ./.nimble/bin/nim: __memcpy_chk: symbol not found
Error relocating ./.nimble/bin/nim: __longjmp_chk: symbol not found

@dom96 dom96 reopened this Oct 22, 2020
@genotrance
Copy link
Collaborator

Looks like I missed compiling the proxyexe files with musl.

@inv2004
Copy link

inv2004 commented Jan 21, 2021

The same problem like @refacto to up the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants