Coder Social home page Coder Social logo

swift-alpine's Introduction

swift-alpine

Swift on Alpine Linux using musl instead of glibc (work in progress)

swift-alpine's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

capttaco

swift-alpine's Issues

Compiled clang doesn't have search paths properly set up

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.