Skip to content

Commit 0a6fc8c

Browse files
committed
Update a post: portable-gcc-toolchain.md
1 parent c40621c commit 0a6fc8c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

content/post/portable-gcc-toolchain.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ cd build
198198
--disable-libquadmath \
199199
--disable-libquadmath-support \
200200
--disable-libsanitizer \
201+
--disable-fixincludes \
201202
--disable-bootstrap
202203
make -j "$(nproc)" all-gcc
203204
make install-gcc
@@ -351,7 +352,8 @@ LDFLAGS="${ldflags}" LDFLAGS_FOR_TARGET="${ldflags}" \
351352
--with-local-prefix="${PREFIX}" \
352353
--enable-languages=c,c++ \
353354
--enable-default-pie \
354-
--disable-multilib
355+
--disable-multilib \
356+
--disable-fixincludes
355357
356358
make BOOT_LDFLAGS="${ldflags}" -j "$(nproc)"
357359
@@ -659,22 +661,22 @@ function configure_toolchain() {
659661
local current_path
660662
current_path="$(pwd)"
661663
while read -r file; do
662-
sed -i "s/\/opt\/toolchain/${current_path//\//\\/}/g" "${file}"
664+
sed -i "s|/opt/toolchain|${current_path}|g" "${file}"
663665
done < <(
664666
find . -type f -exec grep -E -I -l $'[=\'" ]/opt/toolchain' {} \;
665667
)
666668
667669
# Modify ldd
668-
sed -i "/RTLDLIST=/s/${current_path//\//\\/}//g" bin/ldd
670+
sed -i "s|RTLDLIST=.*|RTLDLIST='${interpreter}'|" bin/ldd
669671
670672
# Configure gcc specs
671673
local filename
672674
filename="$(basename "${interpreter}")"
673675
local dirname
674676
dirname="$(dirname "${interpreter}")"
675677
"$(pwd)/bin/gcc" -dumpspecs | sed "{
676-
s/:\([^;}:]*\)\/\(${filename/.so*/}\)/:${dirname//\//\\/}\/\2/g
677-
s/collect2/collect2 -rpath ${rpaths_in_line//\//\\/}/
678+
s|:\([^;}:]*\)/\(${filename/.so*/}\)|:${dirname}/\2|g
679+
s|collect2|collect2 -rpath ${rpaths_in_line}|
678680
}" >"$(pwd)/lib/gcc/specs"
679681
}
680682
```

0 commit comments

Comments
 (0)