From nobody Mon Apr 25 19:07:47 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5753F1A93444 for ; Mon, 25 Apr 2022 19:07:50 +0000 (UTC) (envelope-from pmh@hausen.com) Received: from mail2.pluspunkthosting.de (mail2.pluspunkthosting.de [217.29.33.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KnDzn62WKz4ZSv for ; Mon, 25 Apr 2022 19:07:49 +0000 (UTC) (envelope-from pmh@hausen.com) Received: from smtpclient.apple (87.138.185.145) by mail2.pluspunkthosting.de (Axigen) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPSA id 1885F8; Mon, 25 Apr 2022 21:07:47 +0200 From: "Patrick M. Hausen" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Date: Mon, 25 Apr 2022 21:07:47 +0200 Subject: Cross-compile worked, cross-install not so much ... Message-Id: <3D48BE93-7D42-4AB2-82D4-88BBF4E1FD40@hausen.com> To: "freebsd-current@freebsd.org" X-Mailer: Apple Mail (2.3696.80.82.1.1) X-Rspamd-Queue-Id: 4KnDzn62WKz4ZSv X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pmh@hausen.com has no SPF policy when checking 217.29.33.228) smtp.mailfrom=pmh@hausen.com X-Spamd-Result: default: False [-1.59 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[hausen.com]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-0.997]; NEURAL_HAM_MEDIUM(-1.00)[-0.995]; NEURAL_HAM_SHORT(-1.00)[-1.000]; TO_DN_EQ_ADDR_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16188, ipnet:217.29.32.0/20, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi all, getting into FreeBSD ARM64 I tried to compile a current system on a fast = AMD64 VM and now I am somewhat stuck - no help using search engines and the like. 1st step: # checkout main aka 14-CURRENT cd /usr/src make -j 8 TARGET=3Darm64 TARGET_ARCH=3Daarch64 buildworld = buildkernel That worked like a charm and I seem to have a well populated = /usr/obj/usr/src/arm64.aarch64. 2nd step: I then mounted /usr/src and /usr/obj on my Raspberry Pi via NFS. The = binaries in /usr/obj are the correct architecture and run perfectly well: root@pi8:~ # file /usr/obj/usr/src/arm64.aarch64/bin/sh/sh /usr/obj/usr/src/arm64.aarch64/bin/sh/sh: ELF 64-bit LSB pie = executable, ARM aarch64, version 1 (FreeBSD), dynamically linked, = interpreter /libexec/ld-elf.so.1, for FreeBSD 14.0 (1400057), = FreeBSD-style, not stripped root@pi8:~ # /usr/obj/usr/src/arm64.aarch64/bin/sh/sh root@pi8:~ # ^D 3rd step: root@pi8:/usr/src # make TARGET=3Darm64 TARGET_ARCH=3Daarch64 = installkernel -------------------------------------------------------------- >>> Install check kernel -------------------------------------------------------------- -------------------------------------------------------------- >>> Installing kernel GENERIC on Mon Apr 25 21:03:58 CEST 2022 -------------------------------------------------------------- cd /usr/obj/usr/src/arm64.aarch64/sys/GENERIC; = MACHINE_ARCH=3Daarch64 MACHINE=3Darm64 CPUTYPE=3D CC=3D"cc -target = aarch64-unknown-freebsd14.0 --sysroot=3D/usr/obj/usr/src/arm64.aarch64/tmp= -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin" CXX=3D"c++ -target = aarch64-unknown-freebsd14.0 --sysroot=3D/usr/obj/usr/src/arm64.aarch64/tmp= -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin" CPP=3D"cpp -target = aarch64-unknown-freebsd14.0 --sysroot=3D/usr/obj/usr/src/arm64.aarch64/tmp= -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin" AS=3D"as" AR=3D"ar" = ELFCTL=3D"elfctl" LD=3D"ld" LLVM_LINK=3D"" NM=3Dnm OBJCOPY=3D"objcopy" = RANLIB=3Dranlib STRINGS=3D SIZE=3D"size" STRIPBIN=3D"strip" = PATH=3D/usr/obj/usr/src/arm64.aarch64/tmp/bin:/usr/obj/usr/src/arm64.aarch= 64/tmp/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin:/usr/obj/usr/sr= c/arm64.aarch64/tmp/legacy/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/leg= acy/usr/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/bin:/usr/obj/usr/src= /arm64.aarch64/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/usr/bin = make KERNEL=3Dkernel install /bin/sh: make: Exec format error *** Error code 126 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src So via that complicated PATH setting it seems to run: = /usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/bin/make Which surprisingly is an amd64 binary: root@pi8:/usr/src # file = /usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/bin/make /usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/bin/make: ELF = 64-bit LSB pie executable, x86-64, version 1 (FreeBSD), dynamically = linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 14.0 (1400057), = FreeBSD-style, stripped So what did I do wrong? Thanks for all help, Patrick