pikhq / bootstrap-linux

A Linux system which is just barely capable of building itself.
123 stars 14 forks source link

[SOLVED] libgcc_s.so.1 needed by as #8

Closed 8l closed 11 years ago

8l commented 11 years ago

Hi, i want to use newer gcc, so i had tried cross compiler from musl-cross. all build succeed, but after bootstrap-linux booted, native gcc compile failed. [btw, older native musl-gcc version(4.2.1) works fine.]

the error message: gcc hello.c libgcc_s.so.1 not found needed by as

musl-cross configuration: https://github.com/GregorR/musl-cross CC_BASE_PREFIX=/opt/cross MAKEFLAGS=-j8 BINUTILS_VERSION=2.23.2 GCC_VERSION=4.8.0 MUSL_VERSION=0.9.10 GCC_BUILTIN_PREREQS=yes

host compiler version: gcc-4.8.0.tar.bz2 gmp-5.1.1.tar.xz mpc-1.0.1.tar.gz mpfr-3.1.2.tar.xz

musl version : musl-0.9.10.tar.gz (git version compressed as 0.9.10)

linux version: linux-3.8.8.tar.bz2

rofl0r commented 11 years ago
i fixed in in sabotage by doing s/libgcc_s.so.1/libgcc_eh.a/ in the specfile it might be even better/safer to replace libgcc_s.so.1 with a linker script for libgcc_eh.a :)
rofl0r commented 11 years ago

if you would stay longer than 15 minutes in the chat, one could respond

8l commented 11 years ago

vi bootstrap-linux/build-scripts/gcc-4.8.0

url=http://ftp.gnu.org/gnu/gcc/gcc-$version/gcc-$version.tar.bz2 patches=gcc-4.8.0-musl.diff

config_options="--build=$A-linux --enable-languages=c,c++" config_options="$config_options --disable-libmudflap --disable-shared --disable-nls" config_options="$config_options --disable-libgomp --with-newlib"

prep() { for x in $patches;do patch -p1 <"$patchdir/$x" done

    sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in

    for i in strsignal putenv random setenv strstr strtod strtol strtoul;do
            culprit=libiberty/$i.c
            rm $culprit
            touch $culprit
    done

}

build() { make all-gcc make all-target-libgcc }

install() { make install-gcc DESTDIR="$tmp" make install-target-libgcc DESTDIR="$tmp" }

stage() { rm -rf "$tmp"/lib/gcc/$A-linux-musl/$version/install-tools rm -rf "$tmp"/libexec/gcc/$A-linux-musl/$version/install-tools rm -rf "$tmp"/man "$tmp"/info }

Thanks! it seems to be solved, modify musl-cross specs file did trick. :-)

/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc -dumpspecs > /opt/cross/x86_64-linux-musl/lib/gcc/x86_64-linux-musl/4.8.0/specs

... *libgcc: %{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed -lgcc_eh --no-as-needed}%{shared-libgcc:-lgcc_eh%{!shared: -lgcc}}}} ...