Ilya Fedin
0ff8f97600
Fix noisy warnings with clang
2022-11-25 11:15:14 +01:00
Ilya Fedin
d41ce7f553
Inherit per-config INTERPROCEDURAL_OPTIMIZATION options
...
This also fixes the missing -fno-use-linker-plugin in Debug configuration with DESKTOP_APP_SPECIAL_TARGET since the last change
2022-11-18 20:31:01 +04:00
Ilya Fedin
5723b4f274
Fix conditions for LTO-related options on Linux
...
Currently LTO seem to be always active even when it's not meant to and LTO seem to be broken in debug build.
2022-11-08 23:23:06 +04:00
Ilya Fedin
a3afeeac0e
Parallelize LTO on Linux
2022-11-03 13:47:47 +04:00
Ilya Fedin
4294a1872f
Silence LTO warnings
2022-11-01 14:36:38 +04:00
Ilya Fedin
700a46e5db
Fix LTO in debug build
2022-11-01 14:36:38 +04:00
Ilya Fedin
3c98147427
Set hardening flags only for non-packaged/special target builds
2022-11-01 14:36:38 +04:00
Ilya Fedin
6f96a68508
Revert "Move more compiler options to DESKTOP_APP_SPECIAL_TARGET condition"
...
This reverts commit 32257877e0 .
2022-10-01 08:35:13 +04:00
Ilya Fedin
cd12cb93ea
Make target_*_options_if_exists actually work
2022-09-30 11:05:56 +04:00
Ilya Fedin
32257877e0
Move more compiler options to DESKTOP_APP_SPECIAL_TARGET condition
2022-09-30 10:09:46 +04:00
Ilya Fedin
f49e254d8c
Fix order of libdl linking
2022-09-23 23:26:09 +04:00
Ilya Fedin
848c16578e
Implement target_compile_options_if_exists, target_link_options_if_exists
2022-09-21 16:55:11 +04:00
Ilya Fedin
19aa4dd175
Replace FindThreads with custom logic
...
It doesn't seem to do what we want, unfortunately...
2022-09-21 08:05:16 +04:00
Ilya Fedin
0702ef4cdd
Get rid of DESKTOP_APP_QT6
2022-08-14 10:01:20 +04:00
Ilya Fedin
26d31dbdef
Move -fstack-clash-protection to GCC-only flags
2022-05-02 15:09:29 +04:00
Klemens Nanni
205f90ab9e
Replace deprecated -W with explicit -Wextra
...
`-W` looks odd in build logs, I thought it was a missing warning option...
Turns out this has long been superseeded by `-Wexta`, so use that.
2022-03-07 09:57:26 +04:00
Klemens Nanni
ddd1ee547d
Introduce DESKTOP_APP_DISABLE_JEMALLOC to enable using system malloc
...
On at least OpenBSD, malloc(3) is preferred to other implementations
like jemalloc for various reasons.
It is common for portable third-party software (ports) to provide a
switch for en/disabling jemalloc.
tdesktop makes this easy since it does not contain any (je)malloc
specific code (anymore).
Introduce a new default-off option that disables jemalloc when enabled
explicitly; this also allow developers and package maintainers more
easily to try different malloc implementations, e.g. for debugging.
Memory leaks reported in the slightly old issue
"The app consumes an unexpectedly large amount of RAM"
https://github.com/telegramdesktop/tdesktop/issues/16084 could not
be reproduced on OpenBSD/amd64 with malloc(3) using tdesktop >= 3.3.1.
2022-02-27 19:58:36 +03:00
Ilya Fedin
96d9bcd5ff
Don't link linux_jemalloc_helper itself to common_options
...
TARGET_OBJECTS automatically adds target dependnecy, specyfing linux_jemalloc_helper explicitly breaks library ordering due to cycle dependency
2022-02-15 19:20:04 +03:00
Ilya Fedin
605ad62e11
Restore TARGET_FILE for allocation tracer
2022-02-01 14:38:31 +03:00
Ilya Fedin
167a914da5
Add jemalloc initialization helper
2022-02-01 14:38:31 +03:00
Ilya Fedin
df426419c7
Use LINK_ONLY instead of TARGET_FILE
2022-01-28 23:29:00 +04:00
Ilya Fedin
ab4553e6ee
Use Threads in packaged mode as more universal approach
2022-01-22 19:48:21 +03:00
Ilya Fedin
b3cb911ae0
Define _GLIBCXX_ASSERTIONS
2022-01-05 12:54:40 +03:00
Ilya Fedin
10108ea237
Move libdl/libpthread handling to common_options
...
Setting -pthread makes linking libatomic manually unneeded
2022-01-05 12:54:40 +03:00
Ilya Fedin
f2384057de
Use --push-state/--pop-state linker options
2022-01-05 12:54:40 +03:00
John Preston
3440748171
Ignore 'deprecated' warnings because of [=] capturing 'this'.
2021-11-14 11:29:38 +04:00
John Preston
fc65d3305d
Revert "Re-enable -pie."
...
This reverts commit 13331633e5 .
AppImage hack fired back: #17183
2021-11-03 21:34:06 +04:00
Ilya Fedin
d5237e224e
Make -Wl,-z,now work on older systems
2021-11-02 09:42:00 +04:00
John Preston
13331633e5
Re-enable -pie.
2021-10-31 16:49:13 +04:00
Ilya Fedin
6ef834cf3c
Don't warn about deprecated declarations with Qt 6
2021-10-21 10:07:08 +04:00
John Preston
13575af1f3
Remove -pie linker flag.
...
See https://gitlab.gnome.org/GNOME/nautilus/-/issues/1601
2021-10-08 10:31:21 +04:00
John Preston
f77251b2c1
Remove -Wl,-z,now from the linker flags.
2021-10-06 20:35:08 +04:00
John Preston
18d7c34ce1
Hardening flags only for non-packaged builds.
2021-09-28 22:07:46 +04:00
John Preston
f3a611c82b
Add some hardening compiler / linker flags.
2021-09-28 18:44:05 +04:00
Ilya Fedin
dbc1e4fb35
Use whole-program optimization to eliminate linking of unused symbols
2021-09-19 12:28:52 +03:00
Ilya Fedin
a4257299f6
Link libgcc statically in pair with libstdc++
2021-09-15 11:42:40 +03:00
Ilya Fedin
7ca99a4d08
Adjust --as-needed for allocation tracer and jemalloc
2021-09-12 00:47:59 +03:00
Ilya Fedin
49ca0abd71
Use -Wl,--as-needed
2021-09-12 00:02:59 +03:00
Ilya Fedin
b02fc90612
Get rid of osx and linux32 special targets
2021-08-11 16:01:08 +03:00
Ilya Fedin
24543509c1
Use libc++ with clang
2021-08-08 09:26:18 +03:00
Ilya Fedin
3fbee998ae
Move flags non-qt-related flags from external_qt to common_options
2021-08-08 09:26:18 +03:00
Ilya Fedin
f7ccab0e7c
Allow LTO with clang
...
Seem to work fine
2021-08-08 09:26:18 +03:00
Ilya Fedin
b3f3876c5f
Activate fixed warnings
2021-07-19 20:35:33 +03:00
Ilya Fedin
1c8cfe49c5
Clang build fixes
2021-07-13 20:28:33 +03:00
Ilya Fedin
8d7772ab33
Switch from mallocng to jemalloc
2021-07-01 21:03:06 +03:00
John Preston
8414d2aa3a
Fix external_webrtc for Linux.
2020-08-11 13:56:54 +04:00
Ilya Fedin
f05e28c8da
Replace DESKTOP_APP_USE_PACKAGED with DESKTOP_APP_SPECIAL_TARGET in some places
2020-08-10 15:32:52 +04:00
John Preston
28ff839711
Fix linking with glibc wraps, libatomic.
2020-07-26 12:13:41 +04:00
Ilya Fedin
3f73163b06
Link libatomic statically
2020-07-25 11:31:37 +04:00
Ilya Fedin
2acd52d39a
Set link options only without DESKTOP_APP_USE_PACKAGED
2020-07-23 14:09:17 +04:00