[libcamera-devel] [PATCH] meson: Really define _FORTIFY_SOURCE for optimised builds

Niklas Söderlund niklas.soderlund at ragnatech.se
Thu Nov 21 10:33:57 CET 2019


Hi Laurent,

Thanks for your work.

On 2019-11-21 06:19:13 +0200, Laurent Pinchart wrote:
> Commit 965c5bf7fbf5 ("meson: Define _FORTIFY_SOURCE for optimised
> builds") tried to define _FORTIFY_SOURCE for optimised builds with
> clang, but updated the common_arguments after it was used. This resulted
> in the _FORTIFY_SOURCE option not being applied. Fix it.
> 
> Fixes: 965c5bf7fbf5 ("meson: Define _FORTIFY_SOURCE for optimised builds")
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

> ---
>  meson.build | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 72ad7c8b493b..0a222ba96dcb 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -35,8 +35,8 @@ common_arguments = [
>      '-include', 'config.h',
>  ]
>  
> -c_arguments = common_arguments
> -cpp_arguments = common_arguments
> +c_arguments = []
> +cpp_arguments = []
>  
>  if cc.get_id() == 'clang'
>      # Turn _FORTIFY_SOURCE by default on optimised builds (as it requires -O1
> @@ -56,6 +56,9 @@ if cc.get_id() == 'clang'
>      endif
>  endif
>  
> +c_arguments += common_arguments
> +cpp_arguments += common_arguments
> +
>  add_project_arguments(c_arguments, language : 'c')
>  add_project_arguments(cpp_arguments, language : 'cpp')
>  add_project_link_arguments(cpp_arguments, language : 'cpp')
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list