Begin work on statically linked core.

This commit is contained in:
Mid Favila 2022-08-23 16:40:30 -04:00
parent a1c8d35f93
commit e10c09cb3b
32 changed files with 119 additions and 37 deletions

View File

@ -1 +1,6 @@
-get python to build without GNU-compatible grep?
-get everything under core/ to build statically?
-anything that relies on libz is an issue, it seems
-binutils is an issue
-so is eudev
-flex

View File

@ -68,6 +68,10 @@ microarchitecture using the following CFLAGS (assuming GCC):
-Wl,--hash-style=gnu -Wl,-pie
Linker arguments
-fno-lto
Prevent LTO. You can discard this if and only if you are not using
a statically-linked gold or bfd as your primary linker.
A new subdir, bin, containing binaries built with the above CFLAGS (sans native)
will be added in the future. I, however, encourage you to build from source if
possible.

View File

@ -1,5 +1,7 @@
#!/bin/sh -e
CFLAGS="$CFLAGS -static "
./configure \
--prefix=/usr \
--disable-nls \

View File

@ -1,5 +1,8 @@
#!/bin/sh -e
CFLAGS="$CFLAGS -static -fPIC"
LDFLAGS="$LDFLAGS -static -fPIC -fno-lto -fno-use-linker-plugin -static -fPIC"
cat > makeinfo <<EOF
#!/bin/sh
printf 'makeinfo (GNU texinfo) 5.2\n'
@ -15,15 +18,17 @@ export PATH=$PATH:$PWD
--enable-deterministic-archives \
--enable-gold \
--enable-ld=default \
--enable-plugins \
--disable-multilib \
--with-static-standard-libraries \
--disable-werror \
--disable-gdb \
--disable-nls \
--disable-readline \
--disable-gprof \
--with-mmap \
--with-system-zlib
--with-system-zlib \
--disable-lto \
--disable-plugins
make configure-host
make tooldir=/usr

View File

@ -1,5 +1,8 @@
#!/bin/sh -e
CFLAGS="$CFLAGS -static"
LDFLAGS="$LDFLAGS -static -fPIC -fno-lto -fno-use-linker-plugin -static"
# Parallel builds seem to break bison
MAKEFLAGS=-j1

View File

@ -1,20 +1,34 @@
#!/bin/sh -e
make CC="${CC:-cc} $CFLAGS -fPIC $LDFLAGS" -f Makefile-libbz2_so
make CC="${CC:-cc} $CFLAGS -fPIC $LDFLAGS" bzip2recover libbz2.a
CFLAGS="$CFLAGS -static -fPIC -fno-lto -fno-use-linker-plugin"
LDFLAGS="$LDFLAGS -static -fPIC -fno-lto -fno-use-linker-plugin"
for bin in bzip2-shared bzdiff bzgrep bzip2recover bzmore; do
install -Dm755 "$bin" "$1/usr/bin/${bin%%-shared}"
sed -i 's/CFLAGS=.*//' Makefile
sed -i 's/$(CFLAGS)/$(BIGFILES) $(LDFLAGS) $(CFLAGS)/g' Makefile
sed -i 's^$(PREFIX)^/$(DESTDIR)/$(PREFIX)^g' Makefile
sed -i s'^$(CC)^$(CC) $(LDFLAGS) $(CFLAGS)^g' Makefile-libbz2_so
sed -i 's/CFLAGS=.*//' Makefile-libbz2_so
make
# this is a temporary fix until we figure out what causes the shared object build to break
CFLAGS='-O2 -w -pipe -fPIC'
LDFLAGS='-fno-use-linker-plugin -fPIC'
make -f Makefile-libbz2_so
ln -sf bzip2 bunzip2
ln -sf bzip2 bzcat
for lib in libbz2.so libbz2.so.1 libbz2.so.1.0
do
ln -sf libbz2.so.1.0.8 $lib
done
make DESTDIR="$1" PREFIX=/usr install
install -Dm755 libbz2.so.1.0.8 "$1/usr/lib/libbz2.so.1.0.8"
install -Dm644 libbz2.a "$1/usr/lib/libbz2.a"
install -Dm644 bzip2.1 "$1/usr/share/man/man1/bzip2.1"
install -Dm644 bzlib.h "$1/usr/include/bzlib.h"
for lib in libbz2.so libbz2.so.1 libbz2.so.1.0; do
for lib in libbz2.so libbz2.so.1 libbz2.so.1.0
do
ln -sf libbz2.so.1.0.8 "$1/usr/lib/$lib"
done
ln -sf bzip2 "$1/usr/bin/bunzip2"
ln -sf bzip2 "$1/usr/bin/bzcat"
ls

View File

@ -5,8 +5,9 @@
--sysconfdir=/etc \
--sbindir=/usr/bin \
--bindir=/usr/bin \
--enable-fast-install \
--enable-static \
--enable-hwdb \
--enable-blkid=auto \
--disable-introspection
make

View File

@ -1,7 +1,9 @@
#!/bin/sh -e
./configure \
--prefix=/usr
--prefix=/usr \
--enable-shared \
--enable-static
make
make DESTDIR="$1" install

View File

@ -6,6 +6,14 @@
ac_cv_func_realloc_0_nonnull=yes
make
# We need to work around flex's makefile not working with static directives.
obj=flex-"buf.o flex-ccl.o flex-dfa.o flex-ecs.o flex-filter.o flex-gen.o flex-main.o flex-misc.o flex-nfa.o flex-options.o flex-parse.o flex-regex.o flex-scanflags.o flex-scanopt.o flex-skel.o flex-sym.o flex-tables.o flex-tables_shared.o flex-tblcmp.o flex-yylex.o flex-stage1scan.o"
cd src/
$CC $CFLAGS $LDFLAGS -o flex $obj -lintl -lm
cd ..
make DESTDIR="$1" install
ln -s flex "$1/usr/bin/lex"

View File

@ -2,9 +2,7 @@
./configure \
--prefix=/usr \
--disable-nls \
--disable-generated-tests \
--enable-memcheck
make
make DESTDIR="$1" install
install -Dm755 bin/bc "$1/usr/bin/bc"

View File

@ -1,4 +1,9 @@
#!/bin/sh -e
CFLAGS="$CFLAGS -static -fPIC"
CXXFLAGS=$CFLAGS
LDFLAGS="$LDFLAGS -static -fPIC -fno-lto -fno-use-linker-plugin -static -fPIC"
cd gcc
patch -p1 < ../musl-jit.patch
cd ../
@ -71,10 +76,3 @@ ln -s gcc "$1/usr/bin/cc"
# POSIX compliance.
install -Dm755 ../c99 "$1/usr/bin/c99"
# Symlink for LTO.
#{
# mkdir -p "$1/usr/lib/bfd-plugins"
#
# ln -s "/usr/lib/gcc/x86_64-pc-linux-musl/$2/liblto_plugin.so" \
# "$1/usr/lib/bfd-plugins/liblto_plugin.so"
#}

View File

@ -5,6 +5,7 @@ export CFLAGS="$CFLAGS -fPIC"
./configure \
--prefix=/usr \
--libdir=/usr/lib \
--enable-static
make
make DESTDIR="$1" install

View File

@ -12,6 +12,7 @@ SBINDIR=/usr/bin
CC="${CC:-cc}"
CFLAGS="$CFLAGS"
LN="ln -sf"
STATIC="-static -fno-lto -fno-use-linker-plugin"
EOF
./configure

View File

@ -1,4 +1,4 @@
#!/bin/sh -e
make CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
make CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS -static -fPIC -fno-lto -fno-use-linker-plugin"
make DESTDIR="$1" PREFIX=/usr install

View File

@ -2,7 +2,7 @@
export BUILD_ZLIB=0
export BUILD_BZIP2=0
export LDFLAGS="$LDFLAGS -pthread"
export LDFLAGS="$LDFLAGS -static -fPIC -fno-lto -fno-use-linker-plugin -pthread"
export CFLAGS="$CFLAGS -DNO_POSIX_2008_LOCALE -D_GNU_SOURCE"
./Configure \

View File

@ -3,7 +3,7 @@
# Install our pre-configured Makefile.
cp makefile.mid ./Makefile
make LDFLAGS="$LDFLAGS -static"
make LDFLAGS="$LDFLAGS -static -fPIC -fno-lto -fno-use-linker-plugin -static"
make DESTDIR="$1" PREFIX=/usr install
echo '#!/bin/sh

View File

@ -1,5 +1,9 @@
#!/bin/sh -e
CFLAGS="$(echo $CFLAGS|sed 's/-static//g')"
LDFLAGS="$(echo $LDFLAGS|sed 's/-static//g')"
./configure \
--prefix=/usr \
--localstatedir=/var \
@ -12,21 +16,25 @@
--without-python \
--without-systemd \
--disable-all-programs \
--enable-static-programs=fdisk,mount,umount \
--enable-static-programs=fdisk,mount,umount,ul,fsck,uuidgen,fstrim \
--enable-fdisks \
--enable-mount \
--enable-umount \
--enable-fsck \
--enable-uuidgen \
--enable-fstrim \
--enable-libuuid \
--enable-libblkid \
--enable-libfdisk \
--enable-libsmartcols \
--enable-fsck \
--enable-uuidgen \
--enable-fstrim\
--enable-libmount \
--enable-fdisks \
--enable-mount \
--enable-getopt \
--enable-ul \
--disable-bash-completion \
--disable-colors-default \
--disable-nls
--enable-shared=libblkid \
--disable-nls \
--prefix=/usr --disable-rpath --without-udev --without-python --without-systemd --disable-all-programs --enable-static-programs=fdisk,mount,umount,ul,fsck,uuiden,fstrim --enable-libuuid --enable-libblkid --enable-libfdisk --enable-libsmartcols --enable-libmount --disable-bash-completion --disable-colors-default --enable-shared
make

View File

@ -0,0 +1,5 @@
#!/bin/sh -e
cd src
make PREFIX="/usr/" DESTDIR="$1" install

View File

@ -0,0 +1,2 @@
git+https://git.sdf.org/midfavila/mp-utils

View File

@ -0,0 +1 @@
git 1

View File

@ -0,0 +1,6 @@
#!/bin/sh -e
cd src
make
make DESTDIR="$1" PREFIX="/usr" install

View File

@ -0,0 +1 @@
077f0ee97a578523df1d06a50586bc2dd8e5edde878db7c05f80521afa57a558

View File

@ -0,0 +1,2 @@
libXt
motif

View File

@ -0,0 +1 @@
git+https://git.sdf.org/midfavila/Nebula

View File

@ -0,0 +1 @@
0.5 1

View File

@ -3,7 +3,10 @@
./configure \
--prefix=/usr \
--cc="${CC:-cc}" \
--config-musl
--config-musl \
--enable-static
sed -i 's/-DC2STR/${CFLAGS} ${LDFLAGS} -DC2STR/g' Makefile
make
make DESTDIR="$1" install

View File

@ -1,4 +1,4 @@
5d81f24fdc7cdb000d6ed5762459eda842b0b1f43fdad3a4be5e8edd5c8f7079
34ba2b78b640f8ff1eb8137bb87a24ab5452eddc0b42fa908e4d5a1a898cfdac
4bf732b952a121baedc79b07eb54ba6f37a146e8c497be73fb71ca34aeb90860
f0611136bee505811e9ca11ca7ac188ef5323a8e2ef19cffd3edb3cf08fd791e
578146940874f8884f5ec69da948538dbd428de9405717ca24e6d5d80c7eb381

View File

@ -1,5 +1,5 @@
https://fossies.org/linux/www/palemoon-29.4.4.source.tar.xz
https://repo.palemoon.org/MoonchildProductions/UXP/archive/RELBASE_20210608.tar.gz platform/
https://fossies.org/linux/www/palemoon-29.4.6.source.tar.xz
https://repo.palemoon.org/MoonchildProductions/UXP/archive/RELBASE_20210608.tar.gz
https://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz autoconf2.13/
files/mozconfig.in
patches/gcc11-fix.patch

View File

@ -0,0 +1,7 @@
#!/bin/sh -e
./configure \
--prefix=/usr
make
make DESTDIR="$1" install

View File

@ -0,0 +1 @@
077f0ee97a578523df1d06a50586bc2dd8e5edde878db7c05f80521afa57a558

View File

@ -0,0 +1 @@
https://downloads.sourceforge.net/project/nebula-irc/nebula-irc/0.5/nebula-0.5.tar.gz

View File

@ -0,0 +1 @@
0.5 1