Page MenuHomeFreeBSD

Fix build for mips.XLP64 kernel, by re-ordering headers.
ClosedPublic

Authored by rpokala on Mar 31 2020, 6:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 5 2024, 7:01 AM
Unknown Object (File)
Jan 14 2024, 10:27 PM
Unknown Object (File)
Jan 6 2024, 3:35 PM
Unknown Object (File)
Dec 28 2023, 10:49 AM
Unknown Object (File)
Dec 15 2023, 7:05 PM
Unknown Object (File)
Nov 24 2023, 1:53 PM
Unknown Object (File)
Nov 4 2023, 8:43 PM
Unknown Object (File)
Sep 22 2023, 10:00 PM
Subscribers

Details

Summary

The log for the failure contained errors like this:

In file included from ${SRCTOP}/sys/mips/nlm/dev/net/xlpge.c:34:
In file included from ${SRCTOP}/sys/sys/systm.h:44:
In file included from ./machine/atomic.h:849:
${SRCTOP}/sys/sys/_atomic_subword.h:222:37: error: unknown type name 'u_long'; did you mean 'long'?
atomic_testandset_acq_long(volatile u_long *p, u_int v)
                                    ^~~~~~
                                    long

And similar "unknown type name" errors for u_int, not recognizing bool as a type, etc.

This was caused by including <sys/param.h> too far down; move it up where it belongs.

Test Plan

make tinderbox -DMAKE_JUST_KERNELS

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rpokala edited the summary of this revision. (Show Details)

do you know when this broke?

sys/mips/nlm/dev/net/xlpge.c
33 ↗(On Diff #70067)

from style(9), <sys/types.h> includes <sys/cdefs.h>, and it is okay to depend on that

jhb added inline comments.
sys/mips/nlm/dev/net/xlpge.c
37 ↗(On Diff #70067)

This is the real bug. <sys/param.h> needs to be moved first before <sys/endian.h>

I would also add a blank line after the "$FreeBSD$" since that seems to be the typical style.

sys/cdefs.h is needed for __FBSDID, so that should stay.

Address review comments from emaste and jhb:

<sys/cdefs.h> includes <sys/types.h>, so it is not necessary to include it
here. The real issue is that <sys/param.h> needs to be included before
<sys/endian.h>.

Also, add a blank line after __FBSDID().

rpokala retitled this revision from Fix build for mips.XLP64 kernel, by adding a missing header. to Fix build for mips.XLP64 kernel, by re-ordering headers..Mar 31 2020, 8:02 PM
rpokala edited the summary of this revision. (Show Details)
rpokala marked 2 inline comments as done.
This revision is now accepted and ready to land.Mar 31 2020, 8:04 PM