From 278ca860093c3a1c5c9d9171e8c2532f94b20902 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 11 Mar 2023 16:20:24 +0100 Subject: sync-build.sh: fix -fuse-ld=lld warnings, rename DISABLE_WERROR Rename DISABLE_WERROR to ENABLE_WERROR, since v3.7.0rc0-920-g119473eab3. Since Wireshark commit v4.1.0rc0-834-g973748f321, the -Qunused-arguments flag was dropped which resulted in warnings due to `-fuse-ld=lld` also being included with compiler commands. Indeed, the option should only be added to clang invocations when linking .so and executable files. Move the options over. See also my comment about CMake options here: https://gitlab.com/wireshark/wireshark/-/merge_requests/8872#note_1303093704 --- sync-build.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sync-build.sh b/sync-build.sh index bcd4c47..19da4e3 100755 --- a/sync-build.sh +++ b/sync-build.sh @@ -50,13 +50,6 @@ CXX=${CXX:-c++} # "". # -O1 -g -gdwarf-4 -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer _default_flags=-fdiagnostics-color -if $CC --version | grep -qE 'clang version ([89]|[1-9][0-9])'; then - # Require Clang and at least LLD 8.0 to avoid broken binaries and crashes. - # https://bugs.llvm.org/show_bug.cgi?id=37303 - _default_flags+=\ -fuse-ld=lld -else - _default_flags+=\ -fuse-ld=gold -fi # -fdebug-prefix-map is supported in GCC since 2007 (?), but only in Clang 3.8 # In GDB, use "dir /tmp/wireshark" to add the source directory anyway. # -fmacro-prefix-map and -ffile-prefix-map were added in GCC 8. Hopefully it @@ -123,13 +116,14 @@ if $force_cmake || [ ! -e $builddir/CMakeCache.txt ]; then -DCMAKE_INSTALL_PREFIX=/tmp/wsroot \ -DENABLE_SMI=0 \ -DCMAKE_BUILD_TYPE=Debug \ - -DDISABLE_WERROR=1 \ + -DENABLE_WERROR=0 \ -DENABLE_ASAN=1 \ -DENABLE_UBSAN=1 \ $remotesrcdir \ -DCMAKE_LIBRARY_PATH=$LIBDIR \ -DCMAKE_C_FLAGS=$(printf %q "$CFLAGS") \ -DCMAKE_CXX_FLAGS=$(printf %q "$CXXFLAGS") \ + -DCMAKE_{EXE,SHARED,MODULE}_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ $(printf ' %q' "${cmake_options[@]}") fi && -- cgit v1.2.1