Cross compile configurations my projects for Allwinner H3

Hello, I have ubuntu-18.04 on my intel-i7 laptop and I want to cross compile a source code by following the steps in https://openwrt.org/docs/guide-developer/toolchain/crosscompile for orange-pi pc which has Allwinner-H3 on it.

In menuconfig, I selected glibc instead of musl. I built the toolchain by "make toolchain/install"

I have the toolchain: toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_glibc_eabi

I appended following lines to my ~/.bashrc and sourced it.

export STAGING_DIR = /home/sukru/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_glibc_eabi

export TOOLCHAIN_BIN_DIR = /home/sukru/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_glibc_eabi/bin/

PATH=$PATH:$TOOLCHAIN_BIN_DIR
export PATH

According to the doc in the link, I should give --build and --host parameters to the ./configure.

  • Pass the host and build to the build system of the package to trigger cross-compile

  • For GNU configure, use --build=architecture-unknown-linux-gnu --host=architecture-openwrt-linux-uclibc (for example: ./configure --build=x86_64-unknown-linux-gnu –host=mips-openwrt-linux-uclibc)

    • Run ./config.guess to get the --build= option.

    • Check the output and ensure that 'checking whether we are cross compiling… yes' is yes.

  • For GNU make, override the CC and LD environment variables (usually not needed if GNU configure was used)

    • make CC=architecture-openwrt-linux-uclibc-gcc LD=architecture-openwrt-linux-uclibc-ld

What will I write for those parameters according to my system?
./configure --build=??? --host=???
or
make CC=??? LD=???

Thanks in advance...

I asume you already setup your ubuntu for openwrt compiling.

try from beginning again:

# Download and update the sources
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
 
# Select a specific code revision
git checkout v21.02.2
 
# Update the feeds
./scripts/feeds update -a
./scripts/feeds install -a
 

then copy the openwrt offical config for your device:

wget https://downloads.openwrt.org/releases/21.02.2/targets/sunxi/cortexa7/config.buildinfo -O .config

make menuconfig

make -j4

have a tea break.....

@RadioOperator thanks for the reply. I think that I could not write it clearly. I have no problem with generating openwrt image for orangepi-pc. I have my own project(s) and there are Makefile's and configure.ac's within them. I want to run them on openwrt.

I tried helloworld sample project with Makefile and run the following command for compilation:
make CC=arm-openwrt-linux-gcc LD=x86_64-openwrt-linux-ld
The exec. is built with success. I scp'ed the file to openwrt target and it successfully run.

However for more complex projects with configure.ac, I need to know what I will write for:
./configure --build=??? –host=???

Sorry, that's out of my experiences, I cannot help on it.

I always use some exsisting sample/helloworld packages with already configured perfectly for compliling and modify something for my personal projects. I do not touch the complex config parts.