summaryrefslogtreecommitdiff
path: root/sync-build.sh
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2023-03-11 16:20:24 +0100
committerPeter Wu <peter@lekensteyn.nl>2023-03-11 16:26:29 +0100
commit278ca860093c3a1c5c9d9171e8c2532f94b20902 (patch)
treee9b923f661c770c56136f59dbed786cd46924664 /sync-build.sh
parent3bbe8aad0d68d924630129bdbe3ed0b70ee95b9a (diff)
downloadwireshark-notes-278ca860093c3a1c5c9d9171e8c2532f94b20902.tar.gz
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
Diffstat (limited to 'sync-build.sh')
-rwxr-xr-xsync-build.sh10
1 files 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++}
# "<optimized out>".
# -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 &&