Last active
August 29, 2015 14:02
-
-
Save mcilloni/74dcbfc8a776848c2fff to your computer and use it in GitHub Desktop.
My musl-clang wrapper script. Change my paths with your paths if needed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
containsElement () { | |
local e | |
for e in "${@:1}"; do [[ "$e" == "$2" ]] && return 0; done | |
return 1 | |
} | |
PARAMS="-nostdinc -isystem /usr/musl/include/ " | |
if containsElement @ '-c' || containsElement @ '-S'; then | |
true | |
else | |
PARAMS+="-nostdlib -Wl,-dynamic-linker /lib/ld-musl-x86_64.so.1 -L/usr/musl/lib /usr/musl/lib/crt1.o /usr/musl/lib/crti.o /usr/musl/lib/crtn.o -lc" | |
fi | |
clang $PARAMS $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment