Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] gcc-8.2.0-r3: Plugins not supported?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
toofied
n00b
n00b


Joined: 26 Oct 2016
Posts: 28

PostPosted: Sat Oct 06, 2018 2:33 pm    Post subject: [Solved] gcc-8.2.0-r3: Plugins not supported? Reply with quote

Not sure what I'm doing wrong here or if I found a bug. I seem to remember this working perfectly in gcc7, but recently re-installed Gentoo on the testing branch.

During gen-kernel, if GCC plugins are enabled:

Code:

* ERROR: Failed to compile the "prepare" target...
*
* -- Grepping log... --
*
*  HOSTCC  arch/x86/tools/relocs_common.o
*  HOSTLD  arch/x86/tools/relocs
*In file included from ./scripts/gcc-plugins/gcc-common.h:87,
*                 from <stdin>:1:
*/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/plugin/include/attribs.h: In function ‘tree_node* canonicalize_attr_name(tree)’:
*/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/plugin/include/attribs.h:118:12: error: ‘get_identifier_with_length’ was not declared in this scope
*--
*/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/plugin/include/attribs.h:118:12: note: suggested alternative: ‘get_attr_min_length’
*     return get_identifier_with_length (s + 2, l - 4);
*            ^~~~~~~~~~~~~~~~~~~~~~~~~~
*            get_attr_min_length
*Cannot use CONFIG_GCC_PLUGINS: your gcc installation does not support plugins, perhaps the necessary headers are missing?
*make: *** [scripts/Makefile.gcc-plugins:52: gcc-plugins-check] Error 1
*--
* Running with options: --kernel-config=/kernel.config all
* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..
*
* ERROR: Failed to compile the "prepare" target...
*
* -- End log... --


This is a standard x86 computer on a 4.9.x kernel.

Any ideas?


Last edited by toofied on Sun Oct 07, 2018 5:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Sat Oct 06, 2018 11:35 pm    Post subject: Reply with quote

Looks like gcc8 causes problems indeed. What kernel are you trying to compile?

It seems like there were some kernel commits that were done to make gcc8 happy, but they may not have been backported to 4.9.x kernels... So you'll have to either backport, upgrade the kernel, or go back to gcc7.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30911
Location: here

PostPosted: Sun Oct 07, 2018 6:30 am    Post subject: Reply with quote

https://groups.google.com/forum/#!topic/qubes-devel/Q3cdQKQS4Tk

[Moderator edit: fixed [url] tag. Forum auto-linking does not work when the URL contains exclamations. -Hu]
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
toofied
n00b
n00b


Joined: 26 Oct 2016
Posts: 28

PostPosted: Sun Oct 07, 2018 3:04 pm    Post subject: Backported! Reply with quote

fedeliallalinea wrote:
https://groups.google.com/forum/#!topic/qubes-devel/Q3cdQKQS4Tk


Thanks, this solved it for me in 4.9.131:

Code:

diff -ru a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
--- a/scripts/gcc-plugins/gcc-common.h   2018-10-03 20:01:55.000000000 -0400
+++ b/scripts/gcc-plugins/gcc-common.h   2018-10-07 10:11:18.458335576 -0400
@@ -83,6 +83,10 @@
 #include "predict.h"
 #include "ipa-utils.h"
 
+#if BUILDING_GCC_VERSION >= 8000
+#include "stringpool.h"
+#endif
+
 #if BUILDING_GCC_VERSION >= 4009
 #include "attribs.h"
 #include "varasm.h"
diff -ru a/scripts/gcc-plugins/latent_entropy_plugin.c b/scripts/gcc-plugins/latent_entropy_plugin.c
--- a/scripts/gcc-plugins/latent_entropy_plugin.c   2018-10-03 20:01:55.000000000 -0400
+++ b/scripts/gcc-plugins/latent_entropy_plugin.c   2018-10-07 10:10:52.786337142 -0400
@@ -255,21 +255,14 @@
    return NULL_TREE;
 }
 
-static struct attribute_spec latent_entropy_attr = {
-   .name            = "latent_entropy",
-   .min_length         = 0,
-   .max_length         = 0,
-   .decl_required         = true,
-   .type_required         = false,
-   .function_type_required      = false,
-   .handler         = handle_latent_entropy_attribute,
-#if BUILDING_GCC_VERSION >= 4007
-   .affects_type_identity      = false
-#endif
-};
+static struct attribute_spec latent_entropy_attr = { };
 
 static void register_attributes(void *event_data __unused, void *data __unused)
 {
+   latent_entropy_attr.name      = "latent_entropy";
+   latent_entropy_attr.decl_required   = true;
+   latent_entropy_attr.handler      = handle_latent_entropy_attribute;
+
    register_attribute(&latent_entropy_attr);
 }
 
Back to top
View user's profile Send private message
nsoveiko
n00b
n00b


Joined: 04 Dec 2004
Posts: 53
Location: somewhere over the rainbow

PostPosted: Wed Feb 27, 2019 8:46 pm    Post subject: same problem now in stable Reply with quote

i will revive this thread as gcc-8.2 is now in stable and i've just encountered the same problem:
Code:
/usr/src/linux-4.9.158-gentoo # make -j2 -l3
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTLD  arch/x86/tools/relocs
In file included from ./scripts/gcc-plugins/gcc-common.h:87,
                 from <stdin>:1:
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/plugin/include/attribs.h: In function ‘tree_node* canonicalize_attr_name(tree)’:
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/plugin/include/attribs.h:118:12: error: ‘get_identifier_with_length’ was not declared in this scope
     return get_identifier_with_length (s + 2, l - 4);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/plugin/include/attribs.h:118:12: note: suggested alternative: ‘get_attr_min_length’
     return get_identifier_with_length (s + 2, l - 4);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
            get_attr_min_length
Cannot use CONFIG_GCC_PLUGINS: your gcc installation does not support plugins, perhaps the necessary headers are missing?
make: *** [scripts/Makefile.gcc-plugins:52: gcc-plugins-check] Error 1

Code:
/usr/src/linux-4.9.158-gentoo # gcc --version
gcc (Gentoo Hardened 8.2.0-r6 p1.7) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

this was supposed to have been fixed in kernel 4.9.131 (according to toofied's post above), yet still present in 4.9.158.

are there better options besides rolling gcc back to 7.x?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum