Warning, /graphics/krita/3rdparty/ext_ffmpeg/0003-ffmpeg-Add-options-for-SSP-and-CFGuard.patch is written in an unsupported language. File is not indexed.
0001 From 7aa8faf667f47e3679928fd415aac91f9a1b4e71 Mon Sep 17 00:00:00 2001 0002 From: Dmitry Kazakov <dimula73@gmail.com> 0003 Date: Tue, 11 Apr 2023 14:55:10 +0200 0004 Subject: [PATCH 3/3] Add options for SSP and CFGuard 0005 0006 --- 0007 meson.build | 13 +++++++++++++ 0008 meson_options.txt | 2 ++ 0009 2 files changed, 15 insertions(+) 0010 0011 diff --git a/meson.build b/meson.build 0012 index a14241eb45..8e0d2fa713 100644 0013 --- a/meson.build 0014 +++ b/meson.build 0015 @@ -464,6 +464,19 @@ types_list = [ 0016 'struct_v4l2_frmivalenum_discrete', 0017 ] 0018 0019 +option_cfguard = get_option('enable-cfguard').require(cc.has_argument('-mguard=cf'), error_message : 'Compiler does not support cfguard') 0020 +if option_cfguard.allowed() 0021 + add_global_arguments('-mguard=cf', language : ['c', 'cpp']) 0022 + add_global_link_arguments('-mguard=cf', language : ['c', 'cpp']) 0023 + message('Enabled CFGuard') 0024 +endif 0025 + 0026 +if get_option('enable-ssp').require(cc.has_argument('-fstack-protector-strong'), error_message : 'Compiler does not support -fstack-protector-strong').allowed() 0027 + add_global_arguments('-fstack-protector-strong', language : ['c', 'cpp']) 0028 + add_global_link_arguments('-fstack-protector-strong', language : ['c', 'cpp']) 0029 + message('Enabled SSP') 0030 +endif 0031 + 0032 if get_option('no_uninit_ub') 0033 add_global_arguments('-DDISABLE_AV_UNINIT_UB=1', language : 'c') 0034 add_global_arguments('-DDISABLE_AV_UNINIT_UB=1', language : 'cpp') 0035 diff --git a/meson_options.txt b/meson_options.txt 0036 index d02877e76c..4452ddce72 100644 0037 --- a/meson_options.txt 0038 +++ b/meson_options.txt 0039 @@ -2203,3 +2203,5 @@ option('inline_asm', type: 'feature', value: 'enabled', description: 'Enable inl 0040 option('cli', type: 'feature', value: 'disabled') 0041 option('tests', type : 'feature', value : 'auto', description : 'Build tests', yield : true) 0042 option('no_uninit_ub', type: 'boolean', value: false, description: 'Disable UB in av_uninit optimization') 0043 +option('enable-ssp', type: 'feature', value: 'enabled', description: 'Enable -fstack-protector-strong') 0044 +option('enable-cfguard', type: 'feature', value: 'auto', description: 'Enable control flow guard') 0045 -- 0046 2.40.1.windows.1 0047