Well, if you want to use your own clang (why?) you have to manually pass to the your compiler all flags we pass to the compiler wrapper, they are a few:
% julia --compile=min -e 'using BinaryBuilderBase; BinaryBuilderBase.runshell(Platform("x86_64", "linux"))'
sandbox:${WORKSPACE} # cat $(which clang)
#!/bin/bash
# This compiler wrapper script brought into existence by `generate_compiler_wrappers!()`
if [ "x${SUPER_VERBOSE}" = "x" ]; then
vrun() { "$@"; }
else
vrun() { echo -e "\e[96m$@\e[0m" >&2; "$@"; }
fi
ARGS=( "$@" )
PRE_FLAGS=()
POST_FLAGS=()
PRE_FLAGS+=( -target x86_64-linux-gnu )
PRE_FLAGS+=( --sysroot=/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root )
PRE_FLAGS+=( --gcc-toolchain=/opt/x86_64-linux-gnu )
PRE_FLAGS+=( -rtlib=libgcc )
PRE_FLAGS+=( -stdlib=libstdc++ )
if [[ " ${ARGS[@]} " != *' -x assembler '* ]]; then
PRE_FLAGS+=( -march=x86-64 )
PRE_FLAGS+=( -mtune=generic )
fi
if [[ " ${ARGS[@]} " != *' -c '* ]] && [[ " ${ARGS[@]} " != *' -E '* ]] && [[ " ${ARGS[@]} " != *' -M '* ]] && [[ " ${ARGS[@]} " != *' -fsyntax-only '* ]]; then
POST_FLAGS+=( -fuse-ld=x86_64-linux-gnu )
fi
export LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:/lib64:/lib:/opt/x86_64-linux-musl/x86_64-linux-musl/lib64:/opt/x86_64-linux-musl/x86_64-linux-musl/lib:/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64:/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib"
if [[ " ${ARGS[@]} " == *"-march="* ]]; then
echo "BinaryBuilder: Cannot force an architecture via -march" >&2
exit 1
fi
if [ ${USE_CCACHE} == "true" ]; then
CCACHE="ccache"
fi
vrun ${CCACHE} /opt/x86_64-linux-musl/bin/clang "${PRE_FLAGS[@]}" "${ARGS[@]}" "${POST_FLAGS[@]}"