Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'gcc-plugins-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull gcc plugin fixes from Kees Cook:
- make sure required exports from gcc plugins are visible to gcc
- switch latent_entropy to unsigned long to avoid stack frame bloat

* tag 'gcc-plugins-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
latent_entropy: Fix wrong gcc code generation with 64 bit variables
gcc-plugins: Export symbols needed by gcc

+18 -18
+1 -1
mm/page_alloc.c
··· 92 92 #endif 93 93 94 94 #ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY 95 - volatile u64 latent_entropy __latent_entropy; 95 + volatile unsigned long latent_entropy __latent_entropy; 96 96 EXPORT_SYMBOL(latent_entropy); 97 97 #endif 98 98
+2 -2
scripts/gcc-plugins/cyc_complexity_plugin.c
··· 20 20 21 21 #include "gcc-common.h" 22 22 23 - int plugin_is_GPL_compatible; 23 + __visible int plugin_is_GPL_compatible; 24 24 25 25 static struct plugin_info cyc_complexity_plugin_info = { 26 26 .version = "20160225", ··· 49 49 50 50 #include "gcc-generate-gimple-pass.h" 51 51 52 - int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) 52 + __visible int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) 53 53 { 54 54 const char * const plugin_name = plugin_info->base_name; 55 55 struct register_pass_info cyc_complexity_pass_info;
+1
scripts/gcc-plugins/gcc-common.h
··· 130 130 #endif 131 131 132 132 #define __unused __attribute__((__unused__)) 133 + #define __visible __attribute__((visibility("default"))) 133 134 134 135 #define DECL_NAME_POINTER(node) IDENTIFIER_POINTER(DECL_NAME(node)) 135 136 #define DECL_NAME_LENGTH(node) IDENTIFIER_LENGTH(DECL_NAME(node))
+12 -13
scripts/gcc-plugins/latent_entropy_plugin.c
··· 77 77 78 78 #include "gcc-common.h" 79 79 80 - int plugin_is_GPL_compatible; 80 + __visible int plugin_is_GPL_compatible; 81 81 82 82 static GTY(()) tree latent_entropy_decl; 83 83 ··· 340 340 break; 341 341 } 342 342 if (rhs) 343 - *rhs = build_int_cstu(unsigned_intDI_type_node, random_const); 343 + *rhs = build_int_cstu(long_unsigned_type_node, random_const); 344 344 return op; 345 345 } 346 346 ··· 372 372 enum tree_code op; 373 373 374 374 /* 1. create temporary copy of latent_entropy */ 375 - temp = create_var(unsigned_intDI_type_node, "tmp_latent_entropy"); 375 + temp = create_var(long_unsigned_type_node, "temp_latent_entropy"); 376 376 377 377 /* 2. read... */ 378 378 add_referenced_var(latent_entropy_decl); ··· 459 459 gsi_insert_before(&gsi, call, GSI_NEW_STMT); 460 460 update_stmt(call); 461 461 462 - udi_frame_addr = fold_convert(unsigned_intDI_type_node, frame_addr); 462 + udi_frame_addr = fold_convert(long_unsigned_type_node, frame_addr); 463 463 assign = gimple_build_assign(local_entropy, udi_frame_addr); 464 464 gsi_insert_after(&gsi, assign, GSI_NEW_STMT); 465 465 update_stmt(assign); 466 466 467 467 /* 3. create temporary copy of latent_entropy */ 468 - tmp = create_var(unsigned_intDI_type_node, "tmp_latent_entropy"); 468 + tmp = create_var(long_unsigned_type_node, "temp_latent_entropy"); 469 469 470 470 /* 4. read the global entropy variable into local entropy */ 471 471 add_referenced_var(latent_entropy_decl); ··· 480 480 update_stmt(assign); 481 481 482 482 rand_cst = get_random_const(); 483 - rand_const = build_int_cstu(unsigned_intDI_type_node, rand_cst); 483 + rand_const = build_int_cstu(long_unsigned_type_node, rand_cst); 484 484 op = get_op(NULL); 485 485 assign = create_assign(op, local_entropy, local_entropy, rand_const); 486 486 gsi_insert_after(&gsi, assign, GSI_NEW_STMT); ··· 529 529 } 530 530 531 531 /* 1. create the local entropy variable */ 532 - local_entropy = create_var(unsigned_intDI_type_node, "local_entropy"); 532 + local_entropy = create_var(long_unsigned_type_node, "local_entropy"); 533 533 534 534 /* 2. initialize the local entropy variable */ 535 535 init_local_entropy(bb, local_entropy); ··· 561 561 if (in_lto_p) 562 562 return; 563 563 564 - /* extern volatile u64 latent_entropy */ 565 - gcc_assert(TYPE_PRECISION(long_long_unsigned_type_node) == 64); 566 - quals = TYPE_QUALS(long_long_unsigned_type_node) | TYPE_QUAL_VOLATILE; 567 - type = build_qualified_type(long_long_unsigned_type_node, quals); 564 + /* extern volatile unsigned long latent_entropy */ 565 + quals = TYPE_QUALS(long_unsigned_type_node) | TYPE_QUAL_VOLATILE; 566 + type = build_qualified_type(long_unsigned_type_node, quals); 568 567 id = get_identifier("latent_entropy"); 569 568 latent_entropy_decl = build_decl(UNKNOWN_LOCATION, VAR_DECL, id, type); 570 569 ··· 583 584 | TODO_update_ssa 584 585 #include "gcc-generate-gimple-pass.h" 585 586 586 - int plugin_init(struct plugin_name_args *plugin_info, 587 - struct plugin_gcc_version *version) 587 + __visible int plugin_init(struct plugin_name_args *plugin_info, 588 + struct plugin_gcc_version *version) 588 589 { 589 590 bool enabled = true; 590 591 const char * const plugin_name = plugin_info->base_name;
+2 -2
scripts/gcc-plugins/sancov_plugin.c
··· 21 21 22 22 #include "gcc-common.h" 23 23 24 - int plugin_is_GPL_compatible; 24 + __visible int plugin_is_GPL_compatible; 25 25 26 26 tree sancov_fndecl; 27 27 ··· 86 86 #endif 87 87 } 88 88 89 - int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) 89 + __visible int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) 90 90 { 91 91 int i; 92 92 struct register_pass_info sancov_plugin_pass_info;