Age | Commit message (Collapse) | Author | Files | Lines |
|
Since v2.9.1rc0-449-ga37388fbb6 it is no longer possible to override
CMAKE_INSTALL_RPATH to create relocatable build directories. An attempt
to add this feature in a generic way to older CMake versions failed, see
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15163#c12
I do not really need relocatable builds at the moment and can wait until
CMake 3.14 is released should I need it in the future.
|
|
GCC does not support -fuse-ld=lld and LLD 7.0.1 has a bug that causes
crashes when (statically) linking code that uses thread-local storage
without a PLT.
|
|
Remove ENABLE_xxx options that are enabled by default, check
CMakeOptions.txt instead if you want to see available values.
Skip rebuilding if only tests change. Remove -fsanitize options since
these are set via CMake options.
Use lld instead of gold since it is almost twice as fast as gold:
lld 4.8s
gold 9.2s
bfd 10.8s
Tested (n=3) with lld 7.0.1-1 and binutils 2.31.1-4 on Arch Linux, Linux
4.19.12-arch1-1-ARCH, i7-6700HQ, wireshark v2.9.1rc0-363-g178d81f804.
Commands:
time cmake -GNinja /tmp/wireshark -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_FLAGS="-fdiagnostics-color -fuse-ld=lld" \
-DCMAKE_CXX_FLAGS="-fdiagnostics-color -fuse-ld=lld" \
-DDISABLE_WERROR=1 -DENABLE_ASAN=1 -DENABLE_UBSAN=1
time ninja && rm -rf run
time ninja # measured this with various -fuse-ld= values.
Total build time is about 21s for cmake, 3m18s for the initial ninja.
Ignoring the noise, a full build somehow takes about the same time as
with gold, but incremental builds with lld are consistently faster.
|
|
Do not wake up on running tests (which might touch __pycache__ and
pytest files).
|
|
GCRYPT is enabled by default, the option is gone since 2.4. Enable the
ASAN option via CMake to ensure that building lemon does not fail if
detect_leaks is not set.
|
|
Append to PATH to avoid clobbering it when putting ccache in $PATH.
Enable SBC codec for testing.
Enable debug-prefix-map, should make relocatable debug builds easier
(where I build in a different directory and move it).
|
|
Gold linker seems marginally faster.
|
|
For testing other build types (-DCMAKE_BUILD_TYPE=RelWithDebInfo) and
compilers (BUILDDIR=/tmp/wsbuild-gcc).
|
|
Copy compile_commands.json, config.h. (ab)use CMAKE_INSTALL_RPATH to
enable relocatable executables. Note that this is only safe for
development, if you install the generated binaries without
stripping/modifying rpath, then insecure situations may occur in an
hostile environment (wrong libraries may be loaded).
|
|
Advantages: lower transmission size, faster completion for slow WAN
links. Disadvantage: slight delays in compile output reporting.
|
|
Useful to build just tshark if I want to test a dissector.
|
|
Avoids the need to manually touch /tmp/sync-build-* to trigger a build
on startup. Can be overridden with the NOTRIGGER=1 env.
|
|
Let 'localhost' bypass SSH so I can still use its watch functionality,
but build locally.
Use -fno-common to workaround bug
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65285
Disable verbose warnings and disable werror to reduce the huge trace of
warnings which make me overlook real issues.
|
|
Ninja can strip colors if needed, but otherwise it needs to be forced on
https://github.com/martine/ninja/issues/174
|
|
Ninja is awesome, it is faster than Unix Makefiles!
|
|
Default CXXFLAGS to CFLAGS (previously it would always use CFLAGS
anyway due to a typo), do not require schroot, use 2*nproc instead of
hardcoded 16 jobs. Document envvars.
|
|
There is packaging/macosx/native-gtk/config.h
|
|
|
|
|
|
|
|
Also allows you to override CC/CXX (for Clang support), fix
/tmp/wireshark/ symlink and /tmp/wsbuild/run/ sync, enable some
additional modules (but disable SBC which would be used for Bluetooth
audio support), pass -DCMAKE_EXPORT_COMPILE_COMMANDS (for clang-check
iirc).
|
|
This script helps me in syncing sources with a remote build machine and
building changes once I have made a local change. It also syncs back
generated binaries.
|