HOSTCC vs CC and other nits
I think Phil (with help from Alex) broke kernel builds...
While trying to creatively fix the init_task_union alignment garbage, I can't build anymore....Here's the problems:
o I don't have and don't want a native gcc. I want to know when things are building for the native or cross environment. That means use HOSTCC (instead of $(CC)) in the Makefiles. I can then do "make vmlinux HOSTCC=cc".
o I don't have obj_dump. And I haven't the faintest clue where to find it. Could we use nm instead?
o I looked at checkalign.c and am feeling a bit confused. Why is the code testing for 4K alignment?
I though the requirement was 8K alignement...
I fixed the first problem.
Here another idea for the second two:
/usr/bin/nm vmlinux |awk '/init_task_union/ {
n = int($2); t = int(n/8192); t *= 8192;
if (n != t) {
print NOT
}
printf("0x%x vs 0x%x\n", n, t)
}' FS=\|Perl is probably better for this kind of stuff (has "&" operator which is missing from awk). But I'm not a very good perl hacker...
enjoy,
grant
Grant Grundler
Communications Infrastructure Computer Operations
+1.408.447.7253
Quoted 2 lines · Grant Grundler
o I don't have
obj_dump. And I haven't the faintest clue where to find it. Could we use nm instead?
objdump is part of GNU binutils. I'm not sure why we use it rather than nm.
Signature · 4 lines
Matthew Wilcox <[email protected]> "Windows and MacOS are products, contrived by engineers in the service of specific companies. Unix, by contrast, is not so much a product as it is a painstakingly compiled oral history of the hacker subculture." - N Stephenson
Quoted 2 lines · Grant Grundler
That means use HOSTCC (instead of $(CC)) in the Makefiles. I can then do "make vmlinux HOSTCC=cc".
Oops. Understandable desire, you're right of course.
Quoted 2 lines
o I don't have
obj_dump. And I haven't the faintest clue where to find it. Could we use nm instead?
It's part of GNU binutils, which I thought we required to build the kernel anyways?
Quoted 3 lines
o I looked at
checkalign.cand am feeling a bit confused. Why is the code testing for 4K alignment?
I though the requirement was 8K alignement...
It tests based on the assumption that it's either 4K or 8K aligned. If it's in fact only aligned on a 4K boundary, addr&4096 will be true. Or have I horked that?
Quoted 3 lines
Perl is probably better for this kind of stuff (has "&" operator which is missing from awk). But I'm not a very good perl hacker...
We figured that requiring perl to build was probably a bad idea. Not that this whole thing isn't already a bad idea... :)
I'll make some changes to make it more friendly.
-Phil