pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Bootstrapping pbulk in sandbox fails on Loongson/mips64el.



On Mon, Dec 20, 2021 at 5:33 PM Alistair Crooks <agc%pkgsrc.org@localhost> wrote:
>
>
>
> On Sat, 18 Dec 2021 at 19:33, manphiz <manphiz%gmail.com@localhost> wrote:
>>
>>
>> ```
>> yeeloong-netbsd# /home/pbulk/sandbox chroot
>> yeeloong-netbsd# pwd  # To verify I'm in chroot
>> /
>> yeeloong-netbsd# /usr/bin/file /sbin/sysctl
>> /sbin/sysctl: ELF 32-bit LSB shared object, MIPS, N32 MIPS-III version
>> 1 (SYSV), dynamically linked, interpreter /libexec/ld.elf_so, for
>> NetBSD 8.2, not stripped
>> yeeloong-netbsd# cd /usr/pkgsrc/pkgtools/digest/
>> yeeloong-netbsd# /usr/pbulk/bin/bmake show-var VARNAME=OBJECT_FMT
>> a.out
>> yeeloong-netbsd# /usr/bin/make show-var VARNAME=OBJECT_FMT
>> ELF
>> yeeloong-netbsd# uname -s
>> NetBSD
>> ```
>>
>> So "/usr/bin/file /sbin/sysctl" should be working in chroot, and
>> system make reports OBJECT_FMT to be ELF, however the bmake
>> bootstrapped in pbulk reports a.out.  Will try to keep digging into
>> this, but hopefully the info above may help some developers to figure
>> out what could be wrong.
>>
> The interesting thing is that you get different object formats using bmake and make, so I'd suggest it's some of problem with bmake, the makefiles, or bootstrapping in general

So I got some time for more digging.  So the bootstrapped bmake does
not properly set either TARGET_OSNAME or _HOST_OSNAME, which is
required for ELF detection according to
/usr/pkgsrc/devel/bmake/files/mk/own.mk.  I also tried with the system
make
and while it has _HOST_OSNAME but the TARGET_OSNAME is also missing.
As I understand it according to file/mk/own.mk:199[1], given
TARGET_OSNAME is "NetBSD", if /usr/libexec/ld.elf_so exists it will
set OBJECT_FMT to ELF, else it will set OBJECT_FMT to a.out.  And if
TARGET_OSNAME is missing it will set OBJECT_FMT to ELF if it's unset.
So the host make seems to conform to this behavior as TARGET_OSNAME is
empty, but why does the bootstrapped bmake set it to a.out when
TARGET_OSNAME is also missing?  It seems to suggest that something
weird happened during bmake bootstrapping.  Any ideas?

The commands I've used for verifications are listed below:
```
yeeloong-netbsd# /home/pbulk/sandbox chroot
yeeloong-netbsd# ls /  # To verify I'm in chroot
.cshrc   .cvsrc   .login   .logout  .profile .shrc    .ssh     bin
 dev      etc      lib      libexec  sandbox  sbin     tmp      usr
  var
yeeloong-netbsd# cd /usr/pkgsrc/pkgtools/digest/
yeeloong-netbsd# /usr/pbulk/bin/bmake show-var VARNAME=SHLIB_TYPE
ELF
yeeloong-netbsd# /usr/pbulk/bin/bmake show-var VARNAME=MACHINE_ARCH
mips64el
yeeloong-netbsd# /usr/pbulk/bin/bmake show-var VARNAME=TARGET_OSNAME

yeeloong-netbsd# /usr/pbulk/bin/bmake show-var VARNAME=_HOST_OSNAME

yeeloong-netbsd# make show-var VARNAME=TARGET_OSNAME

yeeloong-netbsd# make show-var VARNAME=_HOST_OSNAME
NetBSD
yeeloong-netbsd# /usr/pbulk/bin/bmake show-var VARNAME=OBJECT_FMT
a.out
yeeloong-netbsd# make show-var VARNAME=OBJECT_FMT
ELF
```

[1] https://github.com/NetBSD/pkgsrc/blob/trunk/devel/bmake/files/mk/own.mk#L199


Home | Main Index | Thread Index | Old Index