You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# If we're given both -fsanitize= and -Wl,--no-undefined, then try turning
228
+
# the latter into a warning rather than an error.
229
+
ifsanitize(platform) !=nothing
230
+
println(io, """
231
+
if [[ " \${ARGS[@]} " == *"-Wl,--no-undefined"* ]]; then
232
+
PRE_FLAGS+=("-Wl,--warn-unresolved-symbols")
233
+
fi
234
+
""")
235
+
end
236
+
237
+
# Insert extra commands from the user (usually some kind of conditional setting
238
+
# of PRE_FLAGS and POST_FLAGS)
239
+
println(io)
240
+
write(io, extra_cmds)
241
+
println(io)
242
+
243
+
for (name, val) in env
244
+
write(io, "export $(name)=\"$(val)\"\n")
245
+
end
246
+
247
+
#TODO: improve this check
248
+
if lock_microarchitecture
249
+
write(io, raw"""
250
+
if [[ " ${ARGS[@]} " == *"-march="* ]]; then
251
+
echo "BinaryBuilder: Cannot force an architecture via -march" >&2
252
+
exit 1
253
+
fi
254
+
""")
255
+
println(io)
256
+
end
257
+
258
+
if no_soft_float
259
+
write(io, raw"""
260
+
if [[ " ${ARGS[@]} " == *"-mfloat-abi=soft"* ]]; then
261
+
echo "BinaryBuilder: ${target} platform does not support soft-float ABI (-mfloat-abi=soft)" >&2
262
+
exit 1
263
+
fi
264
+
""")
265
+
println(io)
266
+
end
267
+
268
+
iflength(unsafe_flags) >=1
269
+
write(io, """
270
+
if [[ "\${ARGS[@]}" =~ \"$(join(unsafe_flags, "\"|\""))\" ]]; then
271
+
echo -e \"BinaryBuilder error: You used one or more of the unsafe flags: $(join(unsafe_flags, ", "))\\nThis is not allowed, please remove all unsafe flags from your build script to continue.\" >&2
272
+
exit 1
273
+
fi
274
+
""")
275
+
println(io)
276
+
end
277
+
278
+
if allow_ccache
279
+
write(io, """
280
+
# Override `\${CCACHE}` setting from the outside.
281
+
CCACHE=""
282
+
if [[ \${USE_CCACHE} == "true" ]]; then
283
+
CCACHE="ccache"
284
+
fi
285
+
""")
286
+
end
287
+
# Don't evaluate `${CCACHE}` at all if not allowed in the first place.
# If we're given both -fsanitize= and -Wl,--no-undefined, then try turning
270
-
# the latter into a warning rather than an error.
271
-
ifsanitize(platform) !=nothing
272
-
println(io, """
273
-
if [[ " \${ARGS[@]} " == *"-Wl,--no-undefined"* ]]; then
274
-
PRE_FLAGS+=("-Wl,--warn-unresolved-symbols")
275
-
fi
276
-
""")
277
-
end
278
-
279
-
# Insert extra commands from the user (usually some kind of conditional setting
280
-
# of PRE_FLAGS and POST_FLAGS)
281
-
println(io)
282
-
write(io, extra_cmds)
283
-
println(io)
284
-
285
-
for (name, val) in env
286
-
write(io, "export $(name)=\"$(val)\"\n")
287
-
end
288
-
289
-
#TODO: improve this check
290
-
if lock_microarchitecture
291
-
write(io, raw"""
292
-
if [[ " ${ARGS[@]} " == *"-march="* ]]; then
293
-
echo "BinaryBuilder: Cannot force an architecture via -march" >&2
294
-
exit 1
295
-
fi
296
-
""")
297
-
println(io)
298
-
end
299
-
300
-
if no_soft_float
301
-
write(io, raw"""
302
-
if [[ " ${ARGS[@]} " == *"-mfloat-abi=soft"* ]]; then
303
-
echo "BinaryBuilder: ${target} platform does not support soft-float ABI (-mfloat-abi=soft)" >&2
304
-
exit 1
305
-
fi
306
-
""")
307
-
println(io)
308
-
end
309
-
310
-
iflength(unsafe_flags) >=1
311
-
write(io, """
312
-
if [[ "\${ARGS[@]}" =~ \"$(join(unsafe_flags, "\"|\""))\" ]]; then
313
-
echo -e \"BinaryBuilder error: You used one or more of the unsafe flags: $(join(unsafe_flags, ", "))\\nThis is not allowed, please remove all unsafe flags from your build script to continue.\" >&2
314
-
exit 1
315
-
fi
316
-
""")
317
-
println(io)
318
-
end
319
-
320
-
if allow_ccache
321
-
write(io, """
322
-
# Override `\${CCACHE}` setting from the outside.
323
-
CCACHE=""
324
-
if [[ \${USE_CCACHE} == "true" ]]; then
325
-
CCACHE="ccache"
326
-
fi
327
-
""")
328
-
end
329
-
# Don't evaluate `${CCACHE}` at all if not allowed in the first place.
0 commit comments