Swift on Alpine Linux using musl instead of glibc (work in progress)
maxdesiatov / swift-alpine Goto Github PK
View Code? Open in Web Editor NEWSwift on Alpine Linux using musl instead of glibc (work in progress)
License: Apache License 2.0
Swift on Alpine Linux using musl instead of glibc (work in progress)
License: Apache License 2.0
Looked up this under GitHub but itβs 404
maxd/musl
As can be seen below, newly compiled clang can't figure out paths for crtbegin.o
and crtend.o
. -lgcc
also fails, but succeeds if -L
is explicitly passed to the linker. After linking
succeeds (with a manual invocation), the produced binary then seems to expect /lib64/ld-linux-x86-64.so.2
to exist. The latter can probably be fixed by tweaking the -dynamic-linker
flag.
# /root/source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./bin/clang test.c
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
bash-5.0# find / -iname 'libgcc*'
/usr/lib/libgcc_s.so.1
/usr/lib/libgcc_s.so
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/libgcc_eh.a
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/libgcc.a
/root/source/llvm-project/llgo/third_party/gofrontend/libgcc
/root/source/llvm-project/clang/test/Driver/Inputs/montavista_i686_tree/usr/lib/gcc/i686-montavista-linux/4.2.0/libgcc.a
bash-5.0# "/usr/bin/ld" -z now -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/crtbegin.o -L/root/source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/bin/../lib -L/lib -L/usr/lib /tmp/test-0a50f9.o -L/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/ -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed crtend.o /usr/lib/crtn.o
/usr/bin/ld: cannot find crtend.o: No such file or directory
bash-5.0# "/usr/bin/ld" -z now -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/crtbegin.o -L/root/source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/bin/../lib -L/lib -L/usr/lib /tmp/test-0a50f9.o -L/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/ -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/crtend.o /usr/lib/crtn.o
bash-5.0# ls
CMakeCache.txt CMakeFiles a.out test.c
bash-5.0# ./a.out
bash: ./a.out: No such file or directory
bash-5.0# ls ./a.out
./a.out
bash-5.0# ./a.out
bash: ./a.out: No such file or directory
bash-5.0# file ./a.out
./a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, with debug_info, not stripped
bash-5.0# a.out
bash: a.out: command not found
bash-5.0# file /lib64/ld-linux-x86-64.so.2
/lib64/ld-linux-x86-64.so.2: cannot open `/lib64/ld-linux-x86-64.so.2' (No such file or directory)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.