File x86/cross-compiler.sh added (mode: 100755) (index 0000000..035350e) |
|
1 |
|
#!/bin/sh |
|
2 |
|
|
|
3 |
|
# You must use an ultra complex ISO c++98 compiler to compile this C compiler. |
|
4 |
|
# This is so toxic. |
|
5 |
|
|
|
6 |
|
set -e |
|
7 |
|
top_dir=$(readlink -f $(dirname $0)) |
|
8 |
|
top_src_dir=/root/nyanlinux/src |
|
9 |
|
top_build_dir=/run/x86/build |
|
10 |
|
install_dir=/run/x86/cross-compiler |
|
11 |
|
x86_system_header_dir=/opt/steam/x86/devel/include |
|
12 |
|
x86_system_lib_dir=/opt/steam/x86/devel/lib |
|
13 |
|
jobs_n=11 |
|
14 |
|
|
|
15 |
|
printf "TOP_DIR=$top_dir\n" |
|
16 |
|
printf "TOP_SRC_DIR=$top_src_dir\n" |
|
17 |
|
printf "TOP_BUILD_DIR=$top_build_dir\n" |
|
18 |
|
printf "INSTALL_DIR=$install_dir\n" |
|
19 |
|
printf "NATIVE_SYSTEM_HEADER_DIR=$native_system_header_dir\n" |
|
20 |
|
printf "USING $jobs_n PARALLEL JOBS" |
|
21 |
|
. $top_dir/cross-compiler/gmp.sh |
|
22 |
|
. $top_dir/cross-compiler/mpfr.sh |
|
23 |
|
. $top_dir/cross-compiler/mpc.sh |
|
24 |
|
. $top_dir/cross-compiler/binutils.sh |
|
25 |
|
. $top_dir/cross-compiler/gcc.sh |
File x86/cross-compiler/binutils.sh added (mode: 100644) (index 0000000..660a580) |
|
1 |
|
printf 'BUILDING CROSS BINUTILS\n' |
|
2 |
|
mkdir -p $top_build_dir |
|
3 |
|
cp -f $top_src_dir/binutils-2.36.1.tar.xz $top_build_dir |
|
4 |
|
rm -Rf $top_build_dir/binutils-2.36.1 |
|
5 |
|
cd $top_build_dir |
|
6 |
|
tar xf binutils-2.36.1.tar.xz |
|
7 |
|
|
|
8 |
|
# usual autotools diareha, c++ crap |
|
9 |
|
sed -i -e '12367,12488 d' ./binutils-2.36.1/ld/configure |
|
10 |
|
|
|
11 |
|
rm -Rf $top_build_dir/binutils |
|
12 |
|
mkdir -p $top_build_dir/binutils |
|
13 |
|
cd $top_build_dir/binutils |
|
14 |
|
export CC='gcc -B/nyan/glibc/current/lib -idirafter /nyan/glibc/current/include -idirafter /nyan/linux-headers/current/include -static-libgcc' |
|
15 |
|
export CFLAGS='-O2 -fPIC -pipe' |
|
16 |
|
$top_build_dir/binutils-2.36.1/configure \ |
|
17 |
|
--prefix=$install_dir \ |
|
18 |
|
--target=i686-pc-linux-gnu \ |
|
19 |
|
--disable-shared \ |
|
20 |
|
--disable-host-shared \ |
|
21 |
|
--enable-gold=no \ |
|
22 |
|
--disable-checks \ |
|
23 |
|
--with-mmap \ |
|
24 |
|
--disable-libctf \ |
|
25 |
|
--disable-nls |
|
26 |
|
unset CC |
|
27 |
|
unset CLFLAGS |
|
28 |
|
make -j $jobs_n |
|
29 |
|
make install |
|
30 |
|
cd $top_build_dir |
|
31 |
|
rm -Rf binutils-2.36.1.tar.xz binutils-2.36.1 binutils |
File x86/cross-compiler/gcc.sh added (mode: 100644) (index 0000000..545bfa1) |
|
1 |
|
printf 'BUILDING CROSS GCC\n' |
|
2 |
|
mkdir -p $top_build_dir |
|
3 |
|
cp -f $top_src_dir/gcc-10.3.0.tar.xz $top_build_dir |
|
4 |
|
rm -Rf $top_build_dir/gcc-10.3.0 |
|
5 |
|
cd $top_build_dir |
|
6 |
|
tar xf gcc-10.3.0.tar.xz |
|
7 |
|
|
|
8 |
|
rm -Rf $top_build_dir/gcc |
|
9 |
|
mkdir -p $top_build_dir/gcc |
|
10 |
|
cd $top_build_dir/gcc |
|
11 |
|
export CC='gcc -B/nyan/glibc/current/lib -idirafter /nyan/glibc/current/include -idirafter /nyan/linux-headers/current/include -static-libgcc' |
|
12 |
|
export CFLAGS='-O2 -fPIC -pipe' |
|
13 |
|
export CXX='g++ -B/nyan/glibc/current/lib -idirafter /nyan/glibc/current/include -idirafter /nyan/linux-headers/current/include -static-libgcc -static-libstdc++' |
|
14 |
|
export CXXFLAGS='-O2 -fPIC -pipe' |
|
15 |
|
export "CFLAGS_FOR_TARGET=-O2 -pipe -fPIC -B$x86_system_lib_dir -L$x86_system_lib_dir -idirafter $x86_system_header_dir -idirafter /nyan/linux-headers/current/include" |
|
16 |
|
export "CXXFLAGS_FOR_TARGET=-O2 -pipe -fPIC -B$x86_system_lib_dir -L$x86_system_lib_dir -idirafter $x86_system_header_dir -idirafter /nyan/linux-headers/current/include" |
|
17 |
|
$top_build_dir/gcc-10.3.0/configure \ |
|
18 |
|
--prefix=$install_dir \ |
|
19 |
|
--target=i686-pc-linux-gnu \ |
|
20 |
|
--disable-libquadmath \ |
|
21 |
|
--disable-libada \ |
|
22 |
|
--disable-libssp \ |
|
23 |
|
--disable-bootstrap \ |
|
24 |
|
--disable-host-shared \ |
|
25 |
|
--disable-vtable-verify \ |
|
26 |
|
--with-gpm=$install_dir \ |
|
27 |
|
--with-mpfr=$install_dir \ |
|
28 |
|
--with-mpc=$install_dir \ |
|
29 |
|
--with-static-standard-libraries \ |
|
30 |
|
--disable-nls \ |
|
31 |
|
\ |
|
32 |
|
--enable-decimal-float=no \ |
|
33 |
|
--disable-fixed-point \ |
|
34 |
|
--enable-threads=posix \ |
|
35 |
|
--enable-tls \ |
|
36 |
|
--disable-analyzer \ |
|
37 |
|
--disable-gcov \ |
|
38 |
|
--enable-languages=c,c++ \ |
|
39 |
|
--disable-libssp \ |
|
40 |
|
--disable-default-ssp \ |
|
41 |
|
--enable-link-mutex \ |
|
42 |
|
--disable-host-shared \ |
|
43 |
|
--with-native-system-header-dir=$x86_system_header_dir \ |
|
44 |
|
--enable-explicit-exception-frame-registration |
|
45 |
|
unset CC |
|
46 |
|
unset CLFLAGS |
|
47 |
|
unset CXX |
|
48 |
|
unset CXXFLAGS |
|
49 |
|
# may need to set sysroot to /... |
|
50 |
|
make -j $jobs_n all-gcc |
|
51 |
|
make install-gcc |
|
52 |
|
|
|
53 |
|
make -j $jobs_n all-target-libgcc |
|
54 |
|
make install-target-libgcc |
|
55 |
|
|
|
56 |
|
make -j $jobs_n all-target-libstdc++-v3 |
|
57 |
|
make install-target-libstdc++-v3 |
|
58 |
|
|
|
59 |
|
cd $top_build_dir |
|
60 |
|
rm -Rf gcc-10.3.0.tar.xz gcc-10.3.0 gcc |
File x86/cross-compiler/gmp.sh added (mode: 100644) (index 0000000..54ad879) |
|
1 |
|
printf 'BUILDING GMP\n' |
|
2 |
|
mkdir -p $top_build_dir |
|
3 |
|
cp -f $top_src_dir/gmp-6.2.0.tar.xz $top_build_dir |
|
4 |
|
rm -Rf $top_build_dir/gmp-6.2.0 |
|
5 |
|
cd $top_build_dir |
|
6 |
|
tar xf gmp-6.2.0.tar.xz |
|
7 |
|
|
|
8 |
|
rm -Rf $top_build_dir/gmp |
|
9 |
|
mkdir -p $top_build_dir/gmp |
|
10 |
|
cd $top_build_dir/gmp |
|
11 |
|
export CC='gcc -B/nyan/glibc/current/lib -idirafter /nyan/glibc/current/include -idirafter /nyan/linux-headers/current/include -static-libgcc' |
|
12 |
|
export CFLAGS='-O2 -fPIC -pipe' |
|
13 |
|
$top_build_dir/gmp-6.2.0/configure \ |
|
14 |
|
--prefix=$install_dir \ |
|
15 |
|
--disable-shared |
|
16 |
|
unset CC |
|
17 |
|
unset CLFLAGS |
|
18 |
|
make -j $jobs_n |
|
19 |
|
make install |
|
20 |
|
cd $top_build_dir |
|
21 |
|
rm -Rf gmp-6.2.0.tar.xz gmp-6.2.0 gmp |
File x86/cross-compiler/mpc.sh added (mode: 100644) (index 0000000..70a89a7) |
|
1 |
|
printf 'BUILDING MPC\n' |
|
2 |
|
mkdir -p $top_build_dir |
|
3 |
|
cp -f $top_src_dir/mpc-1.1.0.tar.gz $top_build_dir |
|
4 |
|
rm -Rf $top_build_dir/mpc-1.1.0 |
|
5 |
|
cd $top_build_dir |
|
6 |
|
tar xf mpc-1.1.0.tar.gz |
|
7 |
|
|
|
8 |
|
rm -Rf $top_build_dir/mpc |
|
9 |
|
mkdir -p $top_build_dir/mpc |
|
10 |
|
cd $top_build_dir/mpc |
|
11 |
|
export CC='gcc -B/nyan/glibc/current/lib -idirafter /nyan/glibc/current/include -idirafter /nyan/linux-headers/current/include -static-libgcc' |
|
12 |
|
export CFLAGS='-O2 -fPIC -pipe' |
|
13 |
|
$top_build_dir/mpc-1.1.0/configure \ |
|
14 |
|
--prefix=$install_dir \ |
|
15 |
|
--with-gmp=$install_dir \ |
|
16 |
|
--with-mpfr=$install_dir \ |
|
17 |
|
--disable-shared |
|
18 |
|
unset CC |
|
19 |
|
unset CLFLAGS |
|
20 |
|
make -j $jobs_n |
|
21 |
|
make install |
|
22 |
|
cd $top_build_dir |
|
23 |
|
rm -Rf mpc-1.1.0.tar.gz mpc-1.1.0 mpc |
File x86/cross-compiler/mpfr.sh added (mode: 100644) (index 0000000..dcd384d) |
|
1 |
|
printf 'BUILDING MPFR\n' |
|
2 |
|
mkdir -p $top_build_dir |
|
3 |
|
cp -f $top_src_dir/mpfr-4.1.0.tar.xz $top_build_dir |
|
4 |
|
rm -Rf $top_build_dir/mpfr-4.1.0 |
|
5 |
|
cd $top_build_dir |
|
6 |
|
tar xf mpfr-4.1.0.tar.xz |
|
7 |
|
|
|
8 |
|
rm -Rf $top_build_dir/mpfr |
|
9 |
|
mkdir -p $top_build_dir/mpfr |
|
10 |
|
cd $top_build_dir/mpfr |
|
11 |
|
export CC='gcc -B/nyan/glibc/current/lib -idirafter /nyan/glibc/current/include -idirafter /nyan/linux-headers/current/include -static-libgcc' |
|
12 |
|
export CFLAGS='-O2 -fPIC -pipe' |
|
13 |
|
$top_build_dir/mpfr-4.1.0/configure \ |
|
14 |
|
--prefix=$install_dir \ |
|
15 |
|
--with-gmp=$install_dir \ |
|
16 |
|
--disable-shared |
|
17 |
|
unset CC |
|
18 |
|
unset CLFLAGS |
|
19 |
|
make -j $jobs_n |
|
20 |
|
make install |
|
21 |
|
cd $top_build_dir |
|
22 |
|
rm -Rf mpfr-4.1.0.tar.xz mpfr-4.1.0 mpfr |