Questions tagged [musl]

A new standard library to power a new generation of Linux-based devices.

MUSL, a new standard library to power a new generation of Linux-based devices. MUSL is lightweight, fast, simple, free, and strives to be correct in the sense of standards-conformance and safety.
http://www.musl-libc.org/

149 questions
4
votes
2 answers

ELF loading on MIPS, malloc issue

I'm loading a plain statically linked ELF binary in MIPS (32-bit). After mapping the loadable segments, this is how I set up the stack before jumping into my target ELF's CRT's _start function: __asm__(" …
Thomas
  • 3,321
  • 1
  • 21
  • 44
4
votes
0 answers

musl libc: path to linux headers

I am trying to build lfs and using musl libc implementation instead of glibc. Glibc actually allows to set the path to linux kernel headers (--with-headers, like that), but musl don't. Moreover musl readme says following The system used to build…
hello world
  • 596
  • 2
  • 12
3
votes
0 answers

How to build mixed c/c++ program completely static

I have project with C and C++ code which I want to build as single .so library and use it in my Java program with Panama. On my computer it works fine, but in CI it fails because of GLIBC and GLIBCXX version mismatch. AFAIK better way to fix it is…
3
votes
1 answer

How do I remove the dependency on libunwind when cross-compiling Rust programs with the panic_abort option?

I'm specifying the -Cpanic=abort and -Zbuild-std=panic_abort when compiling. Why does the linker still say it needs libunwind to compile a program? I'm experimenting with various ways to cross-compile Rust programs as small as possible (using the…
irontigran
  • 31
  • 4
3
votes
2 answers

How to determine which libc implementation the host system uses

In our Python setup code that uses pre-built binaries and a bindings generator, we check the operating system and CPU architecture, and download binaries accordingly. Now, there are binaries for both manylinux (glibc) and musllinux (musl). How can…
mara004
  • 1,435
  • 11
  • 24
3
votes
1 answer

Error while building a static Linux binary (with musl-libc) that includes LuaJIT

I've cloned the LuaJIT git repo and built it with: make STATIC_CC="musl-gcc" BUILDMODE="static" Then, I compiled a simple Lua "hello world" script into a C header file: luajit -b test.lua test.h test.h: #define luaJIT_BC_test_SIZE 52 static const…
Discussian
  • 492
  • 3
  • 10
3
votes
0 answers

Is there a way to determine which Bash regexes are 'portable' across libc implementations?

I have just been bitten by unexpected regex behavioral differences between glibc and musl. Consider the script below: #!/usr/bin/env bash regex=" *([a-z ]+)+ [0-9]+" line=" the answer is 42" if [[ $line =~ $regex ]]; then echo…
anol
  • 8,264
  • 3
  • 34
  • 78
3
votes
0 answers

Build ring crate in docker image: unrecognized command-line option '-m64'

EDIT: added first fix provided by @jakub Cargo.toml [package] name = "rust_test" version = "0.1.0" edition = '2021' [dependencies] ring = "0.16.20" Dockerfile FROM rust:latest RUN rustup target add x86_64-unknown-linux-musl RUN apt -y update RUN…
Basic Coder
  • 10,882
  • 6
  • 42
  • 75
3
votes
2 answers

Decide GNU or MUSL build of linux in Java

I have a Java desktop application which is supposed to run in both GNU Linux distributions (Debian and Ubuntu) and MUSL Linux distributions (Alpine). My application uses a native library also and native library build is different for both type of…
Gaurav Jeswani
  • 4,410
  • 6
  • 26
  • 47
3
votes
1 answer

Use shared library that uses glibc on AlpineLinux

I'm working on an AlpineLinux (installed on my computer, not into a docker) and I'm trying to use a shared library which depends on glibc. As Glibc isn't integrated into this distribution, I saw that an alternative, gcompat, was developed to provide…
arnaudm
  • 157
  • 1
  • 10
3
votes
1 answer

undefined reference to `__printf_chk' when building from source with musl-g++

I'm attempting to compile a C++ library called VRPN with musl instead of glibc, and running into linker errors. Dockerfile # This build container compiles fully static binaries for alpine FROM ekidd/rust-musl-builder:1.49.0 AS build ENV…
Oliver Evans
  • 1,405
  • 14
  • 17
3
votes
1 answer

Error with Dockerfile in Rust, x86_64-unknown-linux-musl

I'm creating a Dockerfile for my Rust package, following the example shown here: https://alexbrand.dev/post/how-to-package-rust-applications-into-minimal-docker-containers/ FROM rust:1.47.0 AS build WORKDIR /usr/src RUN rustup target add…
EB2127
  • 1,788
  • 3
  • 22
  • 43
3
votes
1 answer

is glibc c11 thread implementation a wrapper on top of pthread?

to build a c11 thread program with glibc I still need link with -lpthread,why? glibc 2.28 claims c11 thread support but why I need pthread still? musl can build c11 thread without pthread though.
Shawn Shaw
  • 181
  • 3
  • 8
3
votes
1 answer

Check docker alpine musl version

We have docker files which based on alpine linux. I want for the built container to check the version of the musl library , I mean run the container and and in RT check the musl version how can I do that ? I've tried something like docker run -it…
Beno Odr
  • 1,123
  • 1
  • 13
  • 27
3
votes
2 answers

Can a dynamically linked glibc application dlopen() a static linked musl shared object?

I have a library that is currently dynamically linked against glibc. This library dynamically loaded into an application that is also dynamically linked against glibc. I have no control over the application, only over the shared object. However,…
henry
  • 140
  • 12
1 2
3
9 10