RE: Error crosscompiling 14.0-ALPHA1 on amd64 for arm64.aarch64

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sat, 12 Aug 2023 22:25:48 UTC
Juraj Lutter <otis_at_FreeBSD.org> wrote on
Date: Sat, 12 Aug 2023 20:32:53 UTC :

> recent 14.0-ALPHA1 sources is giving an error:
> 
> Building /usr/obj/usr/src/arm64.aarch64/obj-lib32/lib/libssp_nonshared/libssp_nonshared.o
> Building /usr/obj/usr/src/arm64.aarch64/obj-lib32/lib/libgcc_eh/int_util.o
> error: unable to create target: 'No available targets are compatible with triple "armv7-unknown-freebsd14.0-gnueabihf"'
> 1 error generated.
> error: unable to create target: 'No available targets are compatible with triple "armv7-unknown-freebsd14.0-gnueabihf"'
> *** [libssp_nonshared.o] Error code 1
> 
> Commandline:
> make -j`sysctl -n hw.ncpu` WITH_META_MODE=1 TARGET=arm64 TARGET_ARCH=aarch64 buildworld buildkernel
> 
> The build runs in clean objdir, src git hash 220427da0e9b2c1d8e964120becc17eb7524e46f
> 
> Host runs 14.0-CURRENT 28d2e3b5dedf
> 
> Am I missing something obvious?

The likes of https://ci.freebsd.org/job/FreeBSD-main-aarch64-build/
are built on amd64 via cross building. Those builds have been and
are still working.

A log file from the recent one shows the actual cc command it used
for /usr/src/lib/libssp_nonshared/libssp_nonshared.c :

cc -march=armv7 -m32 -target armv7-unknown-freebsd14.0-gnueabihf  -DCOMPAT_LIBCOMPAT=\"32\"  -DCOMPAT_libcompat=\"32\"  -DCOMPAT_LIB32  --sysroot=/usr/obj/usr/src/arm64.aarch64/tmp  -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/lib32  -O2 -pipe -fno-common -fPIC  -g -gz=zlib -MD  -MF.depend.libssp_nonshared.o -MTlibssp_nonshared.o -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter  -Qunused-arguments    -c /usr/src/lib/libssp_nonshared/libssp_nonshared.c -o libssp_nonshared.o

But you have not provided anything to compare with for finding differences.

Simillarly for:

/usr/src/contrib/llvm-project/compiler-rt/lib/builtins/int_util.c

(but needing some output splicing to form the whole line as one) there is:

cc -march=armv7 -m32 -target armv7-unknown-freebsd14.0-gnueabihf  -DCOMPAT_LIBCOMPAT=\"32\"  -DCOMPAT_libcompat=\"32\"  -DCOMPAT_LIB32  --sysroot=/usr/obj/usr/src/arm64.aarch64/tmp  -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/lib32 -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -O2 -pipe -fno-common  -I/usr/src/contrib/llvm-project/libunwind/include -D_LIBUNWIND_IS_NATIVE_ONLY -D_LIBUNWIND_USE_FRAME_HEADER_CACHE -I/usr/src/lib/msun/src -g -gz=zlib -MD  -MF.depend.int_util.o -MTint_util.o -std=gnu99 -Wno-format-zero-length -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter  -Qunused-arguments -fno-exceptions -funwind-tables   -c /usr/src/contrib/llvm-project/compiler-rt/lib/builtins/int_util.c -o int_util.o


Did your build's commands have the expected "-march=armv7"? "-m32"? And so on. You might want to show the exact commands and failure notice together.

===
Mark Millard
marklmi at yahoo.com