Current-Users archive

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

Re: odd behaviour of some programs on i386 cross-built from amd64



At Wed, 22 Apr 2020 21:08:46 -0700, "Greg A. Woods" <woods%planix.ca@localhost> wrote:
Subject: odd behaviour of some programs on i386 cross-built from amd64
>
> 	# od
> 	od: "8/2  " %06o " "\n"": bad format
> 	# file /usr/bin/od
> 	/usr/bin/od: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for NetBSD 8.99.32, stripped

So at least the problems with 'awk' and 'od' seem to be related somehow
to the kernels I built.

I found this by installing a stock 9.0/i386 on real i386 hardware (after
repairing said hardware -- it had not run in years) and finding it could
run the static-linked 'od' I had previously built without problems.

Curious I decided to cross-build the same source tree on the newly
installed 9.0 system and, perhaps without surprise, it generated an
identical binary for, e.g. 'od':

$ cd $MY_DESTDIR
$ cmp /future/build/woods/future/current-i386-ppro-destdir/usr/bin/od usr/bin/od
-r-xr-xr-x  2 woods  wheel  244288 Apr 16 15:38 /future/build/woods/future/current-i386-ppro-destdir/usr/bin/od
-r-xr-xr-x  2 woods  wheel  244288 Apr 26 02:36 usr/bin/od
$

Similarly 'awk' looks the same works just fine.

One of the kernels seems to be the same too, assuming one takes into
account the obvious difference in vers.o:

   text    data     bss     dec     hex filename
20222422         515508  926144 21664074        14a914a sys/arch/i386/compile/MONOLITHIC/netbsd
20222382         515508  926144 21664034        14a9122 /future/build/woods/future/current-amd64-i386-ppro-obj/usr/src/sys/arch/i386/compile/MONOLITHIC/netbsd

   text    data     bss     dec     hex filename
    795       0       0     795     31b sys/arch/i386/compile/MONOLITHIC/vers.o
    755       0       0     755     2f3 /future/build/woods/future/current-amd64-i386-ppro-obj/usr/src/sys/arch/i386/compile/MONOLITHIC/vers.o



However the other kernel I've tested is somehow not the same:

   text    data     bss     dec     hex filename
4776885   80232 1347584 6204701  5ead1d sys/arch/i386/compile/XEN3PAE_DOMU/netbsd
4776585   80232 1347584 6204401  5eabf1 /future/build/woods/future/current-amd64-i386-ppro-obj/usr/src/sys/arch/i386/compile/XEN3PAE_DOMU/netbsd

   text    data     bss     dec     hex filename
    799       0       0     799     31f sys/arch/i386/compile/XEN3PAE_DOMU/vers.o
    791       0       0     791     317 /future/build/woods/future/current-amd64-i386-ppro-obj/usr/src/sys/arch/i386/compile/XEN3PAE_DOMU/vers.o



Next I'll try testing these kernels on Xen and the Soekris box.

--
					Greg A. Woods <gwoods%acm.org@localhost>

Kelowna, BC     +1 250 762-7675           RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost>     Avoncote Farms <woods%avoncote.ca@localhost>

Attachment: pgpdXOkiBNFX8.pgp
Description: OpenPGP Digital Signature



Home | Main Index | Thread Index | Old Index