• Suleyman Poyraz's avatar
    Toybox static derlenmesi sırasında hata. · 8c10e488
    Suleyman Poyraz yazdı
    Alakalı bir başka gönderiden tavsiyeler:
    Kaynak "https://bugs.gentoo.org/558868"
    
    ```
    The ebuild for sys-apps/toybox lacks a 'static' USE flag. Additionally, toybox cannot be statically linked against glibc.
    
    This bug is a request to add a 'static' USE flag to sys-apps/toybox, which results in a statically linked binary suitable for e.g. initramfs usage.
    
    Reproducible: Always
    
    Instructions for static build using musl:
    ---
    1. Create temp root for build ($TEMP)
    2. Build & install musl to $TEMP:
      a) ./configure --prefix=$TEMP --disable-shared
      b) make
      c) make install
    3. Symlink /usr/include/linux to $TEMP/include/linux
    4. Symlink /usr/include/asm to $TEMP/include/asm
    5. Symlink /usr/include/asm-generic to $TEMP/include/asm-generic
    6. Configure toybox (make menuconfig), or provide existing .config file
    7. Build toybox: CC="$TEMP/bin/musl-gcc" LDFLAGS="-L$TEMP/lib --static" CFLAGS="-I$TEMP/include" make
    ---
    
    Sample build script:
    ---
    DISTFILES=/usr/portage/distfiles
    INCLUDEDIR=/usr/include
    WDIR=/tmp/tb
    MUSL_VERSION=1.1.10
    TOYBOX_VERSION=0.6.0
    
    CDIR="$PWD"
    mkdir -p "$WDIR"/{root,build,build/toybox-$TOYBOX_VERSION}
    tar -C "$WDIR/build" -xf "$DISTFILES/musl-$MUSL_VERSION.tar.gz"
    tar -C "$WDIR/build/toybox-$TOYBOX_VERSION" -xf "$DISTFILES/toybox-$TOYBOX_VERSION.tar.gz"
    
    cd "$WDIR/build/musl-$MUSL_VERSION"
    ./configure --prefix="$WDIR/root" --disable-shared
    make
    make install
    
    ln -s "$INCLUDEDIR/linux" "$WDIR/root/include/"
    ln -s "$INCLUDEDIR/asm" "$WDIR/root/include/"
    ln -s "$INCLUDEDIR/asm-generic" "$WDIR/root/include"
    
    cd "$WDIR/build/toybox-$TOYBOX_VERSION"
    make menuconfig
    CC="$WDIR/root/bin/musl-gcc" CFLAGS="-I$WDIR/root/include" LDFLAGS="-L$WDIR/root/lib --static" make
    PREFIX="$WDIR/root" make install
    
    cd "$CDIR"
    ---
    ```
    Yani aynı hatayı sadece biz almamışız ve adamlar musl öneriyor derlemek için. Şimdilik issue #25 için tek yapabildiğim busybox'u static derlemek.
    8c10e488
Adı
Son kayıt (commit)
Son güncelleme
..
admin Loading commit data...
archive Loading commit data...
crypt Loading commit data...
environment Loading commit data...
misc Loading commit data...
shell Loading commit data...
component.xml Loading commit data...