Bug 260923 - WORLDTMP should be named architecture-specific
Summary: WORLDTMP should be named architecture-specific
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-04 13:04 UTC by Martin Birgmeier
Modified: 2022-01-04 13:04 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2022-01-04 13:04:35 UTC
Scenario:
- FreeBSD main latest
- Cross-compiling for armv6 target RPI-B on an amd64 machine:

[0]# cd /usr/src
[0]# make -j8 buildworld buildkernel KERNCONF="RPI-B GENERIC VERSATILEPB" TARGET=arm TARGET_ARCH=armv6 |& tee /usr/obj$PWD/make.-j8.buildworld.buildkernel.KERNCONF=RPI-B.GENERIC.VERSATILEPB.TARGET=arm.TARGET_ARCH=armv6.`stddate`@`hostname -s`

- /usr/src and /usr/obj are shared via NFS (autofs)
- On the target machine (Raspberry Pi B+, hostname rpi-b), executing

[0]# cd /usr/src
[0]# nice -20 make installkernel installworld KERNCONF="RPI-B" DESTDIR=/d/26s4a/usr/VOL/rpi-b/tmp/x |& tee /d/26s4a/usr/VOL/rpi-b/tmp/make.installkernel.installworld.KERNCONF=RPI-B.DESTDIR=_d_26s4a_usr_VOL_rpi-b_tmp_x.`stddate`@`hostname -s`

Result:
- The command fails with (the paths below reflect their absolute position, /usr/src and /usr/obj are appropriate symlinks):

/bin/sh: make: Exec format error
*** Error code 126

Stop.
make[1]: stopped in /net/hal/z/SRC/FreeBSD/src/MBi/main
*** Error code 1

Stop.
make: stopped in /net/hal/z/SRC/FreeBSD/src/MBi/main

- The reason is that make(1) is found in /usr/obj/usr/src/arm.armv6/tmp/legacy/bin/make, but this is an amd64 executable.

Expected result:
- The directory /usr/obj/usr/src/tmp should be named according to the host architecture, e.g., /usr/obj/usr/src/tmp.amd64.amd64
- This shall avoid it being found on the target machine.

-- Martin