Page MenuHomeFreeBSD

ARM: Allow systems that do not define LINUX_BOOT_ABI to compile properly
ClosedPublic

Authored by sgalabov on Nov 7 2016, 9:46 AM.

Details

Summary

At the moment the SHEEVAPLUG (for example) kernel can't be compiled as is due to the fact that it doesn't define LINUX_BOOT_ABI.
The reason is that we include sys/boot.h unconditionally, but do not use its contents (specifically the howto_names static array defined within it) if LINUX_BOOT_ABI is not defined.
So, let's only include the file if LINUX_BOOT_ABI is defined.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

sgalabov updated this revision to Diff 22045.Nov 7 2016, 9:46 AM
sgalabov retitled this revision from to ARM: Allow systems that do not define LINUX_BOOT_ABI to compile properly.
sgalabov updated this object.
sgalabov edited the test plan for this revision. (Show Details)
sgalabov added a reviewer: ARM.
sgalabov set the repository for this revision to rS FreeBSD src repository.
sgalabov added a project: ARM.

Actual build failure message is:
/src/current.git/sys/sys/boot.h:40: warning: 'howto_names' defined but not used

Looking at sys/sys/boot.h this is more or less normal. Looking at the implementation of sys/arm/arm/machdep.c, the only place where we use howto_names is within a #ifdef LINUX_BOOT_ABI block, so it makes sense to include sys/sys/boot.h only if LINUX_BOOT_ABI is defined.

mmel accepted this revision.Nov 7 2016, 10:29 AM
mmel added a reviewer: mmel.
mmel added a subscriber: mmel.

Hmm, right.

Btw, which compiler you use? It seems that clang doesn't generate error for unused external variables...

This revision is now accepted and ready to land.Nov 7 2016, 10:29 AM
In D8459#175948, @meloun-miracle-cz wrote:

Hmm, right.
Btw, which compiler you use? It seems that clang doesn't generate error for unused external variables...

I'm using the default gcc.. maybe this is not 100% correct for ARM anymore (it was, last time I used it :-) ), but in any case I guess we should go ahead and put the include of sys/boot.h within an #ifdef LINUX_BOOT_ABI block..

This revision was automatically updated to reflect the committed changes.