{"id":19513637,"url":"https://github.com/ryanwoodsmall/musl-misc","last_synced_at":"2026-07-25T02:30:19.079Z","repository":{"id":82301328,"uuid":"80560753","full_name":"ryanwoodsmall/musl-misc","owner":"ryanwoodsmall","description":"musl C library miscellaneous","archived":false,"fork":false,"pushed_at":"2024-05-24T08:16:02.000Z","size":107,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-08T12:13:09.281Z","etag":null,"topics":["crosware","musl","musl-cross","musl-libc","rpm","rpm-packages","rpm-spec"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanwoodsmall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-31T20:48:28.000Z","updated_at":"2025-01-01T21:15:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"31c3c527-ce53-495f-a888-6e60d2ab6afb","html_url":"https://github.com/ryanwoodsmall/musl-misc","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwoodsmall%2Fmusl-misc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwoodsmall%2Fmusl-misc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwoodsmall%2Fmusl-misc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwoodsmall%2Fmusl-misc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanwoodsmall","download_url":"https://codeload.github.com/ryanwoodsmall/musl-misc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240762511,"owners_count":19853495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crosware","musl","musl-cross","musl-libc","rpm","rpm-packages","rpm-spec"],"created_at":"2024-11-10T23:31:39.055Z","updated_at":"2026-07-25T02:30:19.001Z","avatar_url":"https://github.com/ryanwoodsmall.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# musl-misc\nmusl C library miscellaneous\n\n## bits\n- **rpm/SPECS/musl-static.spec** : centos/rhel 6 \u0026 7 musl-libc static libs, headers and toolchain wrappers\n- **musl-cross-make-confs/Makefile.arch_indep** : musl-cross-make Makefile driver for building a fully-static toolchain\n\n## links\n- **musl-libc** : http://www.musl-libc.org/\n- **musl-cross-make** : https://github.com/richfelker/musl-cross-make\n- **crosware**, where this is used : https://github.com/ryanwoodsmall/crosware\n\n## docker dockerfiles/scripts/resources\n- musl static lib rpm: https://github.com/ryanwoodsmall/dockerfiles/tree/master/centos-rpm-builds\n- crosware static toolchain builder: https://github.com/ryanwoodsmall/dockerfiles/tree/master/crosware/statictoolchain\n- docker container: https://hub.docker.com/r/ryanwoodsmall/crosware\n\n## todo\n- XXX - move to either a .gz (everywhere) or an .xz (maybe not everywhere) archive\n- XXX - 9cc 9.5.0 + musl 1.2.3 is the end of line for 9, need to figure out 10/11/12\n- XXX - gcc 9.4 + musl 1.2.2 seems to break openssh+libressl\n  - related to mallocng?\n  - 1.2.0 and 1.2.1 w/`--with-malloc=oldmalloc` in `MUSL_CONFIG` seems to work\n  - 1.2.2 doesn't want to build with `--with-malloc=oldmalloc`\n- XXX - gcc 10 enables `-fno-common` by default, needs multiple workarounds\n- XXX - gcc 10 conflicts with crosware binutils, libiberty or similar, need to figure out\n- crank up default stack size? from habitat core/musl (default 80KB -\u003e 2MB?):\n  - `sed -i 's/#define DEFAULT_STACK_SIZE .*/#define DEFAULT_STACK_SIZE 2097152/' src/internal/pthread_impl.h`\n- `--enable-new-dtags` - RUNPATH instead of RPATH\n- need gnu patch, should test for it\n- **riscv64** kernel headers not included... need to fix (make general for non intel/arm)\n- integrate off64\\_t/loff\\_t fixes for gccgo, etc.:\n  - https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg476845.html\n  - http://gcc-patches.gcc.gnu.narkive.com/xkNPk6Vm/libgo-patch-committed-fill-out-syscall-package-for-gnu-linux\n  - http://gcc.1065356.n8.nabble.com/libgo-patch-committed-Fill-out-syscall-package-for-GNU-Linux-td491220.html\n  - ```-D_LARGEFILE_SOURCE``` and/or ```-D_LARGEFILE64_SOURCE```? ```${OSCFLAGS}```\n- split out ld.so patches into multiple arches?\n- a fake sysroot is needed (perl and the like can use it)\n- utmp/wtmp, i.e:\n```\n/usr/local/crosware/software/statictoolchain/current/x86_64-linux-musl/include/utmp.h:#define _PATH_UTMP \"/dev/null/utmp\"\n/usr/local/crosware/software/statictoolchain/current/x86_64-linux-musl/include/utmp.h:#define _PATH_WTMP \"/dev/null/wtmp\"\n/usr/local/crosware/software/statictoolchain/current/x86_64-linux-musl/include/paths.h:#define _PATH_UTMP       \"/dev/null/utmp\"\n/usr/local/crosware/software/statictoolchain/current/x86_64-linux-musl/include/paths.h:#define _PATH_WTMP       \"/dev/null/wtmp\"\n```\n\n### bootstrapping\n- alpine works fine\n  - see apk and bash/curl commands in comments\n- crosware\n  - need to be able to self-host\n  - need a ```${cwsw}/wget/current/bin/wget --no-check-certificate \"${@}\"``` wrapper\n    - or try busybox wget and relax gnu check?\n  - environment...\n    - **wget wrapper**\n    - ```crosware install statictoolchain git ; crosware update ; crosware install binutils slibtool ; . ${cwtop}/etc/profile```\n\n### alpine options\n\n```\n--enable-checking=release\n--disable-fixed-point\n--disable-libstdcxx-pch\n--disable-multilib\n--disable-nls\n--disable-werror\n--disable-symvers\n--enable-__cxa_atexit\n--enable-default-pie\n--enable-default-ssp\n--enable-cloog-backend\n--enable-languages=c,c++,d,objc,go,fortran,ada\n--disable-libssp\n--disable-libmpx\n--disable-libmudflap\n--disable-libsanitizer\n--enable-shared\n--enable-threads\n--enable-tls\n--with-system-zlib\n--with-linker-hash-style=gnu\n```\n\n#### this doesn't work:::\n\n**OLD**\n\n- libtool? use slibtool\n- errors ad infinitum\n  - gmp (fixed)\n  - mpfr (fixed)\n  - mpc (fixed)\n  - binutils (fixed)\n- libtool -\u003e slibtool symlink\n- currently dies on compiling shared objects and/in C++ ABI issues\n- this gets through a shared build:\n  - ```LIBTOOL=slibtool CFLAGS=-fPIC CXXFLAGS=-fPIC LIBS=\"-L${cwsw}/binutils/current/lib/ -liberty\" LDFLAGS=\"${LDFLAGS} -s --static\" make -f ~/Makefile.arch_indep```\n  - but flakes out with c++/abi diffs again'\n  - shared vs static vs host-shared?\n  - tinkering with ```COMMON_CONFIG=\"--build=$(gcc -dumpmachine) --target=$(gcc -dumpmachine) --host=$(gcc -dumpmachine)\"```\n  - musl-cross-make sets target, may override or ignore build/host\n- nope ```env LIBTOOL=slibtool CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=\"${LDFLAGS//-static/}\" LIBS='-liberty' make -f ~/Makefile.arch_indep```\n- huh uh? ```env LIBTOOL=slibtool CFLAGS=-fPIC CXXFLAGS=-fPIC LIBS=\"-L${cwsw}/binutils/current/lib/ -liberty\" LDFLAGS=\"${LDFLAGS} -s --static\" make -f ~/Makefile.arch_indep  ) ) \u003e/tmp/musl-cross-make.out 2\u003e\u00261```\n- leads to c++ abi issues previously observed (https://github.com/ryanwoodsmall/musl-misc/blob/776f8211b8019e8197ae0e9dcf0b524d29b43d81/README.md)\n```\nenv \\\n  LD_LIBRARY_PATH=\"$(echo ${cwsw}/{binutils,gmp,mpc,mpfr}/current/lib | tr ' ' ':')\" \\\n  LIBTOOL=slibtool \\\n  CFLAGS=-fPIC \\\n  CXXFLAGS=-fPIC \\\n  LIBS=-liberty \\\n  LDFLAGS=\"${LDFLAGS//-static/}\" \\\n  make -f ~/Makefile.arch_indep \u003e/tmp/musl-cross-make.out 2\u003e\u00261\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanwoodsmall%2Fmusl-misc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanwoodsmall%2Fmusl-misc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanwoodsmall%2Fmusl-misc/lists"}