update openssl to latest stable version
[openadk.git] / scripts / gcc-bisect.sh
blob1da4dd5d620e9d6f41d674c3fb0ddc9f56a4a5db
1 #!/bin/sh
2 rm -rf host_x86_64-linux-gnu target_sparc_glibc
3 rm -rf gcc-*
4 mkdir host_x86_64-linux-gnu
5 mkdir target_sparc_glibc
7 tar xvf binutils-2.24.tar.bz2
8 cd binutils-2.24
9 ./configure \
10 --prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
11 --target=sparc-openadk-linux-gnu \
12 --with-sysroot=/home/wbx/smoke/target_sparc_glibc \
13 --disable-dependency-tracking \
14 --disable-libtool-lock \
15 --disable-nls \
16 --disable-werror \
17 --disable-plugins \
18 --disable-libssp --disable-multilib
19 make -j4 all
20 make install
21 cd ..
23 tar xvf gmp-5.1.3.tar.xz
24 cd gmp-5.1.3
25 cp configfsf.guess config.guess
26 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/usr/bin:$PATH" \
27 ./configure \
28 --prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
29 --with-pic \
30 --disable-shared \
31 --enable-static
32 make -j4 all
33 make install
34 cd ..
36 tar xvf mpfr-3.1.2.tar.xz
37 cd mpfr-3.1.2
38 ./configure \
39 --prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
40 --with-gmp-build=/home/wbx/smoke/gmp-5.1.3 \
41 --disable-shared \
42 --enable-static
43 make -j4 all
44 make install
45 cd ..
47 tar xvf mpc-0.8.2.tar.gz
48 cd mpc-0.8.2
49 ./configure \
50 --prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
51 --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu \
52 --disable-shared \
53 --enable-static
54 make -j4 all
55 make install
56 make install
57 cd ..
59 tar xvf libelf-0.8.13.tar.gz
60 cd libelf-0.8.13
61 ./configure \
62 --prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
63 --disable-nls \
64 --disable-shared \
65 --enable-static
66 make -j4 all
67 make install
68 cd ..
70 rm -rf host_x86_64-linux-gnu/sparc-openadk-linux-gnu/{lib,sys-include}
71 cd host_x86_64-linux-gnu/sparc-openadk-linux-gnu/
72 ln -sf ../../target_sparc_glibc/usr/include sys-include
73 ln -sf ../../target_sparc_glibc/lib lib
74 cd -
76 mkdir gcc-minimal
77 cd gcc-minimal
78 CFLAGS="-O0 -g0" \
79 CXXFLAGS="-O0 -g0" \
80 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" \
81 ../gcc/configure \
82 --prefix=/home/wbx/smoke/host_x86_64-linux-gnu --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
83 --enable-languages=c \
84 --disable-multilib \
85 --disable-lto \
86 --disable-libssp \
87 --disable-shared \
88 --without-headers
89 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make -j4 all-gcc
90 if [ $? -ne 0 ];then
91 echo failed
92 exit
94 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install-gcc
95 if [ $? -ne 0 ];then
96 echo failed
97 exit
99 cd ..
101 cd linux-3.13.6
102 make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' INSTALL_HDR_PATH=/home/wbx/smoke/target_sparc_glibc/usr headers_install
103 cd ..
105 cd glibc-2.19-header
106 libc_cv_forced_unwind=yes \
107 libc_cv_cc_with_libunwind=yes \
108 libc_cv_c_cleanup=yes \
109 libc_cv_gnu99_inline=yes \
110 libc_cv_initfini_array=yes \
111 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" ../glibc-2.19/configure \
112 --prefix=/home/wbx/smoke/target_sparc_glibc/usr \
113 --with-sysroot=/home/wbx/smoke/target_sparc_glibc \
114 --build=x86_64-linux-gnu --host=sparc-openadk-linux-gnu --with-headers=/home/wbx/smoke/target_sparc_glibc/usr/include --disable-sanity-checks --disable-nls --without-cvs --disable-profile --disable-debug --without-gd --disable-nscd --with-__thread --with-tls --enable-kernel="2.6.32" --enable-add-ons
115 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make cross-compiling=yes PARALLELMFLAGS="-j1" install-headers
116 if [ $? -ne 0 ];then
117 echo failed
118 exit
120 cd ..
121 touch target_sparc_glibc/usr/include/gnu/stubs.h
123 mkdir gcc-initial
124 cd gcc-initial
125 CFLAGS="-O0 -g0" \
126 CXXFLAGS="-O0 -g0" \
127 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" ../gcc/configure \
128 --prefix=/home/wbx/smoke/host_x86_64-linux-gnu --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
129 --disable-biarch --disable-multilib --enable-libssp --enable-lto \
130 --enable-languages=c \
131 --disable-shared \
132 --disable-threads \
133 --with-sysroot=/home/wbx/smoke/target_sparc_glibc
134 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all-gcc
135 if [ $? -ne 0 ];then
136 echo failed
137 exit
139 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all-target-libgcc
140 if [ $? -ne 0 ];then
141 echo failed
142 exit
144 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install-gcc install-target-libgcc
145 if [ $? -ne 0 ];then
146 echo failed
147 exit
149 cd ..
151 cd glibc-2.19-final
152 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" SHELL='/bin/bash' BUILD_CC=cc CFLAGS="-mcpu=v8 -fwrapv -fno-ident -fomit-frame-pointer -O2 -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables -g3" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" CXX="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-g++" AR="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-ar" RANLIB="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-ranlib" libc_cv_forced_unwind=yes libc_cv_cc_with_libunwind=yes libc_cv_c_cleanup=yes libc_cv_gnu99_inline=yes libc_cv_initfini_array=yes \
153 ../glibc-2.19/configure \
154 --prefix=/usr \
155 --enable-shared \
156 --enable-stackguard-randomization \
157 --build=x86_64-linux-gnu --host=sparc-openadk-linux-gnu --with-headers=/home/wbx/smoke/target_sparc_glibc/usr/include --disable-sanity-checks --disable-nls --without-cvs --disable-profile --disable-debug --without-gd --disable-nscd --with-__thread --with-tls --enable-kernel="2.6.32" --enable-add-ons
158 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all
159 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install_root=/home/wbx/smoke/target_sparc_glibc install
160 if [ $? -ne 0 ];then
161 echo failed
162 exit
164 cd ..
166 mkdir gcc-final
167 cd gcc-final
168 ../gcc/configure \
169 --prefix=/home/wbx/smoke/host_x86_64-linux-gnu --with-bugurl="http://www.openadk.org/" --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
170 --disable-biarch --disable-multilib --enable-libssp --enable-lto \
171 --enable-languages=c,c++ \
172 --with-build-sysroot='${prefix}/../target_sparc_glibc' \
173 --with-sysroot='${prefix}/../target_sparc_glibc' \
174 --enable-shared
175 make -j4 all
176 if [ $? -ne 0 ];then
177 echo failed
178 exit
180 make install
181 if [ $? -ne 0 ];then
182 echo failed
183 exit
185 cd ..
187 cd linux-3.13.6/
188 cat > mini.config <<EOF
189 CONFIG_SPARC=y
190 CONFIG_SPARC32=y
191 CONFIG_SBUS=y
192 CONFIG_SBUSCHAR=y
193 CONFIG_PCI=y
194 CONFIG_PCI_SYSCALL=y
195 CONFIG_PCIC_PCI=y
196 CONFIG_OF=y
197 CONFIG_NET_VENDOR_AMD=y
198 CONFIG_SUNLANCE=y
199 CONFIG_SERIAL_CONSOLE=y
200 CONFIG_SERIAL_SUNCORE=y
201 CONFIG_SERIAL_SUNZILOG=y
202 CONFIG_SERIAL_SUNZILOG_CONSOLE=y
205 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' KCONFIG_ALLCONFIG=mini.config allnoconfig
206 PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' -j4 zImage