opnsense / tools

OPNsense release engineering toolkit
https://opnsense.org/
BSD 2-Clause "Simplified" License
279 stars 206 forks source link

Trying to build ARM64 fails. #351

Closed korhojoa closed 1 year ago

korhojoa commented 1 year ago

Following the instructions, and installing aarch64-binutils and qemu-user-static results in a failure when you get to make packages.

My install was a FreeBSD 13.1 RELEASE. Reproduction steps after install: First pkg command installed pkg, then git Cloned this repo to /usr make update make base kernel DEVICE=ARM64 Was told that aarch64-binutils was missing, so installed that make base kernel DEVICE=ARM64 Same, but for qemu-user-static make base kernel DEVICE=ARM64 make xtools DEVICE=ARM64 and then: (I stopped this, it just keeps listing more packages and fails.)

root@frisbee:/usr/tools # make packages DEVICE=ARM64

ABI_FILE=/usr/lib/crt1.o
BLOCKSIZE=K
CONFIGDIR=/usr/tools/config/23.1
CONFIG_XML=/usr/local/etc/config.xml
COREBRANCH=stable/23.1
COREDIR=/usr/core
COREENV=CORE_PHP=81 CORE_ABI=23.1 CORE_PYTHON=39
CPUS=12
DEVICE=ARM64
DEVICEDIR=/usr/tools/device
EDITOR=vi
ENV=/home/joakim/.shrc
ENV_FILTER=env -i USER=joakim LOGNAME=joakim HOME=/root SHELL=/bin/csh BLOCKSIZE=K MAIL=/var/mail/joakim PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin TERM=tmux-256color HOSTTYPE=FreeBSD VENDOR=amd OSTYPE=FreeBSD MACHTYPE=x86_64 PWD=/usr/tools/build GROUP=wheel HOST=frisbee EDITOR=vi PAGER=less ABI_FILE=/usr/lib/crt1.o
EXTRABRANCH=
GROUP=wheel
HOME=/root
HOST=frisbee
HOSTTYPE=FreeBSD
IMAGESDIR=/usr/local/opnsense/build/23.1/aarch64/images
LANG=C.UTF-8
LOGNAME=joakim
LOGSDIR=/usr/local/opnsense/build/23.1/aarch64/logs
MACHTYPE=x86_64
MAIL=/var/mail/joakim
MAKEFLAGS= DEVICE=ARM64
MAKELEVEL=1
MAKE_ARGS_DEV=
META_MODE=normal
MM_CHARSET=UTF-8
OLDPWD=/usr/obj/usr/tools
OSTYPE=FreeBSD
PACKAGESDIR=/.pkg
PAGER=less
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
PLUGINSBRANCH=stable/23.1
PLUGINSDIR=/usr/plugins
PLUGINSENV=PLUGIN_PHP=81 PLUGIN_ABI=23.1 PLUGIN_PYTHON=39
PORTSBRANCH=master
PORTSDIR=/usr/ports
PORTSENV=
PORTSREFBRANCH=main
PORTSREFDIR=/usr/freebsd-ports
PORTSREFURL=https://git.FreeBSD.org/ports.git
PRINT_ENV_SKIP=1
PRODUCT_ABI=23.1
PRODUCT_ADDITIONS=
PRODUCT_ARCH=aarch64
PRODUCT_COMSPEED=115200
PRODUCT_CORE=opnsense
PRODUCT_CORES=opnsense opnsense-devel opnsense-business
PRODUCT_DEBUG=
PRODUCT_DEVEL=
PRODUCT_DEVICE_REAL=ARM64
PRODUCT_GITBASE=https://github.com/opnsense
PRODUCT_HOST=amd64
PRODUCT_KERNEL=SMP-ARM
PRODUCT_LUA=5.4
PRODUCT_MIRROR=http://mirror.fra10.de.leaseweb.net/opnsense
PRODUCT_NAME=OPNsense
PRODUCT_PERL=5.32
PRODUCT_PHP=81
PRODUCT_PLUGIN=os-*
PRODUCT_PLUGINS=os-*
PRODUCT_PRIVKEY=/usr/tools/config/23.1/repo.key
PRODUCT_PUBKEY=/usr/tools/config/23.1/repo.pub
PRODUCT_PYTHON=39
PRODUCT_RELEASE=OPNsense-202304222116
PRODUCT_RUBY=31
PRODUCT_SERVER=user@does.not.exist
PRODUCT_SETTINGS=23.1
PRODUCT_SIGNCHK=/usr/tools/scripts/pkg_fingerprint.sh /usr/tools/config/23.1/repo.pub
PRODUCT_SIGNCMD=/usr/tools/scripts/pkg_sign.sh /usr/tools/config/23.1/repo.pub /usr/tools/config/23.1/repo.key
PRODUCT_SSL=openssl
PRODUCT_SUFFIX=
PRODUCT_TARGET=arm64
PRODUCT_TYPE=opnsense
PRODUCT_UEFI=arm dvd serial vga vm
PRODUCT_VERSION=202304222116
PRODUCT_WANTS_CROSS=aarch64-binutils qemu-user-static
PRODUCT_ZFS=
PWD=/usr/tools/build
SETSDIR=/usr/local/opnsense/build/23.1/aarch64/sets
SHELL=/bin/csh
SHLVL=1
SRCABI=FreeBSD:13:amd64
SRCBRANCH=stable/23.1
SRCDIR=/usr/src
SRCREVISION=13.1
STAGEDIR=/usr/obj/usr/tools/config/23.1/aarch64
STAGEDIRPREFIX=/usr/obj
TARGETDIR=/usr/local/opnsense/build/23.1/aarch64
TARGETDIRPREFIX=/usr/local/opnsense/build
TERM=tmux-256color
TERM_PROGRAM=tmux
TERM_PROGRAM_VERSION=3.3a
TMUX=/tmp/tmux-1001/default,1054,0
TMUX_PANE=%0
TOOLSBRANCH=master
TOOLSDIR=/usr/tools
UPLOADDIR=.
USER=joakim
VENDOR=amd
WITHOUT_MODULES=cloudabi32
>>> Running build step: base
>>> Passing arguments: (none)
>>> Reusing base set: /usr/local/opnsense/build/23.1/aarch64/sets/base-23.1.6-aarch64.txz

ABI_FILE=/usr/lib/crt1.o
BLOCKSIZE=K
CONFIGDIR=/usr/tools/config/23.1
CONFIG_XML=/usr/local/etc/config.xml
COREBRANCH=stable/23.1
COREDIR=/usr/core
COREENV=CORE_PHP=81 CORE_ABI=23.1 CORE_PYTHON=39
CPUS=12
DEVICE=ARM64
DEVICEDIR=/usr/tools/device
EDITOR=vi
ENV=/home/joakim/.shrc
ENV_FILTER=env -i USER=joakim LOGNAME=joakim HOME=/root SHELL=/bin/csh BLOCKSIZE=K MAIL=/var/mail/joakim PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin TERM=tmux-256color HOSTTYPE=FreeBSD VENDOR=amd OSTYPE=FreeBSD MACHTYPE=x86_64 PWD=/usr/tools/build GROUP=wheel HOST=frisbee EDITOR=vi PAGER=less ABI_FILE=/usr/lib/crt1.o
EXTRABRANCH=
GROUP=wheel
HOME=/root
HOST=frisbee
HOSTTYPE=FreeBSD
IMAGESDIR=/usr/local/opnsense/build/23.1/aarch64/images
LANG=C.UTF-8
LOGNAME=joakim
LOGSDIR=/usr/local/opnsense/build/23.1/aarch64/logs
MACHTYPE=x86_64
MAIL=/var/mail/joakim
MAKEFLAGS= DEVICE=ARM64
MAKELEVEL=1
MAKE_ARGS_DEV=
META_MODE=normal
MM_CHARSET=UTF-8
OLDPWD=/usr/obj/usr/tools
OSTYPE=FreeBSD
PACKAGESDIR=/.pkg
PAGER=less
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
PLUGINSBRANCH=stable/23.1
PLUGINSDIR=/usr/plugins
PLUGINSENV=PLUGIN_PHP=81 PLUGIN_ABI=23.1 PLUGIN_PYTHON=39
PORTSBRANCH=master
PORTSDIR=/usr/ports
PORTSENV=
PORTSREFBRANCH=main
PORTSREFDIR=/usr/freebsd-ports
PORTSREFURL=https://git.FreeBSD.org/ports.git
PRINT_ENV_SKIP=1
PRODUCT_ABI=23.1
PRODUCT_ADDITIONS=
PRODUCT_ARCH=aarch64
PRODUCT_COMSPEED=115200
PRODUCT_CORE=opnsense
PRODUCT_CORES=opnsense opnsense-devel opnsense-business
PRODUCT_DEBUG=
PRODUCT_DEVEL=
PRODUCT_DEVICE_REAL=ARM64
PRODUCT_GITBASE=https://github.com/opnsense
PRODUCT_HOST=amd64
PRODUCT_KERNEL=SMP-ARM
PRODUCT_LUA=5.4
PRODUCT_MIRROR=http://mirror.ams1.nl.leaseweb.net/opnsense
PRODUCT_NAME=OPNsense
PRODUCT_PERL=5.32
PRODUCT_PHP=81
PRODUCT_PLUGIN=os-*
PRODUCT_PLUGINS=os-*
PRODUCT_PRIVKEY=/usr/tools/config/23.1/repo.key
PRODUCT_PUBKEY=/usr/tools/config/23.1/repo.pub
PRODUCT_PYTHON=39
PRODUCT_RELEASE=OPNsense-202304222116
PRODUCT_RUBY=31
PRODUCT_SERVER=user@does.not.exist
PRODUCT_SETTINGS=23.1
PRODUCT_SIGNCHK=/usr/tools/scripts/pkg_fingerprint.sh /usr/tools/config/23.1/repo.pub
PRODUCT_SIGNCMD=/usr/tools/scripts/pkg_sign.sh /usr/tools/config/23.1/repo.pub /usr/tools/config/23.1/repo.key
PRODUCT_SSL=openssl
PRODUCT_SUFFIX=
PRODUCT_TARGET=arm64
PRODUCT_TYPE=opnsense
PRODUCT_UEFI=arm dvd serial vga vm
PRODUCT_VERSION=202304222116
PRODUCT_WANTS_CROSS=aarch64-binutils qemu-user-static
PRODUCT_ZFS=
PWD=/usr/tools/build
SETSDIR=/usr/local/opnsense/build/23.1/aarch64/sets
SHELL=/bin/csh
SHLVL=1
SRCABI=FreeBSD:13:amd64
SRCBRANCH=stable/23.1
SRCDIR=/usr/src
SRCREVISION=13.1
STAGEDIR=/usr/obj/usr/tools/config/23.1/aarch64
STAGEDIRPREFIX=/usr/obj
TARGETDIR=/usr/local/opnsense/build/23.1/aarch64
TARGETDIRPREFIX=/usr/local/opnsense/build
TERM=tmux-256color
TERM_PROGRAM=tmux
TERM_PROGRAM_VERSION=3.3a
TMUX=/tmp/tmux-1001/default,1054,0
TMUX_PANE=%0
TOOLSBRANCH=master
TOOLSDIR=/usr/tools
UPLOADDIR=.
USER=joakim
VENDOR=amd
WITHOUT_MODULES=cloudabi32
>>> Running build step: ports
>>> Passing arguments: (none)
>>> Setting up stage in /usr/obj/usr/tools/config/23.1/aarch64
>>> Setting up base in /usr/obj/usr/tools/config/23.1/aarch64
>>> Setting up /usr/ports clone in /usr/obj/usr/tools/config/23.1/aarch64
>>> Setting up /usr/src clone in /usr/obj/usr/tools/config/23.1/aarch64
>>> Setting up xtools in /usr/obj/usr/tools/config/23.1/aarch64
>>> Setting up chroot in /usr/obj/usr/tools/config/23.1/aarch64
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
32-bit compatibility ldconfig path:
>>> Setting up distfiles in /usr/obj/usr/tools/config/23.1/aarch64
>>> Extracting packages in /usr/obj/usr/tools/config/23.1/aarch64
>>> Extract failed: no packages set found
[20230422181654] ===> License PHP301 accepted by the user
===>   php81-zlib-8.1.18 depends on file: /usr/local/sbin/pkg - not found
[20230422181654] ===> License BSD2CLAUSE accepted by the user
[20230422181654] => freebsd-pkg-1.19.1_GH0.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
[20230422181654] => Attempting to fetch https://codeload.github.com/freebsd/pkg/tar.gz/1.19.1?dummy=/freebsd-pkg-1.19.1_GH0.tar.gz
fetch: https://codeload.github.com/freebsd/pkg/tar.gz/1.19.1?dummy=/freebsd-pkg-1.19.1_GH0.tar.gz: size unknown
fetch: https://codeload.github.com/freebsd/pkg/tar.gz/1.19.1?dummy=/freebsd-pkg-1.19.1_GH0.tar.gz: size of remote file is not known
freebsd-pkg-1.19.1_GH0.tar.gz                         3996 kB 5142 kBps    01s
[20230422181655] ===> Fetching all distfiles required by pkg-1.19.1_1 for building
[20230422181655] ===> Extracting for pkg-1.19.1_1
[20230422181655] ===> License BSD2CLAUSE accepted by the user
[20230422181655] ===> Fetching all distfiles required by pkg-1.19.1_1 for building
[20230422181655] => SHA256 Checksum OK for freebsd-pkg-1.19.1_GH0.tar.gz.
[20230422181655] ===> Patching for pkg-1.19.1_1
[20230422181655] ===> Applying FreeBSD patches for pkg-1.19.1_1 from /usr/ports/ports-mgmt/pkg/files
[20230422181655] ===> Configuring for pkg-1.19.1_1
No installed jimsh or tclsh, building local bootstrap jimsh0
No working C compiler found. Tried cc and gcc.
[20230422181656] ===> Script "configure" failed unexpectedly.
Please report the problem to pkg@FreeBSD.org [maintainer] and attach the
"/usr/obj/usr/ports/ports-mgmt/pkg/work/pkg-1.19.1/config.log" including the
output of the failure of your make command. Also, it might be a good idea to
provide an overview of all packages installed on your system (e.g. a
/usr/obj/usr/ports/ports-mgmt/pkg/work/pkg-1.19.1/src/pkg-static info -g -Ea).
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make: stopped in /usr/ports/archivers/php81-zlib
[20230422181656] ===> Cleaning for pkg-1.19.1_1
[20230422181656] ===> Cleaning for php81-zlib-8.1.18
[20230422181657] ===> License BSD3CLAUSE accepted by the user
===>   snappy-1.1.10 depends on file: /usr/local/sbin/pkg - not found
^C*** Signal 2
*** Signal 2
cp: /usr/obj/usr/tools/config/23.1/aarch64/.pkg/All/*: No such file or directory
*** Error code 1
wilmardo commented 1 year ago

No working C compiler found. Tried cc and gcc.

Pretty sure you are missing these

korhojoa commented 1 year ago

I think I do have them, perhaps these aren't the right ones?

root@frisbee:/home/joakim # aarch64-
aarch64-none-elf-addr2line               aarch64-none-elf-gcc-ranlib              aarch64-none-elf-readelf                 aarch64-unknown-freebsd13.1-gcc-12.2.0   aarch64-unknown-freebsd13.1-nm
aarch64-none-elf-ar                      aarch64-none-elf-gcov                    aarch64-none-elf-size                    aarch64-unknown-freebsd13.1-gcc-ar12     aarch64-unknown-freebsd13.1-objcopy
aarch64-none-elf-as                      aarch64-none-elf-gcov-dump               aarch64-none-elf-strings                 aarch64-unknown-freebsd13.1-gcc-nm12     aarch64-unknown-freebsd13.1-objdump
aarch64-none-elf-c++                     aarch64-none-elf-gcov-tool               aarch64-none-elf-strip                   aarch64-unknown-freebsd13.1-gcc-ranlib12 aarch64-unknown-freebsd13.1-ranlib
aarch64-none-elf-c++filt                 aarch64-none-elf-gprof                   aarch64-unknown-freebsd13.1-addr2line    aarch64-unknown-freebsd13.1-gcc12        aarch64-unknown-freebsd13.1-readelf
aarch64-none-elf-cpp                     aarch64-none-elf-ld                      aarch64-unknown-freebsd13.1-ar           aarch64-unknown-freebsd13.1-gcov-dump12  aarch64-unknown-freebsd13.1-size
aarch64-none-elf-elfedit                 aarch64-none-elf-ld.bfd                  aarch64-unknown-freebsd13.1-as           aarch64-unknown-freebsd13.1-gcov-tool12  aarch64-unknown-freebsd13.1-strings
aarch64-none-elf-g++                     aarch64-none-elf-lto-dump                aarch64-unknown-freebsd13.1-c++12        aarch64-unknown-freebsd13.1-gcov12       aarch64-unknown-freebsd13.1-strip
aarch64-none-elf-gcc                     aarch64-none-elf-nm                      aarch64-unknown-freebsd13.1-c++filt      aarch64-unknown-freebsd13.1-gprof
aarch64-none-elf-gcc-11.3.0              aarch64-none-elf-objcopy                 aarch64-unknown-freebsd13.1-cpp12        aarch64-unknown-freebsd13.1-ld
aarch64-none-elf-gcc-ar                  aarch64-none-elf-objdump                 aarch64-unknown-freebsd13.1-elfedit      aarch64-unknown-freebsd13.1-ld.bfd
aarch64-none-elf-gcc-nm                  aarch64-none-elf-ranlib                  aarch64-unknown-freebsd13.1-g++12        aarch64-unknown-freebsd13.1-lto-dump12
root@frisbee:/home/joakim # which gcc
/usr/local/bin/gcc
korhojoa commented 1 year ago

How was this completed?

fichtner commented 1 year ago

We don't offer community support for random local build issues.