problem with gcc-plugin-devel.

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

Re: problem with gcc-plugin-devel.

Postby PaX Team » Mon Aug 03, 2015 4:32 pm

can you run scripts/gcc-plugin.sh as described in an earlier comment above?
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: problem with gcc-plugin-devel.

Postby specs05 » Mon Aug 03, 2015 7:28 pm

$ gcc -E -shared - -o /dev/null -I`gcc -print-file-name=plugin`/include 2>&1 <<EOF
> #include "gcc-plugin.h"
> #include "tree.h"
> #include "tm.h"
> #include "rtl.h"
> #ifdef ENABLE_BUILD_WITH_CXX
> #warning g++
> #else
> #warning gcc
> #endif
> EOF
In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/hash-set.h:24:0,
from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:33,
from <stdin>:1:
/usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/hash-table.h:201:15: fatal error: new: No such file or directory
compilation terminated.
specs05
 
Posts: 7
Joined: Mon Aug 03, 2015 2:49 pm

Re: problem with gcc-plugin-devel.

Postby specs05 » Mon Aug 03, 2015 7:35 pm

This is where it goes wrong.
It looks like it can't deal with "include <new>"
#define TYPED_HASHTAB_H

#include "ggc.h"
#include "hashtab.h"
#include <new>

template<typename, typename, typename> class hash_map;
template<typename, typename> class hash_set;
specs05
 
Posts: 7
Joined: Mon Aug 03, 2015 2:49 pm

Re: problem with gcc-plugin-devel.

Postby PaX Team » Mon Aug 03, 2015 7:36 pm

edit: oops, misread the message ;). run the script with "g++ g++ gcc" as params then we'll see what's actually wrong.
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: problem with gcc-plugin-devel.

Postby micah » Tue Aug 04, 2015 6:35 pm

I had this problem with gcc5 and debian sid with the plugins installed, I ended up finding out that I needed to also make sure I had the libmpc-dev package installed
micah
 
Posts: 7
Joined: Tue Aug 04, 2015 4:56 pm

Re: problem with gcc-plugin-devel.

Postby specs05 » Wed Aug 05, 2015 2:04 am

@micah: this is what I'm expecting. It just looks like some basic dependency is missing. I saw earlier that dev-packages hardly ever user dependencies.
Alas it is not libmpc-dev.

@pax team
I suppose you mean the commands you mentioned which can be used from the commandline, since I can't find another script?
Where should I put the extra parameters?
(Sorry, not much of a programmer myself.)
specs05
 
Posts: 7
Joined: Mon Aug 03, 2015 2:49 pm

Re: problem with gcc-plugin-devel.

Postby specs05 » Wed Aug 05, 2015 1:25 pm

According upstream:
Not a bug, all plugins have to be compiled as C++ with 5 and above.
> ENABLE_BUILD_WITH_CXX was removed because it is all C++ code now.

I understand there can be no good result from the script since the check is bogus, but I don't understand why the script fails like it does though.
specs05
 
Posts: 7
Joined: Mon Aug 03, 2015 2:49 pm

Re: problem with gcc-plugin-devel.

Postby PaX Team » Thu Aug 06, 2015 1:37 pm

go to your linux source directory and issue bash -x ./scripts/gcc-plugin.sh g++ g++ gcc and show me the output.
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Postby specs05 » Thu Aug 06, 2015 2:32 pm

First thanks to micah, the missing package did indeed result in a working kernel compilation (gcc-5.2.1, kernel 4.1.4,grsecurity-3.1-4.1.4-201508032312.patch).
It seems I did just anything except building a new kernel.

Second, since I asked PAX team for advice, perhaps this helps somewhat
Code: Select all
$  bash -x ./scripts/gcc-plugin.sh g++ g++ gcc
++ dirname ./scripts/gcc-plugin.sh
+ srctree=./scripts
++ gcc -print-file-name=plugin
+ gccplugins_dir=/usr/lib/gcc/x86_64-linux-gnu/5/plugin
++ g++ -E -x c++ - -o /dev/null -I./scripts/../tools/gcc -I/usr/lib/gcc/x86_64-linux-gnu/5/plugin/include
+ plugincc='<stdin>:3:2: warning: #warning g++ CXX [-Wcpp]'
+ '[' 0 -ne 0 ']'
+ case "$plugincc" in
++ g++ -c -x c++ -std=gnu++98 - -fsyntax-only -I./scripts/../tools/gcc -I/usr/lib/gcc/x86_64-linux-gnu/5/plugin/include
+ plugincc=
+ '[' 0 -eq 0 ']'
+ echo g++
g++
+ exit 0
$ bash -x ./scripts/gcc-plugin.sh
++ dirname ./scripts/gcc-plugin.sh
+ srctree=./scripts
++ -print-file-name=plugin
./scripts/gcc-plugin.sh: line 3: -print-file-name=plugin: command not found
+ gccplugins_dir=
++ -E -x c++ - -o /dev/null -I./scripts/../tools/gcc -I/include
+ plugincc='./scripts/gcc-plugin.sh: line 12: -E: command not found'
+ '[' 127 -ne 0 ']'
+ exit 1

Sorry for not understanding the solution you (both) provided sooner.

Thanks again for your efforts.
specs05
 
Posts: 7
Joined: Mon Aug 03, 2015 2:49 pm

Re: problem with gcc-plugin-devel.

Postby temporary_user » Tue Aug 25, 2015 5:00 pm

Note that on latest debian sid, as of today, having gcc-5-plugin-dev is not enough :
Code: Select all
$ bash -x ./scripts/gcc-plugin.sh gcc g++ gcc
++ dirname ./scripts/gcc-plugin.sh
+ srctree=./scripts
++ gcc -print-file-name=plugin
+ gccplugins_dir=/usr/lib/gcc/x86_64-linux-gnu/5/plugin
++ gcc -E -x c++ - -o /dev/null -I./scripts/../tools/gcc -I/usr/lib/gcc/x86_64-linux-gnu/5/plugin/include
+ plugincc='In file included from ./scripts/../tools/gcc/gcc-common.h:133:0,
                 from <stdin>:1:
/usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/builtins.h:23:17: fatal error: mpc.h: No such file or directory
compilation terminated.'
+ '[' 1 -ne 0 ']'
+ exit 1


The mpc.h file is found in the libmpc-dev package. Installing it fixes the issue above, as expected.
temporary_user
 
Posts: 1
Joined: Tue Aug 25, 2015 4:55 pm

Previous

Return to grsecurity support