musl-cross-make icon indicating copy to clipboard operation
musl-cross-make copied to clipboard

Is it possible to build with older musl vesions?

Open luckycat889 opened this issue 11 months ago • 4 comments

Hello, I appreciate the ease to build a custom musl-based gcc toolchain! It seems that the earliest musl version supported is 1.1.14. I wonder if it's possible to build with a slightly older musl, namely 1.1.6 (I wanted to test a binary compatibility thing with libc)? I gave it a shot and it seems to fail during configure, it could be as easy as setting up the soft link to the source resident Makefile; I am trying it out now. But while I am trying that I figured I ask the question and if anyone knows if there are any roadblocks or if it should work fine (with some patches).

luckycat889 avatar Mar 06 '24 12:03 luckycat889

the easiest way is to build the toolchain with the default musl, then use the new toolchain to build your desired musl version manually and install it into the toolchain prefix using ./configure --prefix= and later make install DESTDIR=/path/.

rofl0r avatar Mar 06 '24 15:03 rofl0r

Oh, I see, that makes sense I think. Just so I am clear;

  1. Build a toolchain with supported versions (musl say 1.1.14; that works fine, I checked)
  2. Download a musl tarballs of whatever version, untar, configure using above toolchain and install in place in toolchain installation tree
  3. I guess, I'd want to make sure names of libraries are the same; making sure that there are no leftovers from 1.1.14

Thanks for the tip, I'll try it out

luckycat889 avatar Mar 06 '24 15:03 luckycat889

You can easily build with any musl version using git instead of releases. The form is MUSL_VER = git-${COMMIT_ID} but a commit id can be a tag such as v1.1.6 (note the v).

You can also just pre-extract musl-1.1.6.tar.gz under the top level mcm directory and then MUSL_VER = 1.1.6 will work in the absence of hash file and rules to download it.

richfelker avatar Mar 06 '24 15:03 richfelker

I did actually try to add the 1.1.6 hash file, and it downloads it fine, but the configure script seems incompatible with the obj_musl/src_musl convention. I tried a few things such as creating a soft link to the Makefile in the obj_musl directory, but there are more things to shore up. So I think your suggestion of a separate musl build appears easier for this one-off thing I am trying....

luckycat889 avatar Mar 06 '24 16:03 luckycat889