summaryrefslogtreecommitdiffstats
path: root/comp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'comp.sh')
-rwxr-xr-xcomp.sh21
1 files changed, 14 insertions, 7 deletions
diff --git a/comp.sh b/comp.sh
index 8539c2d..af11720 100755
--- a/comp.sh
+++ b/comp.sh
@@ -157,12 +157,15 @@ build_flags() {
157 esac 157 esac
158} 158}
159 159
160# i686-gnu needs linker flags from .cargo/config.toml. RUSTFLAGS on the command 160# gnu targets need linker flags from .cargo/config.toml (a weak GLIBC_2.39
161# line would shadow them, so repeat them. 161# reference would warn on older glibc). RUSTFLAGS on the command line would
162# shadow them, so repeat them here.
162defsym_flag= 163defsym_flag=
163if [ "$triple_gnu" = i686-unknown-linux-gnu ]; then 164case "$triple_gnu" in
164 defsym_flag="-C link-arg=-Wl,--defsym,pidfd_spawnp=0 -C link-arg=-Wl,--defsym,pidfd_getpid=0" 165 *-unknown-linux-gnu)
165fi 166 defsym_flag="-C link-arg=-Wl,--defsym,pidfd_spawnp=0 -C link-arg=-Wl,--defsym,pidfd_getpid=0"
167 ;;
168esac
166 169
167# ---------------------------------------------------------------- report 170# ---------------------------------------------------------------- report
168 171
@@ -217,7 +220,9 @@ if [ "$plan" = native ] || [ "$plan" = musl ]; then
217 [ "$plan" = musl ] && triple=$triple_musl 220 [ "$plan" = musl ] && triple=$triple_musl
218 221
219 flags=$(build_flags) 222 flags=$(build_flags)
220 [ "$triple" = i686-unknown-linux-gnu ] && flags="$flags $defsym_flag" 223 case "$triple" in
224 *-unknown-linux-gnu) flags="$flags $defsym_flag" ;;
225 esac
221 226
222 if [ "$cpu" = native ]; then 227 if [ "$cpu" = native ]; then
223 say " # for this CPU${cpu_level:+ (x86-64-$cpu_level)}" 228 say " # for this CPU${cpu_level:+ (x86-64-$cpu_level)}"
@@ -289,7 +294,9 @@ if [ "$run" -eq 1 ]; then
289 triple=$native_triple 294 triple=$native_triple
290 [ "$plan" = musl ] && triple=$triple_musl 295 [ "$plan" = musl ] && triple=$triple_musl
291 flags=$(build_flags) 296 flags=$(build_flags)
292 [ "$triple" = i686-unknown-linux-gnu ] && flags="$flags $defsym_flag" 297 case "$triple" in
298 *-unknown-linux-gnu) flags="$flags $defsym_flag" ;;
299 esac
293 300
294 section "building" 301 section "building"
295 rustup target add "$triple" >/dev/null 2>&1 || true 302 rustup target add "$triple" >/dev/null 2>&1 || true