FORUMS

New Xposed for Lollipop 5.0 Update Fixes Major Bugs

Senior Recognized Developer rovo89 has patched Xposed for Lollipop 5.0 to … more

Download Sony’s new AOSP-like concept for Xperia Z3

Over in our forums, Recognized Contributor Jozinek has posted a very … more

OnePlus 2 vs Moto X Style: Which is The Better Flagship?

Two big industry names have announced their newest flagship phones within the … more

Making Your Own Xposed Modules Is Easier Than You Think

Close to the heart of XDA is the Xposed Framework by Rovo89. Most of … more

Kernel Compiling Error

114 posts
Thanks Meter: 120
 
By srsdani, Senior Member on 13th April 2014, 05:07 PM
Post Reply Subscribe to Thread Email Thread
Code:
  CC      net/netfilter/xt_qtaguid.o
  CC      net/netfilter/xt_quota.o
  CC      net/netfilter/xt_quota2.o
  CC      net/netfilter/xt_socket.o
In file included from include/linux/kernel.h:23:0,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:7,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from net/netfilter/xt_socket.c:13:
net/netfilter/xt_socket.c: In function 'xt_socket_get4_sk':
include/linux/dynamic_debug.h:75:21: warning: 'protocol' may be used uninitialized in this function [-Wmaybe-uninitialized]
error, forbidden warning: dynamic_debug.h:75
make[2]: *** [net/netfilter/xt_socket.o] Error 1
make[1]: *** [net/netfilter] Error 2
make: *** [net] Error 2
srsdani@ubuntu:~/kernel$
Original file here.
I'm using ndk gcc 4.8. This error is present also on gcc 4.7. The only way to get rid of this error is to use toolchain 4.6. I need to compile it using a newer toolchain, that's why I request your help.
 
 
13th April 2014, 08:48 PM |#2  
OP Senior Member
Galati
Thanks Meter: 120
 
More
Any ideas?
14th April 2014, 04:08 AM |#3  
Junior Member
Flag Somewhere in India!!
Thanks Meter: 16
 
More
Kernel Compilation
Quote:
Originally Posted by srsdani

Code:
  CC      net/netfilter/xt_qtaguid.o
  CC      net/netfilter/xt_quota.o
  CC      net/netfilter/xt_quota2.o
  CC      net/netfilter/xt_socket.o
In file included from include/linux/kernel.h:23:0,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:7,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from net/netfilter/xt_socket.c:13:
net/netfilter/xt_socket.c: In function 'xt_socket_get4_sk':
include/linux/dynamic_debug.h:75:21: warning: 'protocol' may be used uninitialized in this function [-Wmaybe-uninitialized]
error, forbidden warning: dynamic_debug.h:75
make[2]: *** [net/netfilter/xt_socket.o] Error 1
make[1]: *** [net/netfilter] Error 2
make: *** [net] Error 2
srsdani@ubuntu:~/kernel$
Original file here.
I'm using ndk gcc 4.8. This error is present also on gcc 4.7. The only way to get rid of this error is to use toolchain 4.6. I need to compile it using a newer toolchain, that's why I request your help.

I guess you are looking on another file.

Code:
error, forbidden warning: dynamic_debug.h:75
I guess there is a problem in dynamic_debug.h in line 75. I guess you need to initialise something.
The Following User Says Thank You to #Su For This Useful Post: [ View ]
14th April 2014, 11:53 AM |#4  
OP Senior Member
Galati
Thanks Meter: 120
 
More
Here is dynamic_debug.h but I can't find the problem.
14th April 2014, 05:33 PM |#5  
OP Senior Member
Galati
Thanks Meter: 120
 
More
I will appreciate any opinion.
15th April 2014, 02:28 AM |#6  
Junior Member
Flag Somewhere in India!!
Thanks Meter: 16
 
More
Smile Try this method!
Quote:
Originally Posted by srsdani

Here is dynamic_debug.h but I can't find the problem.

I am not much used to kernel related development but I analysed your dynamic_debug.h and found the problem (maybe a problem):

Normally, a do-while loop syntax is this:
Code:
do
{
 Statement1;
 Statement2;
 ...
}while(condition);
But I don't see a semicolon in the end of those loops in your code. This maybe a syntax error.

Also analyse these codes:
Code:
#if defined(CONFIG_DYNAMIC_DEBUG)
extern int ddebug_remove_module(const char *mod_name);
extern __printf(2, 3)
int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...);

struct device;

extern __printf(3, 4)
int __dynamic_dev_dbg(struct _ddebug *descriptor, const struct device *dev,
                      const char *fmt, ...);

struct net_device;

extern __printf(3, 4)
int __dynamic_netdev_dbg(struct _ddebug *descriptor,
                         const struct net_device *dev,
                         const char *fmt, ...);
Every intialisation has 4 protocols but the first initialisation contain only 3.
Try the above things and tell me back if it works or not.
The Following User Says Thank You to #Su For This Useful Post: [ View ]
16th April 2014, 03:14 PM |#7  
OP Senior Member
Galati
Thanks Meter: 120
 
More
So, the problem was in Makefile and .config. I compared and added some flags from Mako (from franco) and it worked. I still have some warning/s, some breakpoints but at least now it's working. Anyway, this thread may be useful for all of us. Thanks a lot for help.
Now, another problem.
Code:
  CC      fs/proc/loadavg.o
  CC      fs/proc/meminfo.o
fs/proc/meminfo.c: In function ‘meminfo_proc_show’:
fs/proc/meminfo.c:175:1: internal compiler error: in optimize_sc, at modulo-sched.c:1069
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.launchpad.net/gcc-linaro> for instructions.
make[2]: *** [fs/proc/meminfo.o] Error 1
make[1]: *** [fs/proc] Error 2
make: *** [fs] Error 2
srsdani@ubuntu:~/kernel2$
With linaro 4.8.3 => OK;
linaro 4.8.3 + A15 optimize=> fail, error above. meminfo.c it's exactly like the one from nexus 4.
FIX: compiler bug;
Last edited by srsdani; 5th June 2014 at 09:32 PM.
23rd March 2015, 11:51 AM |#8  
Senior Member
Flag Melbourne
Thanks Meter: 25
 
More
Quote:
Originally Posted by srsdani

Code:
  CC      net/netfilter/xt_qtaguid.o
  CC      net/netfilter/xt_quota.o
  CC      net/netfilter/xt_quota2.o
  CC      net/netfilter/xt_socket.o
In file included from include/linux/kernel.h:23:0,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:7,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from net/netfilter/xt_socket.c:13:
net/netfilter/xt_socket.c: In function 'xt_socket_get4_sk':
include/linux/dynamic_debug.h:75:21: warning: 'protocol' may be used uninitialized in this function [-Wmaybe-uninitialized]
error, forbidden warning: dynamic_debug.h:75
make[2]: *** [net/netfilter/xt_socket.o] Error 1
make[1]: *** [net/netfilter] Error 2
make: *** [net] Error 2
srsdani@ubuntu:~/kernel$
Original file here.
I'm using ndk gcc 4.8. This error is present also on gcc 4.7. The only way to get rid of this error is to use toolchain 4.6. I need to compile it using a newer toolchain, that's why I request your help.

Hey sarsdani Apologies that I'm quoting you 12 month later. I am getting an identical error in the same file/address as you had when you posted this question. Im compiling stock HTC m7 Android L kernel with Google tool chain 4.8 - android 5.1 r1
You mentioned later on that you changed the Makefile and .config to fix the [-Wmaybe-uninitialized] error. Can you please detail what those changes were or point me to an example ( if you can remember ) I could just change Wmaybe in Makefile to Wno but turning the flag off altogether seems dangerous.
25th March 2015, 08:47 PM |#9  
OP Senior Member
Galati
Thanks Meter: 120
 
More
@Joeisgood99 there are two ways to solve this.
1. using a "hack". So, you need to add in makefile (in root folder from kernel source) at KBUILD_CFLAGS: -Wno-maybe-uninitialized \
2. Open that file with the error and asign a value to protocol.

The first option is not dangerous. Why? Because only the toolchain say this. In gcc 4.6, the reason why you don't get this error is because it assign a value automatically to that "protocol", usualy random value but not always. In gcc 4.7/4.8/4.9(or 4.10) this is threated as warning/error.
Last edited by srsdani; 25th March 2015 at 08:55 PM.
The Following User Says Thank You to srsdani For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes