On Sun, Jan 25, 2026 at 09:50:22AM +0100, Jeremie Courreges-Anglas wrote:
>
> Here's a new port to get a modern GNU toolchain for x86_64.  It
> successfully compiles a lightly tweaked openbsd-wip/net/ipxe and a
> revived sysutils/memtest86+.  The port is based off
> devel/arm-none-eabi, with all the cruft removed.  Someone could add an
> i386 FLAVOR it they care.  I used the same gcc and binutils version as
> arm-none-eabi for no other reason than mere laziness.
>
> The idea is that a dedicated GNU toolchain specialized for standalone
> code should be more robust in the long run than fixing build/runtime
> errors in niche software every time we update clang, lld, ports-gcc,
> etc.  That would be ipxe and sysutils/firmware/vmm.
>
> Tarball attached.  Thoughts?  ok?
>
> kn, fwiw below is the diff I used to build openbsd-wip/net/ipxe.
> I haven't sorted out everything in sysutils/vmm yet.
>

already said ok in the other thread, but since we're talking about ipxe,
if your (or kn@'s) goal is to bundle this with vmm-firmware to make a
PXE-bootable VM, I tried this years ago and got stuck on some console
I/O problem. ipxe would display its banner but any attempt to interact
with it didn't work. If you want to do this you need to enable option
rom support in seabios and then concatenate the roms together in
such a way that the ipxe rom ends up at a physaddr multiple that worked
on a legacy PC back in the day. I think it's every $0x0800 or something
if I recall correctly. Seabios will then chain to ipxe if it can't find
a boot device. When you build ipxe, just build the vionet version and it
should at least recognize the card. at least that's what I recall. I
didn't spend a lot of time on it.

This was a long time ago and maybe whatever was causing the console problem
is fixed now. dunno.

-ml

> diff --git net/ipxe/Makefile net/ipxe/Makefile
> index bbd5e51f8..c34a13448 100644
> --- net/ipxe/Makefile
> +++ net/ipxe/Makefile
> @@ -50,16 +50,10 @@ FLAVOR ?=         # native build
>  .if empty(FLAVOR)
>  # FWIW, on amd64 'make IPXE_ARCH=i386' also built at one point.
>  IPXE_ARCH =          ${MACHINE_ARCH:amd64=x86_64}
> -COMPILER =           ports-gcc
> -COMPILER_LANGS =     c
> -# XXX WIP ld.bfd with elf-{arm64,i386,x86_64} target support added to 
> binutils
> -BUILD_DEPENDS =      devel/binutils>=2.45.1p4 \
> -                     devel/gas
> -CROSS =                      g
> -MAKE_FLAGS =         CC=${CC} \
> +BUILD_DEPENDS =      devel/x86_64-elf/gcc
> +CROSS =                      x86_64-none-elf-
> +MAKE_FLAGS =         \
>                       SPG_TEST=false
> -USE_LLD =            No
> -MAKE_FLAGS +=                LD=${LD}
>  .else
>  IPXE_ARCH =          ${FLAVOR:aarch64=arm64:arm=arm32}
>  BUILD_DEPENDS =      devel/arm-none-eabi/binutils,${FLAVOR} \
> @@ -93,6 +87,7 @@ USE_GMAKE =         Yes
>  MAKE_FLAGS +=                CROSS=${CROSS} \
>                       HOST_CC=${CC} \
>                       HOST_CFLAGS=${HOST_CFLAGS:Q} \
> +                     SPG_TEST=false \
>                       V=1 \
>                       VERSION=${VERSION:Q}
>
> @@ -105,7 +100,8 @@ BUILD_DEPENDS +=  archivers/xz \
>                       sysutils/mtools \
>                       sysutils/truncate
>  # lzma.h
> -HOST_CFLAGS +=               -I/usr/local/include
> +HOST_CFLAGS +=               -I${LOCALBASE}/include \
> +                     -L${LOCALBASE}/lib
>
>  # util/genfsimg relies on mktemp(1).
>  MAKE_ENV =           TMPDIR=${WRKDIR}
>
> --
> jca


Reply via email to