Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,740,011 Members 39,129 Now Online
XDA Developers Android and Mobile Development Forum

Kernel Compiling Error

Tip us?
 
srsdani
Old
#1  
Senior Member - OP
Thanks Meter 86
Posts: 104
Join Date: Jan 2011
Location: Galati
Exclamation Kernel Compiling Error

Code:
Select 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.
Sorry for my english.
k810-2*k850-Xperia X8(10w48+2*12w03)-Acer Cloudmobile.
Donate for a good cause
 
srsdani
Old
#2  
Senior Member - OP
Thanks Meter 86
Posts: 104
Join Date: Jan 2011
Location: Galati
Any ideas?
Sorry for my english.
k810-2*k850-Xperia X8(10w48+2*12w03)-Acer Cloudmobile.
Donate for a good cause
 
#Su
Old
#3  
Junior Member
Thanks Meter 16
Posts: 20
Join Date: Mar 2014
Location: Somewhere in India!!
Default Kernel Compilation

Quote:
Originally Posted by srsdani View Post
Code:
Select 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:
Select 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: [ Click to Expand ]
 
srsdani
Old
#4  
Senior Member - OP
Thanks Meter 86
Posts: 104
Join Date: Jan 2011
Location: Galati
Here is dynamic_debug.h but I can't find the problem.
Sorry for my english.
k810-2*k850-Xperia X8(10w48+2*12w03)-Acer Cloudmobile.
Donate for a good cause
 
srsdani
Old
#5  
Senior Member - OP
Thanks Meter 86
Posts: 104
Join Date: Jan 2011
Location: Galati
I will appreciate any opinion.
Sorry for my english.
k810-2*k850-Xperia X8(10w48+2*12w03)-Acer Cloudmobile.
Donate for a good cause
 
#Su
Old
#6  
Junior Member
Thanks Meter 16
Posts: 20
Join Date: Mar 2014
Location: Somewhere in India!!
Smile Try this method!

Quote:
Originally Posted by srsdani View Post
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:
Select 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:
Select 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: [ Click to Expand ]
 
srsdani
Old
(Last edited by srsdani; 5th June 2014 at 09:32 PM.)
#7  
Senior Member - OP
Thanks Meter 86
Posts: 104
Join Date: Jan 2011
Location: Galati
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:
Select 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;
Sorry for my english.
k810-2*k850-Xperia X8(10w48+2*12w03)-Acer Cloudmobile.
Donate for a good cause

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...