Skip to content

Commit

Permalink
Merge tag 'gcc-plugins-v5.7-rc5' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/kernel/git/kees/linux

Pull gcc-plugins fixes from Kees Cook:
 "GCC 10 fixes for gcc-plugins:

   - Adjust caller of cgraph_create_edge for GCC 10 argument usage

   - Update common headers to build under GCC 10 (Frédéric Pierret)"

* tag 'gcc-plugins-v5.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  gcc-common.h: Update for GCC 10
  gcc-plugins/stackleak: Avoid assignment for unused macro argument
  • Loading branch information
Linus Torvalds committed May 4, 2020
2 parents a16a47e + c752737 commit 9851a0d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions scripts/gcc-plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ GCC_PLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti
HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb
HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat
HOST_EXTRACXXFLAGS += -Wno-format-diag

$(obj)/randomize_layout_plugin.o: $(objtree)/$(obj)/randomize_layout_seed.h
quiet_cmd_create_randomize_layout_seed = GENSEED $@
Expand Down
4 changes: 4 additions & 0 deletions scripts/gcc-plugins/gcc-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
#include "ggc.h"
#include "timevar.h"

#if BUILDING_GCC_VERSION < 10000
#include "params.h"
#endif

#if BUILDING_GCC_VERSION <= 4009
#include "pointer-set.h"
Expand Down Expand Up @@ -847,6 +849,7 @@ static inline gimple gimple_build_assign_with_ops(enum tree_code subcode, tree l
return gimple_build_assign(lhs, subcode, op1, op2 PASS_MEM_STAT);
}

#if BUILDING_GCC_VERSION < 10000
template <>
template <>
inline bool is_a_helper<const ggoto *>::test(const_gimple gs)
Expand All @@ -860,6 +863,7 @@ inline bool is_a_helper<const greturn *>::test(const_gimple gs)
{
return gs->code == GIMPLE_RETURN;
}
#endif

static inline gasm *as_a_gasm(gimple stmt)
{
Expand Down
5 changes: 2 additions & 3 deletions scripts/gcc-plugins/stackleak_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ static void stackleak_add_track_stack(gimple_stmt_iterator *gsi, bool after)
gimple stmt;
gcall *stackleak_track_stack;
cgraph_node_ptr node;
int frequency;
basic_block bb;

/* Insert call to void stackleak_track_stack(void) */
Expand All @@ -68,9 +67,9 @@ static void stackleak_add_track_stack(gimple_stmt_iterator *gsi, bool after)
bb = gimple_bb(stackleak_track_stack);
node = cgraph_get_create_node(track_function_decl);
gcc_assert(node);
frequency = compute_call_stmt_bb_frequency(current_function_decl, bb);
cgraph_create_edge(cgraph_get_node(current_function_decl), node,
stackleak_track_stack, bb->count, frequency);
stackleak_track_stack, bb->count,
compute_call_stmt_bb_frequency(current_function_decl, bb));
}

static bool is_alloca(gimple stmt)
Expand Down

0 comments on commit 9851a0d

Please sign in to comment.