Solved arm64 problem update stable 12 to release 12

Bormental

Member


Messages: 33

hi
i have:
Code:
FreeBSD rpc-opipc2 12.0-BETA3 FreeBSD 12.0-BETA3 ca587a7a9f6(stable/12) OPIPC2  arm64
and source from git RELEASE 12
make cross build from amd64
Code:
#!/bin/sh
export BASEDIR=/usr
export TARGET=arm64
export TARGET_ARCH=aarch64
export UBLDR_LOADADDR=0x4a000000
export MAKEOBJDIRPREFIX=${BASEDIR}/obj
export __MAKE_CONF=/dev/null
export SRCCONF=/dev/null

cd ${BASEDIR}/src
make cleandir
make cleandir
make -j $(sysctl -n hw.ncpu) -DWITH_FDT buildworld > ${BASEDIR}/buildworld_${TARGET}_${TARGET_ARCH}.log
make -j $(sysctl -n hw.ncpu) kernel-toolchain > ${BASEDIR}/ktoolchain_${TARGET}_${TARGET_ARCH}.log
all ok

but when installed on arm64 issues
Code:
/tmp / install.lalala/sh: install: exec format error
before CURRENT-12 to STABLE-12 all was installed normally. Prompt where and what to check? Tried Directive WITHOUT_SYSTEM_COMPILER and WITHOUT_SYSTEM_LINKER the result is the same.
 

acheron

Well-Known Member

Reaction score: 188
Messages: 470

Are you installing world from your aarch64 board? It's not possible when you crossbuild. You'll have to do it from your amd64 box: make TARGET_ARCH=aarch64 DESTDIR=/path/to/sdcard installworld
UBLDR_LOADADDR is not used on aarch64 and no need to export TARGET.
 
OP
OP
Bormental

Bormental

Member


Messages: 33

Are you installing world from your aarch64 board? It's not possible when you crossbuild. You'll have to do it from your amd64 box: make TARGET_ARCH=aarch64 DESTDIR=/path/to/sdcard installworld
UBLDR_LOADADDR is not used on aarch64 and no need to export TARGET.
hmm, but I did it with current on stable. gathered on amd64 and executed make installworld on arm64 and everything passed successfully. UBLDR_LOADADDR need it as I use orange pi pc2

to install using DESTDIR I can't because access between machines via nfs only

The only difference is that earlier on amd64 was freebsd-11.2 release. Later I updated to 12 release, further through nfs updated all machines with architecture amd64 and here arm64 through cross build as on 11.2 it did not turn out..
 

acheron

Well-Known Member

Reaction score: 188
Messages: 470

I beg your pardon. Please tell me. On the wiki it says that the EFI for amd64 and arm64. But in GENERIC for arm there is an option:
Code:
# Extensible Firmware Interface
options     EFI
is it supported?
Thanks!
Yes, we use it to boot armv6/7 (since 12.0-release iirc) and aarch64 board
 
OP
OP
Bormental

Bormental

Member


Messages: 33

ubldr is not used on aarch64, the boot is done via efi.
You should try to upgrade your box with pkgbase https://wiki.freebsd.org/PkgBase
hi,
I updated the packages...
how will cross build be correct?

Code:
--- buildworld ---
make[1]: "/usr/src/Makefile.inc1" line 341: SYSTEM_COMPILER: Determined that CC=cc matches the source tree.  Not bootstrapping a cross-compiler.
make[1]: "/usr/src/Makefile.inc1" line 346: SYSTEM_LINKER: Determined that LD=ld matches the source tree.  Not bootstrapping a cross-linker.
if not use variables COMPILER and LINKER
or

Code:
--- buildworld ---
make[1]: "/usr/src/Makefile.inc1" line 343: SYSTEM_COMPILER: libclang will be built for bootstrapping a cross-compiler.
make[1]: "/usr/src/Makefile.inc1" line 348: SYSTEM_LINKER: libclang will be built for bootstrapping a cross-linker.
--- buildworld_prologue ---
if use
Code:
if [ ${TARGET} = $(uname -m) ] # and TARGET_ARCH ne $(uname -m -p)
    then
        echo 'without cross...'
        export WITHOUT_CROSS_COMPILER=yes
        export WITHOUT_CROSS_LINKER=yes
    else
        echo 'without system...'
        export WITHOUT_SYSTEM_COMPILER=yes
        export WITHOUT_SYSTEM_LINKER=yes
    fi
 

acheron

Well-Known Member

Reaction score: 188
Messages: 470

Sorry, I don't understand what you are trying to achieve. If you want to cross build from amd64:

make TARGET_ARCH=aarch64 buildworld buildkernel
make TARGET_ARCH=aarch64 packages

and you should have packages in /usr/obj/usr/src/repo/FreeBSD:13:aarch64/
 
OP
OP
Bormental

Bormental

Member


Messages: 33

Sorry, I don't understand what you are trying to achieve. If you want to cross build from amd64:

make TARGET_ARCH=aarch64 buildworld buildkernel
make TARGET_ARCH=aarch64 packages

and you should have packages in /usr/obj/usr/src/repo/FreeBSD:13:aarch64/
if i this execute then log contain:
"Not bootstrapping a cross-compiler."
this is a little different from my croos build)) I will try both options. thank.
 
OP
OP
Bormental

Bormental

Member


Messages: 33

Sorry, I don't understand what you are trying to achieve. If you want to cross build from amd64:

make TARGET_ARCH=aarch64 buildworld buildkernel
make TARGET_ARCH=aarch64 packages

and you should have packages in /usr/obj/usr/src/repo/FreeBSD:13:aarch64/
from nfs after installworld i got:
#!/bin/sh
export BASEDIR=/usr
export MAKEOBJDIRPREFIX=${BASEDIR}/obj
export KERNCONF=OPIARM64

cd ${BASEDIR}/src
make test-system-compiler
make -DWITH_FDT -DWITHOUT_DEBUG_FILES -DWITHOUT_TESTS -DWITHOUT_GAMES installworld > ${BASEDIR}/installworld.log



Code:
make[1]: "/usr/obj/usr/src/arm64.aarch64/toolchain-metadata.mk" line 1: Using cached toolchain metadata from build at vpc-desktopbsd on четверг, 14 марта 2019 г. 17:38:51 (MSK)
--------------------------------------------------------------
>>> Install check world
--------------------------------------------------------------
mkdir -p /tmp/install.jyDKjU9O
progs=$(for prog in [ awk cap_mkdb cat chflags chmod chown cmp cp  date echo egrep find grep id install   ln make mkdir mtree mv pwd_mkdb  rm sed services_mkdb sh sort strip sysctl test true uname wc zic tzsetup   makewhatis; do  if progpath=`which $prog`; then  echo $progpath;  else  echo "Required tool $prog not found in PATH." >&2;  exit 1;  fi;  done);  libs=$(ldd -f "%o %p\n" -f "%o %p\n" $progs 2>/dev/null | sort -u |  while read line; do  set -- $line;  if [ "$2 $3" != "not found" ]; then  echo $2;  else  echo "Required library $1 not found." >&2;  exit 1;  fi;  done);  cp $libs $progs /tmp/install.jyDKjU9O
cp -R ${PATH_LOCALE:-"/usr/share/locale"} /tmp/install.jyDKjU9O/locale
cd /usr/src; MACHINE_ARCH=aarch64  MACHINE=arm64  CPUTYPE= CC="cc -target aarch64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/arm64.aarch64/tmp -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin" CXX="c++  -target aarch64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/arm64.aarch64/tmp -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin"  CPP="cpp -target aarch64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/arm64.aarch64/tmp -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin"  AS="as" AR="ar" LD="ld" LLVM_LINK=""  NM=nm OBJCOPY="objcopy"  RANLIB=ranlib STRINGS=  SIZE="size" PATH=/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/bin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin:/tmp/install.jyDKjU9O  LD_LIBRARY_PATH=/tmp/install.jyDKjU9O  PATH_LOCALE=/tmp/install.jyDKjU9O/locale make -f Makefile.inc1    __MAKE_SHELL=/tmp/install.jyDKjU9O/sh reinstall;  MACHINE_ARCH=aarch64  MACHINE=arm64  CPUTYPE= CC="cc -target aarch64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/arm64.aarch64/tmp -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin" CXX="c++  -target aarch64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/arm64.aarch64/tmp -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin"  CPP="cpp -target aarch64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/arm64.aarch64/tmp -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin"  AS="as" AR="ar" LD="ld" LLVM_LINK=""  NM=nm OBJCOPY="objcopy"  RANLIB=ranlib STRINGS=  SIZE="size" PATH=/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/bin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin:/tmp/install.jyDKjU9O  LD_LIBRARY_PATH=/tmp/install.jyDKjU9O  PATH_LOCALE=/tmp/install.jyDKjU9O/locale rm -rf /tmp/install.jyDKjU9O
--------------------------------------------------------------
>>> Making hierarchy
--------------------------------------------------------------
cd /usr/src; make -f Makefile.inc1  LOCAL_MTREE= hierarchy
cd /usr/src/etc; PATH=/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/bin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/bin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin:/tmp/install.jyDKjU9O make LOCAL_MTREE= distrib-dirs
for file in /usr/share/doc/usd/10.exref /usr/share/doc/usd/11.edit /usr/share/doc/usd/12.vi /usr/share/doc/usd/13.viref; do  if [ -f /${file} ]; then  rm -f /${file};  fi;  done
mtree -deU -i -f /usr/src/etc/mtree/BSD.root.dist -p /
mtree -deU -i -f /usr/src/etc/mtree/BSD.var.dist -p /var
mtree -deU -i -f /usr/src/etc/mtree/BSD.usr.dist -p /usr
mtree -deU -i -f /usr/src/etc/mtree/BSD.include.dist -p /usr/include
mtree -deU -i -f /usr/src/etc/mtree/BSD.debug.dist -p /usr/lib
mtree -deU -i -f /usr/src/etc/mtree/BSD.lib32.dist -p /usr
mtree -deU -i -f /usr/src/etc/mtree/BSD.lib32.dist -p /usr/lib/debug/usr
mtree -deU -i -f /usr/src/etc/mtree/BSD.tests.dist -p /usr/tests
mtree -deU -i -f /usr/src/etc/mtree/BSD.tests.dist -p /usr/lib/debug//usr/tests
mtree -deU -i -f /usr/src/etc/mtree/BSD.sendmail.dist -p /
set - `grep "^[a-zA-Z]" /usr/src/etc/nls.alias`;  while [ $# -gt 0 ] ; do  install -l s -o root -g wheel -m 755 "$2" "/usr/share/nls/$1";  shift; shift;  done
/tmp/install.jyDKjU9O/sh: install: Exec format error
*** Error code 126

Stop.
make[4]: stopped in /usr/src/etc
*** Error code 1

Stop.
make[3]: stopped in /usr/src
*** Error code 1

Stop.
make[2]: stopped in /usr/src
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src
 
OP
OP
Bormental

Bormental

Member


Messages: 33

I removed the folder /usr/obj/usr/src/arm64.aarch64/tmp and the installation from nfs dir started ...
 
Top