@@ -42,18 +42,13 @@ declare -r gdb_directory='/tmp/gdb'
4242declare -r nz_tarball=' /tmp/nz.tar.xz'
4343declare nz_directory=" "
4444
45- declare -r profile_sampling_directory=' /tmp/profile-sampling'
46- declare -r profile_guided_directory=' /tmp/profile-guided'
47-
4845declare -r zstd_tarball=' /tmp/zstd.tar.gz'
4946declare -r zstd_directory=' /tmp/zstd-dev'
5047
5148declare -r pieflags=' -fPIE'
5249declare -r ccflags=' -w -O2'
5350declare -r linkflags=' -Xlinker -s'
5451
55- declare lto_partition=' none'
56-
5752declare -r max_jobs=' 40'
5853
5954declare -r sysroot_tarball=' /tmp/sysroot.tar.xz'
@@ -137,14 +132,14 @@ declare -ra deprecated_targets=(
137132 ' sparc-unknown-linux-gnu'
138133 ' alpha-unknown-linux-gnu'
139134 ' hppa-unknown-linux-gnu'
140- ' arm-unknown-linux-gnueabi'
141135)
142136
143137declare -ra targets=(
144138 ' x86_64-unknown-linux-gnu'
145- # 'aarch64-unknown-linux-gnu'
146- # 'arm-unknown-linux-gnueabihf'
147- # 'i386-unknown-linux-gnu'
139+ ' aarch64-unknown-linux-gnu'
140+ ' arm-unknown-linux-gnueabi'
141+ ' arm-unknown-linux-gnueabihf'
142+ ' i386-unknown-linux-gnu'
148143)
149144
150145declare -r PKG_CONFIG_PATH=" ${toolchain_directory} /lib/pkgconfig"
@@ -189,34 +184,6 @@ declare -r \
189184 build_type \
190185 is_native
191186
192- declare -r profiling_generate=" -fprofile-generate=${profile_sampling_directory} -fprofile-dir=${profile_sampling_directory} -fprofile-update=atomic"
193- declare -r profiling_generate_link=" -fprofile-generate"
194-
195- declare -r profiling_use=" -fprofile-use=${profile_guided_directory} -fprofile-dir=${profile_guided_directory} "
196-
197- if (( is_native )) ; then
198- declare -r profiling_cflags=" ${profiling_generate} "
199- declare -r profiling_ldflags=" ${profiling_generate_link} "
200- elif [ " ${build_type} " = ' x86_64-unknown-linux-gnu' ]; then
201- declare -r profiling_cflags=" ${profiling_use} "
202- declare -r profiling_ldflags=' '
203- else
204- declare -r profiling_cflags=' '
205- declare -r profiling_ldflags=' '
206- fi
207-
208- if [[ " ${build_type} " = ' arm' * ]]; then
209- lto_partition=' balanced'
210- fi
211-
212- if [[ " ${build_type} " = * ' openbsd' ]]; then
213- declare -r ltoflags=' '
214- declare -r ltolinkflags=' '
215- else
216- declare -r ltoflags=" -flto=auto -fno-fat-lto-objects -flto-partition=${lto_partition} -flto-compression-level=0 -fdevirtualize-at-ltrans -fuse-linker-plugin"
217- declare -r ltolinkflags=' -flto'
218- fi
219-
220187if ! [ -f " ${gmp_tarball} " ]; then
221188 curl \
222189 --url ' https://mirrors.kernel.org/gnu/gmp/gmp-6.3.0.tar.xz' \
@@ -395,9 +362,9 @@ rm --force --recursive ./*
395362 --prefix=" ${toolchain_directory} " \
396363 --enable-shared \
397364 --disable-static \
398- CFLAGS=" ${ccflags} ${ltoflags} " \
399- CXXFLAGS=" ${ccflags} ${ltoflags} " \
400- LDFLAGS=" ${linkflags} ${ltolinkflags} "
365+ CFLAGS=" ${ccflags} " \
366+ CXXFLAGS=" ${ccflags} " \
367+ LDFLAGS=" ${linkflags} "
401368
402369make all --jobs
403370make install
@@ -413,9 +380,9 @@ rm --force --recursive ./*
413380 --with-gmp=" ${toolchain_directory} " \
414381 --enable-shared \
415382 --disable-static \
416- CFLAGS=" ${ccflags} ${ltoflags} " \
417- CXXFLAGS=" ${ccflags} ${ltoflags} " \
418- LDFLAGS=" ${linkflags} ${ltolinkflags} "
383+ CFLAGS=" ${ccflags} " \
384+ CXXFLAGS=" ${ccflags} " \
385+ LDFLAGS=" ${linkflags} "
419386
420387make all --jobs
421388make install
@@ -431,9 +398,9 @@ rm --force --recursive ./*
431398 --with-gmp=" ${toolchain_directory} " \
432399 --enable-shared \
433400 --disable-static \
434- CFLAGS=" ${ccflags} ${ltoflags} " \
435- CXXFLAGS=" ${ccflags} ${ltoflags} " \
436- LDFLAGS=" ${linkflags} ${ltolinkflags} "
401+ CFLAGS=" ${ccflags} " \
402+ CXXFLAGS=" ${ccflags} " \
403+ LDFLAGS=" ${linkflags} "
437404
438405make all --jobs
439406make install
@@ -449,9 +416,9 @@ rm --force --recursive ./*
449416 --with-gmp-prefix=" ${toolchain_directory} " \
450417 --enable-shared \
451418 --disable-static \
452- CFLAGS=" ${pieflags} ${ccflags} ${ltoflags} " \
453- CXXFLAGS=" ${pieflags} ${ccflags} ${ltoflags} " \
454- LDFLAGS=" -Xlinker -rpath-link -Xlinker ${toolchain_directory} /lib ${linkflags} ${ltolinkflags} "
419+ CFLAGS=" ${pieflags} ${ccflags} " \
420+ CXXFLAGS=" ${pieflags} ${ccflags} " \
421+ LDFLAGS=" -Xlinker -rpath-link -Xlinker ${toolchain_directory} /lib ${linkflags} "
455422
456423make all --jobs
457424make install
@@ -556,9 +523,9 @@ for target in "${targets[@]}"; do
556523 --with-sysroot=" ${toolchain_directory} /${triplet} " \
557524 --without-static-standard-libraries \
558525 --with-zstd=" ${toolchain_directory} " \
559- CFLAGS=" ${ccflags} ${ltoflags} " \
560- CXXFLAGS=" ${ccflags} ${ltoflags} " \
561- LDFLAGS=" ${linkflags} ${ltolinkflags} "
526+ CFLAGS=" ${ccflags} " \
527+ CXXFLAGS=" ${ccflags} " \
528+ LDFLAGS=" ${linkflags} "
562529
563530 make all --jobs
564531 make install
@@ -594,7 +561,7 @@ for target in "${targets[@]}"; do
594561 --with-zstd=" ${toolchain_directory} " \
595562 --with-bugurl=' https://github.com/AmanoTeam/obggcc/issues' \
596563 --with-gcc-major-version-only \
597- --with-pkgversion=" OBGGCC v3.3 -${revision} " \
564+ --with-pkgversion=" OBGGCC v3.4 -${revision} " \
598565 --with-sysroot=" ${toolchain_directory} /${triplet} " \
599566 --with-native-system-header-dir=' /include' \
600567 --with-default-libstdcxx-abi=' new' \
@@ -637,9 +604,9 @@ for target in "${targets[@]}"; do
637604 --without-headers \
638605 --without-static-standard-libraries \
639606 ${extra_configure_flags} \
640- CFLAGS=" ${ccflags} ${ltoflags} ${profiling_cflags} " \
641- CXXFLAGS=" ${ccflags} ${ltoflags} ${profiling_cflags} " \
642- LDFLAGS=" ${linkflags} ${ltolinkflags} ${profiling_ldflags} "
607+ CFLAGS=" ${ccflags} " \
608+ CXXFLAGS=" ${ccflags} " \
609+ LDFLAGS=" ${linkflags} "
643610
644611 cflags_for_target=" ${ccflags} ${linkflags} "
645612 cxxflags_for_target=" ${ccflags} ${linkflags} "
@@ -947,3 +914,11 @@ done
947914mkdir --parent " ${share_directory} "
948915
949916cp --recursive " ${workdir} /tools/dev/" * " ${share_directory} "
917+
918+ [ -d " ${toolchain_directory} /build" ] || mkdir " ${toolchain_directory} /build"
919+
920+ ln \
921+ --symbolic \
922+ --relative \
923+ " ${share_directory} /" * \
924+ " ${toolchain_directory} /build"
0 commit comments