Re: [RFC] [PATCH] Fix b43 driver build for arm




It is a consistencycheck between host and target
layout of data.
You need to pad the structure so it becomes 8 byte in size.

Ok, I looked at the code and it is hightly questionable to me that this
check does work in a crosscompile environment (which the ARM build
most likely is).

It seems to check the size of the structure in the .o file against
the size of the structure on the _host_ where it is compiled.
I can't see why we would want to check _anything_ of the target stuff
to the host this stuff is compiled on.
I can compile an ARM kernel on any machine I want.

There actually is a comment:
* Check that sizeof(device_id type) are consistent with size of section
* in .o file. If in-consistent then userspace and kernel does not agree
* on actual size which is a bug.

So it seems what this check _wants_ to compare the sizeof the structure
in the kernel to the size of the stucture in the userland of the target system.
But it does _not_ do that.
It does compare the size of the structure in the kernel against the size of
the stucture in userland on the machine it is _compiled_ on.
That is wrong.
In at least 99% of the cases this is OK and the check has found
several bugs where things would not have worked due to different
alignmnet between kernel and userland. Just think about the
issues in a mixed 32/64 bit world.

In this particular case you _could_ be right that it would work
on ARM userland. But the only way to be sure is to pad the
structure so it become 8 byte in size.
Or as was recently done in the m68k case to tell the
compiler to specifically align it to 8 byte boundary.

Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Unable to boot linux kernel 2.4 for imx21ads through NFS
    ... The host is fedora core 5. ... In kernel configuration, we have selected target image as "NFS ... # Package selection ...
    (comp.os.linux.embedded)
  • Re: Build your own Forth for Microchip PIC (Episode 837)
    ... Because if you're doing tokens, wouldn't your token tables go in data space, with your token interpreter and primitives in code space? ... Compile words for target substituting local I/O access for remote ones. ... You can't, for example, test any of your PIC code on the host. ...
    (comp.lang.forth)
  • Re: [RFC] [PATCH] Fix b43 driver build for arm
    ... I can't see why we would want to check _anything_ of the target stuff ... I can compile an ARM kernel on any machine I want. ... So it seems what this check _wants_ to compare the sizeof the structure ...
    (Linux-Kernel)
  • Re: Build your own Forth for Microchip PIC: Design thoughts
    ... Embedded systems hardware I don't plan to buy. ... Advanced work would be a distributed model where the PIC and host work ... All the code on the target would be headerless. ... compile once and copy the code to the PIC, ...
    (comp.lang.forth)
  • Re: [RFC] [PATCH] Fix b43 driver build for arm
    ... I can't see why we would want to check _anything_ of the target stuff ... I can compile an ARM kernel on any machine I want. ... So it seems what this check _wants_ to compare the sizeof the structure ...
    (Linux-Kernel)