Giter Club home page Giter Club logo

Comments (9)

dzbarsky avatar dzbarsky commented on July 26, 2024 1

@nickdesaulniers you might be interested in https://github.com/dzbarsky/static-clang/ (Also, hi, long time no see!)

from tc-build.

MaskRay avatar MaskRay commented on July 26, 2024

This is difficult to be done purely in llvm-project's CMake build system. Some musl linked external libraries are needed: libtinfo, libz, libstdc++/libc++. One will need a musl targeting toolchain to build these external libraries, then build a clang+libc++ (the built clang produces object files linking against the build musl libc++), finally re-build clang with the libc++ using clang.

musl-cross-make can build a GCC toolchain, but the author does not have extra bandwidth to support Clang.
@pattop's https://www.openwall.com/lists/musl/2021/01/11/1 may be helpful.

from tc-build.

kraj avatar kraj commented on July 26, 2024

we do cross build clang in Yocto/OE world to run on musl targets, I wonder if same clang can be targeted at x86_64 and used

from tc-build.

pattop avatar pattop commented on July 26, 2024

The current state of my musl-cross-make clang support is here https://github.com/apexrtos/musl-cross-make/tree/clang. It includes some patches for my embedded work, but the native x86_64 toolchain should be fully functional.

make COMPILER=clang
make COMPILER=clang OUTPUT=/tmp/musl-clang install

should be all you need to do to get a working musl-clang toolchain with some arm targets and x86_64. I've never tried to build clang with this though.

@MaskRay if you have time it would be great if you could review my build process & patches. Ideally it would be merged into musl-cross-make upstream but that doesn't look to be possible at the moment. There's enough complexity here that I think it's worth having one recipe for people to use.

from tc-build.

nickdesaulniers avatar nickdesaulniers commented on July 26, 2024

@compnerd has something hacked up that seems to be working:
https://gist.github.com/compnerd/ebbc625a359d1d3e292e1fd2007ecb52

from tc-build.

nickdesaulniers avatar nickdesaulniers commented on July 26, 2024

I'm working through trying to get this working in https://github.com/ClangBuiltLinux/llvm-musl-bootstrap/pull/1/files.

from tc-build.

Ericson2314 avatar Ericson2314 commented on July 26, 2024

What @sternenseemann did in #150 (comment) using Musl, so we have static linking and musl link both working.

from tc-build.

nickdesaulniers avatar nickdesaulniers commented on July 26, 2024

yo @dzbarsky I bookmarked that shit yesterday

from tc-build.

dzbarsky avatar dzbarsky commented on July 26, 2024

Nice, I fixed/cleaned up a few things and tagged a 17.0.1 release. It works for my purposes but if you see something off, let me know

from tc-build.

Related Issues (20)

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.