Bug 283041 - unable to build arm64 kernel on current
Summary: unable to build arm64 kernel on current
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Many People
Assignee: Warner Losh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-29 18:15 UTC by Kim Shrier
Modified: 2024-12-06 18:00 UTC (History)
3 users (show)

See Also:


Attachments
patch to add the creation of device_if.h and bus_if.h for arm64 kernel builds (706 bytes, application/mbox)
2024-11-29 18:15 UTC, Kim Shrier
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kim Shrier 2024-11-29 18:15:50 UTC
Created attachment 255529 [details]
patch to add the creation of device_if.h and bus_if.h for arm64 kernel builds

When doing a `make buildkernel` on recent versions of FreeBSD current for arm64, it fails because device_if.h and bus_if.h files are missing.  Both sys/conf/Makefile.arm and sys/conf/Makefile.riscv have the same hack I have added to sys/conf/Makefile.arm64.
Comment 1 Warner Losh freebsd_committer freebsd_triage 2024-11-29 18:29:07 UTC
this likely should be for all platforms, not adding them one at a time... 

And buildkernel works for me... Is there something that you do differently than I do?

I'll check into it, though, since something is amiss.
Comment 2 Mark Millard 2024-11-29 19:09:10 UTC
Why is the attachment in "application/mbox" format (well, MIME type)?
Comment 3 Warner Losh freebsd_committer freebsd_triage 2024-11-29 20:14:13 UTC
hmmm, maybe the right answer is to just remove it from all three places...
Checking that out now...
Comment 4 Warner Losh freebsd_committer freebsd_triage 2024-11-29 20:14:44 UTC
(In reply to Mark Millard from comment #2)
I can read it, and it's fine.
It's the output of git format-patch
Comment 5 Warner Losh freebsd_committer freebsd_triage 2024-12-06 17:20:22 UTC
I have a branch that fixes this by removing the bus.h include.
https://reviews.freebsd.org/D47847
https://reviews.freebsd.org/D47848
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-12-06 17:54:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=d1e843b3f976528fbea04e702a20219d532220d3

commit d1e843b3f976528fbea04e702a20219d532220d3
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-12-06 17:30:13 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-12-06 17:31:36 +0000

    arm: Use constants from sys/intr.h, not genassym

    We can now include sys/intr.h to get these constants rather than using
    genassym. Opt for this simpler method.

    PR:                     283041
    Sponsored by:           Netflix
    Reviewed by:            mmel, andrew
    Differential Revision:  https://reviews.freebsd.org/D47847

 sys/arm/arm/exception.S     | 1 +
 sys/arm/arm/genassym.c      | 4 ----
 sys/arm64/arm64/exception.S | 1 +
 sys/arm64/arm64/genassym.c  | 5 -----
 sys/riscv/riscv/genassym.c  | 2 --
 5 files changed, 2 insertions(+), 11 deletions(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-12-06 17:55:00 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=d0510c98146f141fcc8f989e8f52625248d7f219

commit d0510c98146f141fcc8f989e8f52625248d7f219
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-12-06 17:30:20 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-12-06 17:31:36 +0000

    genassym: Remove stale *if.h depends

    Since we no longer need to include intr.h, which depends on sys/bus.h,
    in genassym, we no longer need to include it in the Makefile depends.

    PR:                     283041
    Sponsored by:           Netflix
    Reviewed by:            ehem_freebsd_m5p.com, mmel, andrew
    Differential Revision:  https://reviews.freebsd.org/D47848

 sys/conf/Makefile.arm   | 3 ---
 sys/conf/Makefile.riscv | 3 ---
 2 files changed, 6 deletions(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2024-12-06 17:55:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=7b16a4a75dc14224efc72f1ff2cc98f6f857f757

commit 7b16a4a75dc14224efc72f1ff2cc98f6f857f757
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-12-06 17:30:02 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-12-06 17:31:36 +0000

    sys/intr.h: Make it safe to include from assembler

    Sometimes we need defines from this file in assembler code. Today we do
    the heavyweight approach of using genassym for that. However, they are
    just #defines, so in the future we want to include sys/intr.h to pick up
    the needed constants in exception.S.

    PR:                     283041
    Sponsored by:           Netflix
    Reviewed by:            mmel, andrew
    Differential Revision:  https://reviews.freebsd.org/D47846

 sys/arm/include/intr.h   |  6 ++++--
 sys/arm64/include/intr.h | 10 ++++++----
 sys/riscv/include/intr.h |  2 ++
 sys/sys/intr.h           |  6 ++++--
 4 files changed, 16 insertions(+), 8 deletions(-)
Comment 9 Warner Losh freebsd_committer freebsd_triage 2024-12-06 18:00:34 UTC
OK. Fixed via a different method. We shouldn't be including bus.h in the first place, so fixing that fixes the need to have this dependency. Please let me know if you continue to have problems. I couldn't recreate it on my machines, but I suspect that a clean build or similar may have issues.