Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 22 Feb 2018 15:40:43 -0800
From: Kees Cook <keescook@...omium.org>
To: Laura Abbott <labbott@...hat.com>
Cc: Alexander Popov <alex.popov@...ux.com>, 
	Kernel Hardening <kernel-hardening@...ts.openwall.com>
Subject: Re: [PATCH 1/2] gcc-plugins: Update cgraph_create_edge for gcc-8

On Thu, Feb 22, 2018 at 3:14 PM, Laura Abbott <labbott@...hat.com> wrote:
>
> gcc-8 changed the API for cgraph_create_edge. Update accordingly.
>
> Signed-off-by: Laura Abbott <labbott@...hat.com>
> ---
>  scripts/gcc-plugins/gcc-common.h | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
> index f46750053377..42c55c29157f 100644
> --- a/scripts/gcc-plugins/gcc-common.h
> +++ b/scripts/gcc-plugins/gcc-common.h
> @@ -723,8 +723,14 @@ static inline const char *get_decl_section_name(const_tree decl)
>  #define varpool_get_node(decl) varpool_node::get(decl)
>  #define dump_varpool_node(file, node) (node)->dump(file)
>
> +#if BUILDING_GCC_VERSION >= 8000
> +#define cgraph_create_edge(caller, callee, call_stmt, count, nest) \
> +       (caller)->create_edge((callee), (call_stmt), (count))
> +#else
>  #define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \
>         (caller)->create_edge((callee), (call_stmt), (count), (freq))
> +
> +#endif

Since gcc 8 "throws away" the freq argument, could this just be
updated to do the same? i.e., leave "freq" as an argument, and just
don't use it? That way the plugin caller doesn't need to be updated.

+#if BUILDING_GCC_VERSION >= 8000
+#define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \
+       (caller)->create_edge((callee), (call_stmt), (count))
+#else
 #define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \
        (caller)->create_edge((callee), (call_stmt), (count), (freq))
+#endif


-Kees

-- 
Kees Cook
Pixel Security

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.