Files
openwrt/docs/flint1-sdk-research.md
2026-03-22 00:54:57 -07:00

6.6 KiB
Executable File

GL-AX1800 (Flint1) SDK Research and Cross-Compilation Strategy

Date: 2026-01-11
Device: GL-AX1800 (Flint 1)
SoC: Qualcomm IPQ6000 (Quad-core ARM @ 1.2GHz)

Architecture Confirmation (CORRECTED)

Important

Confirmed from actual hardware:

  • Flint1 (GL-AX1800): ARMv7 rev 4 (v7l) - 32-bit ARM
  • Flint2 (GL-MT6000): ARMv8 rev 4 (v8l) - 64-bit ARM (aarch64)

These are different architectures and require separate binaries.

Architecture Details

GL-AX1800 (Flint1):

  • CPU: ARMv7 Processor rev 4 (v7l)
  • Instruction set: 32-bit ARM
  • Typical target triplet: arm-linux-musleabihf or armv7l-linux-musleabihf

GL-MT6000 (Flint2):

  • CPU: ARMv8 Processor rev 4 (v8l)
  • Instruction set: 64-bit ARM (aarch64)
  • Typical target triplet: aarch64-linux-musl

SDK Options for GL-AX1800 (ARMv7)

Source: https://musl.cc/

Relevant Toolchains

  • armv7l-linux-musleabihf-cross.tgz (ARMv7, hard-float)
  • arm-linux-musleabihf-cross.tgz (Generic ARM, hard-float)

Download:

wget https://musl.cc/armv7l-linux-musleabihf-cross.tgz
tar -xzf armv7l-linux-musleabihf-cross.tgz
export PATH=$PWD/armv7l-linux-musleabihf-cross/bin:$PATH

Advantages

  • Quick setup (download and extract)
  • Modern GCC (13.2+) with C++23 support
  • Proven for static binary compilation
  • Small download (~40-50MB compressed)

Disadvantages

  • Not optimized for IPQ6000 specifically
  • Generic ARMv7 (not Cortex-A7 specific)

Option 2: musl-cross-make (Build Your Own)

Source: https://github.com/richfelker/musl-cross-make

Configuration for ARMv7

TARGET = armv7l-linux-musleabihf
# or: arm-linux-musleabihf
GCC_VER = 14.2.0
MUSL_VER = 1.2.5
LINUX_VER = 6.6.y
GCC_CONFIG += --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard

Advantages

  • Full control over toolchain versions
  • Can build latest GCC 14+ for C++23
  • Optimize for Cortex-A7 specifically
  • Creates musl-based static-friendly toolchain

Disadvantages

  • Time-consuming build (30-60 minutes)
  • Requires build dependencies
  • More complex setup

SDK: ipq807x-2102
GCC: 5.5.0 (Too old)
Architecture: arm_cortex-a7 (32-bit)

Why Not Use This?

  • GCC 5.5.0 cannot compile C++23 (btop)
  • Outdated toolchain from ~2017
  • Build failures documented in agent-notes/glax1800-build-results.md
  • Correct architecture (ARMv7), but toolchain too old

Compilation Requirements

btop Requirements

Language: C++23
Minimum GCC: 11 (experimental), 14+ recommended (full support)
Dependencies: None (headers only)
Build System: Make or CMake
Static Linking: Fully supported with musl

Build Strategy

# With OpenWrt SDK
make STATIC=true VERBOSE=true CXX=aarch64-openwrt-linux-musl-g++ \
     CXXFLAGS="-static -std=c++23 -O3" LDFLAGS="-static"

mosh Requirements

Language: C++14
Build System: Autotools (./configure)
Dependencies (must be cross-compiled):

  • protobuf 3.x (C++ library, requires host protoc)
  • ncurses 6.x (terminfo)
  • OpenSSL 1.1.x (or omit with --without-crypto)
  • zlib (compression)

Build Strategy (Multi-Stage)

  1. Build host protoc (x86_64)

    cd protobuf-3.17.3
    ./configure --prefix=/usr/local
    make && sudo make install
    
  2. Cross-compile protobuf libraries

    ./configure --host=aarch64-linux-musl --prefix=$PWD/sysroot \
                --with-protoc=/usr/local/bin/protoc \
                CXXFLAGS="-static" LDFLAGS="-static"
    make && make install
    
  3. Cross-compile ncurses

    ./configure --host=aarch64-linux-musl --prefix=$PWD/sysroot \
                --without-shared --with-normal --without-debug
    make && make install
    
  4. Build mosh (static)

    ./configure --host=aarch64-linux-musl \
                PKG_CONFIG_PATH=$PWD/sysroot/lib/pkgconfig \
                CXXFLAGS="-static" LDFLAGS="-static -pthread" \
                --without-crypto  # Optional: skip OpenSSL
    make
    

Existing Build Environment

The src/mosh/ directory already has:

  • env.sh - Cross-compilation environment
  • sysroot/ - Custom libraries
  • host_protoc/ - Host protobuf compiler
  • Built static binaries (for aarch64)

This can likely be reused or adapted!


Phase 1: Toolchain Setup

Use musl.cc pre-built ARMv7 toolchain for fastest results:

cd /home/user/Public/Projects/OpenWRT/sdk/

# Download ARMv7 hard-float toolchain
wget https://musl.cc/armv7l-linux-musleabihf-cross.tgz
tar -xzf armv7l-linux-musleabihf-cross.tgz

# Add to PATH
export PATH=$PWD/armv7l-linux-musleabihf-cross/bin:$PATH

# Verify
armv7l-linux-musleabihf-gcc --version

Phase 2: Build btop for ARMv7

cd /home/user/Public/Projects/OpenWRT/src/btop

# Clean previous builds
make clean

# Build static for ARMv7
make STATIC=true \
     CXX=armv7l-linux-musleabihf-g++ \
     CXXFLAGS="-static -std=c++23 -O3 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard" \
     LDFLAGS="-static"

# Verify architecture
file bin/btop
# Should show: ELF 32-bit LSB executable, ARM, EABI5

# Copy to flint1 binaries
cp bin/btop /home/user/Public/Projects/OpenWRT/binaries/flint1/btop/

Phase 3: Build mosh for ARMv7

Mosh requires cross-compiling dependencies. Two options:

Option A: Adapt Existing Environment

The src/mosh/ directory has a working setup for aarch64. Update it for ARMv7:

cd /home/user/Public/Projects/OpenWRT/src/mosh

# Update environment
export PATH=/path/to/armv7l-linux-musleabihf-cross/bin:$PATH
export CC=armv7l-linux-musleabihf-gcc
export CXX=armv7l-linux-musleabihf-g++
export AR=armv7l-linux-musleabihf-ar
export RANLIB=armv7l-linux-musleabihf-ranlib

# Rebuild protobuf for ARMv7
# (Host protoc already built)

# Configure mosh
./configure --host=armv7l-linux-musleabihf \
            CXXFLAGS="-static" \
            LDFLAGS="-static -pthread" \
            --without-crypto

make clean && make

Option B: Fresh Build

Follow multi-stage process from research document (protobuf → ncurses → mosh).


Next Steps

  1. Verify architecture - Confirmed ARMv7 (32-bit ARM) vs ARMv8 (aarch64)
  2. ⏭️ Download ARMv7 toolchain - Use musl.cc armv7l-linux-musleabihf
  3. ⏭️ Build btop - Static ARMv7 binary with modern GCC
  4. ⏭️ Build mosh - Cross-compile dependencies + static linking
  5. ⏭️ Create .ipk packages - Package for opkg installation
  6. ⏭️ Test on hardware - Verify on actual GL-AX1800