Skip to content

Commit 0f52562

Browse files
committed
Support OBGGCC_STATIC
In 009500a, we added a flag switch in the GCC wrapper that allows choosing between static and shared when linking to the GCC libraries. This change now enables support for it in OBGGCC.
1 parent 19bd746 commit 0f52562

1 file changed

Lines changed: 27 additions & 24 deletions

File tree

build.sh

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,22 @@ declare -ra bits=(
120120
declare -r languages='c,c++'
121121

122122
declare -ra targets=(
123-
'ia64-unknown-linux-gnu'
124-
'mips-unknown-linux-gnu'
125-
'mips64el-unknown-linux-gnuabi64'
126-
'mipsel-unknown-linux-gnu'
127-
'powerpc-unknown-linux-gnu'
128-
'powerpc64le-unknown-linux-gnu'
129-
's390-unknown-linux-gnu'
130-
's390x-unknown-linux-gnu'
131-
'sparc-unknown-linux-gnu'
123+
# 'ia64-unknown-linux-gnu'
124+
# 'mips-unknown-linux-gnu'
125+
# 'mips64el-unknown-linux-gnuabi64'
126+
# 'mipsel-unknown-linux-gnu'
127+
# 'powerpc-unknown-linux-gnu'
128+
# 'powerpc64le-unknown-linux-gnu'
129+
# 's390-unknown-linux-gnu'
130+
# 's390x-unknown-linux-gnu'
131+
# 'sparc-unknown-linux-gnu'
132132
'x86_64-unknown-linux-gnu'
133-
'alpha-unknown-linux-gnu'
134-
'aarch64-unknown-linux-gnu'
135-
'arm-unknown-linux-gnueabi'
136-
'arm-unknown-linux-gnueabihf'
137-
'hppa-unknown-linux-gnu'
138-
'i386-unknown-linux-gnu'
133+
# 'alpha-unknown-linux-gnu'
134+
# 'aarch64-unknown-linux-gnu'
135+
# 'arm-unknown-linux-gnueabi'
136+
# 'arm-unknown-linux-gnueabihf'
137+
# 'hppa-unknown-linux-gnu'
138+
# 'i386-unknown-linux-gnu'
139139
)
140140

141141
declare -r PKG_CONFIG_PATH="${toolchain_directory}/lib/pkgconfig"
@@ -556,7 +556,7 @@ for target in "${targets[@]}"; do
556556
--with-zstd="${toolchain_directory}" \
557557
--with-bugurl='https://github.com/AmanoTeam/obggcc/issues' \
558558
--with-gcc-major-version-only \
559-
--with-pkgversion="OBGGCC v2.9-${revision}" \
559+
--with-pkgversion="OBGGCC v3.0-${revision}" \
560560
--with-sysroot="${toolchain_directory}/${triplet}" \
561561
--with-native-system-header-dir='/include' \
562562
--with-default-libstdcxx-abi='new' \
@@ -588,6 +588,7 @@ for target in "${targets[@]}"; do
588588
--enable-host-shared \
589589
--enable-host-bind-now \
590590
--with-specs="${specs}" \
591+
--with-pic \
591592
--disable-libsanitizer \
592593
--disable-libgomp \
593594
--disable-bootstrap \
@@ -817,7 +818,9 @@ while read item; do
817818
--file="${sysroot_tarball}"
818819

819820
cd "${toolchain_directory}/${triplet}${glibc_version}/lib"
820-
mkdir 'gcc'
821+
mkdir 'gcc' 'static'
822+
823+
ln --symbolic './lib'*.{so,a}* './static'
821824

822825
if (( nz )); then
823826
mkdir 'nouzen'
@@ -845,15 +848,15 @@ while read item; do
845848

846849
ln --symbolic "${file}" './'
847850

848-
cd './gcc'
849-
850-
file="../$(basename "${file}")"
851-
852-
echo "- Symlinking '${file}' to '${PWD}'"
851+
echo "- Symlinking '${file}' to '${PWD}/gcc'"
853852

854-
ln --symbolic "${file}" './'
853+
ln --symbolic --relative "${file}" './gcc'
855854

856-
cd '../'
855+
if [[ "${file}" == *'.a' ]]; then
856+
echo "- Symlinking '${file}' to '${PWD}/static'"
857+
858+
ln --symbolic --relative "${file}" './static'
859+
fi
857860
done
858861
done
859862
done

0 commit comments

Comments
 (0)