From 67331e5c074e8a8cbc2db013af8e5c1851f20a11 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Wed, 1 May 2019 12:58:14 +0200 Subject: wrapper: build with -Wno-implicit-fallthrough if necessary If icecc does not support remote cpp or if it is disabled then implicit fallthrough warnings may occur because the corresponding comments are no longer available. In combination with -Werror this can cause build errors. So disable implicit fallthrough in this case to avoid the errors. Signed-off-by: Michael Olbrich --- bin/ptxdist | 3 +++ scripts/lib/ptxd_make_00-init.sh | 1 + scripts/wrapper/libwrapper.sh | 3 +++ 3 files changed, 7 insertions(+) diff --git a/bin/ptxdist b/bin/ptxdist index f9311405f..247b21339 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -559,6 +559,9 @@ check_compiler_icecc() { if ! "${PTXDIST_ICECC}" --version | grep -q 'ICECC 1\.'; then ptxd_bailout "PTXdist only supports icecc 1.x" fi + if "${PTXDIST_ICECC}" --help | grep -q ICECC_REMOTE_CPP; then + export PTXDIST_ICECC_REMOTE_CPP=1 + fi && mkdir -p "${icecc_dir}/target" "${icecc_dir}/host" && ( echo "Creating icecc host environment..." diff --git a/scripts/lib/ptxd_make_00-init.sh b/scripts/lib/ptxd_make_00-init.sh index 70a8b99b6..a042763d1 100644 --- a/scripts/lib/ptxd_make_00-init.sh +++ b/scripts/lib/ptxd_make_00-init.sh @@ -304,6 +304,7 @@ ptxd_init_save_wrapper_env() { PTXDIST_HOST_CPPFLAGS="${PTXDIST_HOST_CPPFLAGS}" PTXDIST_HOST_LDFLAGS="${PTXDIST_HOST_LDFLAGS}" PTXDIST_PLATFORMDIR="${PTXDIST_PLATFORMDIR}" + PTXDIST_ICECC_REMOTE_CPP="${PTXDIST_ICECC_REMOTE_CPP}" EOF } diff --git a/scripts/wrapper/libwrapper.sh b/scripts/wrapper/libwrapper.sh index 913c3eb06..677ca3ce4 100644 --- a/scripts/wrapper/libwrapper.sh +++ b/scripts/wrapper/libwrapper.sh @@ -275,6 +275,9 @@ cxx_add_host_extra() { add_icecc_args() { if [ -n "${PTXDIST_ICECC}" ]; then add_late_arg "-fno-diagnostics-show-caret" + if [ "${PTXDIST_ICECC_REMOTE_CPP}" != 1 -o "${ICECC_REMOTE_CPP}" = "0" ]; then + add_late_arg "-Wno-implicit-fallthrough" + fi fi } -- cgit v1.2.3