Crosscompile archlinux aarch64

Linux specific questions.
Post Reply
bfg
Posts: 7
Joined: Feb 02, 2008 0:45

Crosscompile archlinux aarch64

Post by bfg »

Hi everyone,
I'm trying to crosscompile aarch64 from archlinux x86_64.
Previously I've installed aarch64-linux-gnu-gcc package

Code: Select all

make 'FBC=~/Download/FreeBASIC-1.09.0-source-bootstrap/bin/fbc -i ~/Download/FreeBASIC-1.09.0-source-bootstrap/inc'
from a source-bootstrap is ok. It builds native fbc for x86_64
but if I try to build additional libraries for cross-compiling...

Code: Select all

make 'FBC=~/Download/FreeBASIC-1.09.0-source-bootstrap/bin/fbc -i ~/Download/FreeBASIC-1.09.0-source-bootstrap/inc' rtlib gfxlib2 TARGET=aarch64-linux-gcc
CC src/rtlib/obj/linux-aarch64/hinit.o
src/rtlib/unix/hinit.c:10:10: fatal error: termcap.h: No such file or directory
   10 | #include <termcap.h>
      |          ^~~~~~~~~~~
compilation terminated.
But

Code: Select all

/usr/include/termcap.h
exists

I don't understand whats wrong. Can you help me?
coderJeff
Site Admin
Posts: 4014
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: Crosscompile archlinux aarch64

Post by coderJeff »

bfg wrote: Nov 19, 2022 15:21 I don't understand whats wrong. Can you help me?
Try with verbose output (V=1) to get more info, hopefully that will give some clues:

Code: Select all

make V=1 'FBC=~/Download/FreeBASIC-1.09.0-source-bootstrap/bin/fbc -i ~/Download/FreeBASIC-1.09.0-source-bootstrap/inc' rtlib gfxlib2 TARGET=aarch64-linux-gcc
My experience when cross-compiling, you will need all the headers and libraries of the target in the tool chains target directories, since the headers and libraries for the build system won't be usable.
Something like:
'/usr/include/aarch64-linux-gcc/termcap.h', or
'/usr/aarch64-linux-gnu/include/termcap.h'

Same for any needed bins, and libs.
Sorry, I don't know the exact location for your build system.

If you are sure that '/usr/include/termcap.h' is ok to use, then add include directory needed to the CFLAGS variable in the make command:

Code: Select all

make CFLAGS="-O2 -I/usr/include/" ....
Basically, the cross compiler invoked (gcc) decides where to look for headers/libraries/binaries.
bfg
Posts: 7
Joined: Feb 02, 2008 0:45

Re: Crosscompile archlinux aarch64

Post by bfg »

Thank you I will try as you suggest.
But yesterday I've tried with an Ubuntu 16.04 virtual machine and it works. So I guess something related to where 'aarch64-linux-gnu-gcc' look for include files in archlinux build
Post Reply