Enable ZRam Compile Error

Search This thread

AAccount

Senior Member
Sep 8, 2010
1,005
1,909
Sorry for bugging everyone again, but I'm in the process of trying to make my kernel and I enabled zram (since it worked for my GTab 10.1). Haven't modified any of the zram code. However, I got this compile error

Code:
drivers/gud/built-in.o: In function `.LANCHOR0':
mcDrvModule.c:(.data+0x0): multiple definition of `devices'
drivers/staging/built-in.o:xvmalloc.c:(.bss+0x3c0b50): first defined here
/home/Daniel/GTab10.1Dev/arm-2012.03/bin/arm-none-linux-gnueabi-ld: Warning: size of symbol `devices' changed from 4 in drivers/staging/built-in.o to 8 in drivers/gud/built-in.o
make[1]: *** [drivers/built-in.o] Error 1
make: *** [drivers] Error 2

Not exactly sure why this happens considering i haven't touched any of the gud drivers of staging/zram drivers at all.
 

garyd9

Inactive Recognized Developer
Sep 13, 2006
2,644
2,730
50
Pittsburgh, PA
Which device? Based on your sig (and which section you are posting in) I'd guess the i9300, but based on the error message (in particular "/home/Daniel/GTab10.1Dev/"), I'd guess your working on the gtab 10.1 kernel.

Perhaps a full set of steps to repeat? How did you go about enabling zram, stock kernel source or something else? Which toolchain?

Finally, do you understand the error? I won't criticize you if you don't, but it's pretty obvious (at least to me) what the error message is saying and how you should go about digging into it a bit deeper.

Take care
Gary
 
  • Like
Reactions: AAccount

AAccount

Senior Member
Sep 8, 2010
1,005
1,909
Which device? Based on your sig (and which section you are posting in) I'd guess the i9300, but based on the error message (in particular "/home/Daniel/GTab10.1Dev/"), I'd guess your working on the gtab 10.1 kernel.

Perhaps a full set of steps to repeat? How did you go about enabling zram, stock kernel source or something else? Which toolchain?

Finally, do you understand the error? I won't criticize you if you don't, but it's pretty obvious (at least to me) what the error message is saying and how you should go about digging into it a bit deeper.

Take care
Gary

No, I'm not working on the galaxy tab 10.1 kernel. It's just that all the stuff needed (tool chain, where I keep my modifications) are in that folder so I'm just sticking with it. The way I enabled zram was just to enable it in .config "CONFIG_ZRAM=1" which then asked me if I wanted to enable the "zram for android" feature which I said yes. The kernel souce I'm using is the CM10.1 smdk4412 source since I use cyanogenmod. I am using the code sourcey march 2012 tool chain.

I did attempt to find a fix to the problem based on what little bit I know. In both the zram driver or the "gud" driver I'm guessing the same variable or structure is defined twice but differently each time. I think this is analogous to being 2 people at once? I did a grep in file text search to see where either a variable or structure named "devices" would have been defined. In neither of those folders did I find "devices". Yes, admittedly I'm no top dog developer and make modifications I can for personal enjoyment and maybe publication if it seems worthy.

But yeah, I didn't find anywhere in the gud or zram drivers where "devices" is being named/defined as a variable or structure. If I did find it, wouldn't it be easier to make the one with the smaller definition size bigger since going the other way would cut off data while a bit of extra storage never hurt? That's when I was planning to go with.

I'm sorry if the fix is so obvious.
 

garyd9

Inactive Recognized Developer
Sep 13, 2006
2,644
2,730
50
Pittsburgh, PA
Sorry if my reply seemed confrontational... it wasn't intended that way...

I don't have the cm10 code handy on my phone (and won't be able to pull it and test compile for another day or so.)

However, can you try to rebuild the kernel after a "make clean" (or maybe a make target of mrproper even)? Also turn off ccache if you're using it. If that doesn't work, can you please post the kernel config so that someone else can drop it in and see if they get a similar result?


Sent from my SAMSUNG-SGH-I317 using Tapatalk 2
 
  • Like
Reactions: AAccount

AAccount

Senior Member
Sep 8, 2010
1,005
1,909
Sorry if my reply seemed confrontational... it wasn't intended that way...

I don't have the cm10 code handy on my phone (and won't be able to pull it and test compile for another day or so.)

However, can you try to rebuild the kernel after a "make clean" (or maybe a make target of mrproper even)? Also turn off ccache if you're using it. If that doesn't work, can you please post the kernel config so that someone else can drop it in and see if they get a similar result?


Sent from my SAMSUNG-SGH-I317 using Tapatalk 2

I didn't take it as confrontational. :) I like to say it's better to admit your short comings than to fake what you're not. I did do a make clean before starting. I'll paste in the relevant .config changes tomorrow.
 

NeoPhyTe.x360

Retired Recognized Developer
Aug 20, 2009
1,663
1,850
oυτ oƒ иoωнєяє
Search inside the code of zram_dev.c (drivers/staging/zram/zram_drv.c), now search the word: "num_devices";

It should appear something like;
Code:
	if (!num_devices) {
		pr_info("num_devices not specified. Using default: 1\n");
[B]		num_devices = 1;[/B]
	}

there should appear value of 4 or 8; If the value there is 8, change it to 4, and if its value is 4, change it to 8



I don't know sure, but maybe you could fix it like this, or searching with grep -r "devices" /kernel/drivers/gud (and staging), and changing it with those values mentioned above
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Which device? Based on your sig (and which section you are posting in) I'd guess the i9300, but based on the error message (in particular "/home/Daniel/GTab10.1Dev/"), I'd guess your working on the gtab 10.1 kernel.

    Perhaps a full set of steps to repeat? How did you go about enabling zram, stock kernel source or something else? Which toolchain?

    Finally, do you understand the error? I won't criticize you if you don't, but it's pretty obvious (at least to me) what the error message is saying and how you should go about digging into it a bit deeper.

    Take care
    Gary
    1
    Sorry if my reply seemed confrontational... it wasn't intended that way...

    I don't have the cm10 code handy on my phone (and won't be able to pull it and test compile for another day or so.)

    However, can you try to rebuild the kernel after a "make clean" (or maybe a make target of mrproper even)? Also turn off ccache if you're using it. If that doesn't work, can you please post the kernel config so that someone else can drop it in and see if they get a similar result?


    Sent from my SAMSUNG-SGH-I317 using Tapatalk 2
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone