Skip to content

ryanwoodsmall/musl-misc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

musl-misc

musl C library miscellaneous

bits

  • rpm/SPECS/musl-static.spec : centos/rhel 6 & 7 musl-libc static libs, headers and toolchain wrappers
  • musl-cross-make-confs/Makefile.arch_indep : musl-cross-make Makefile driver for building a fully-static toolchain

links

docker dockerfiles/scripts/resources

todo

/usr/local/crosware/software/statictoolchain/current/x86_64-linux-musl/include/utmp.h:#define _PATH_UTMP "/dev/null/utmp"
/usr/local/crosware/software/statictoolchain/current/x86_64-linux-musl/include/utmp.h:#define _PATH_WTMP "/dev/null/wtmp"
/usr/local/crosware/software/statictoolchain/current/x86_64-linux-musl/include/paths.h:#define _PATH_UTMP       "/dev/null/utmp"
/usr/local/crosware/software/statictoolchain/current/x86_64-linux-musl/include/paths.h:#define _PATH_WTMP       "/dev/null/wtmp"

bootstrapping

  • alpine works fine
    • see apk and bash/curl commands in comments
  • crosware
    • need to be able to self-host
    • need a ${cwsw}/wget/current/bin/wget --no-check-certificate "${@}" wrapper
      • or try busybox wget and relax gnu check?
    • environment...
      • wget wrapper
      • crosware install statictoolchain git ; crosware update ; crosware install binutils slibtool ; . ${cwtop}/etc/profile

alpine options

--enable-checking=release
--disable-fixed-point
--disable-libstdcxx-pch
--disable-multilib
--disable-nls
--disable-werror
--disable-symvers
--enable-__cxa_atexit
--enable-default-pie
--enable-default-ssp
--enable-cloog-backend
--enable-languages=c,c++,d,objc,go,fortran,ada
--disable-libssp
--disable-libmpx
--disable-libmudflap
--disable-libsanitizer
--enable-shared
--enable-threads
--enable-tls
--with-system-zlib
--with-linker-hash-style=gnu

this doesn't work:::

OLD

  • libtool? use slibtool
  • errors ad infinitum
    • gmp (fixed)
    • mpfr (fixed)
    • mpc (fixed)
    • binutils (fixed)
  • libtool -> slibtool symlink
  • currently dies on compiling shared objects and/in C++ ABI issues
  • this gets through a shared build:
    • LIBTOOL=slibtool CFLAGS=-fPIC CXXFLAGS=-fPIC LIBS="-L${cwsw}/binutils/current/lib/ -liberty" LDFLAGS="${LDFLAGS} -s --static" make -f ~/Makefile.arch_indep
    • but flakes out with c++/abi diffs again'
    • shared vs static vs host-shared?
    • tinkering with COMMON_CONFIG="--build=$(gcc -dumpmachine) --target=$(gcc -dumpmachine) --host=$(gcc -dumpmachine)"
    • musl-cross-make sets target, may override or ignore build/host
  • nope env LIBTOOL=slibtool CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS="${LDFLAGS//-static/}" LIBS='-liberty' make -f ~/Makefile.arch_indep
  • 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 ) ) >/tmp/musl-cross-make.out 2>&1
  • leads to c++ abi issues previously observed (https://github.com/ryanwoodsmall/musl-misc/blob/776f8211b8019e8197ae0e9dcf0b524d29b43d81/README.md)
env \
  LD_LIBRARY_PATH="$(echo ${cwsw}/{binutils,gmp,mpc,mpfr}/current/lib | tr ' ' ':')" \
  LIBTOOL=slibtool \
  CFLAGS=-fPIC \
  CXXFLAGS=-fPIC \
  LIBS=-liberty \
  LDFLAGS="${LDFLAGS//-static/}" \
  make -f ~/Makefile.arch_indep >/tmp/musl-cross-make.out 2>&1