#!/bin/bash
set -e

target=$1
shift

new_array=()
for value in "$@"
do
    [[ $value != *self-contained/*crt* ]] && [[ $value != *lgcc_s* ]] && [[ $value != *lc_nonshared* ]] && [[ $value != *latomic* ]] && [[ $value != *--fix-cortex-a53-843419* ]] && new_array+=($value)
done

zig cc "${new_array[@]}" -target $target