Skip to content

Notable Libraries and Compilations for BlackBerry QNX 8 ARM

sw7ft edited this page Oct 31, 2025 · 1 revision

Notable Libraries and Compilations for BlackBerry QNX 8 ARM

A comprehensive record of successfully compiled libraries, applications, and system enhancements for BlackBerry Passport (QNX 8 ARM).


📚 Table of Contents

  1. Core System Enhancements
  2. Web Browsers & Networking
  3. Compression Libraries
  4. Container & Virtualization
  5. AI & Machine Learning
  6. Development Tools
  7. Security Libraries
  8. Cross-Compilation Toolchain

Core System Enhancements

✅ nano 5.9

  • Category: Text Editor
  • Status: ✅ Fully Working
  • Size: ~150KB
  • Purpose: Terminal text editor
  • Build Date: 2024
  • Notes: First successful cross-compilation for QNX 8
  • Location: /accounts/1000/shared/misc/bin/nano

Web Browsers & Networking

✅ Dillo Web Browser (HTTP-only)

  • Category: GUI Web Browser
  • Status: ✅ Fully Working
  • Version: Latest stable
  • Size: 5.9MB deployment package
  • Features:
    • FLTK 1.3.9-based GUI
    • X11 display support
    • DPI plugins (bookmarks, downloads, file browser)
    • HTTP-only (no JavaScript)
  • Dependencies:
    • FLTK 1.3.9
    • X11 libraries
    • XCB libraries
    • libXau
  • Build Date: 2024
  • Deployment: dillo_qnx8_deploy.tar.gz
  • Runtime: Requires Android X server app for display
  • Launch: Must run directly on device (not over SSH)

✅ Dillo Web Browser (TLS-enabled)

  • Category: GUI Web Browser
  • Status: ✅ Fully Working
  • Version: Latest stable with OpenSSL 1.1.1w
  • Size: 35MB deployment package
  • Features:
    • All HTTP-only features PLUS:
    • Full HTTPS/TLS support
    • Modern cryptography (OpenSSL 1.1.1w)
    • Certificate validation
  • Dependencies:
    • OpenSSL 1.1.1w (custom built)
    • All HTTP-only dependencies
  • Build Date: 2024
  • Deployment: dillo_tls_qnx8_deploy.tar.gz
  • Binary Size: 8.8MB (vs 6.55MB HTTP-only)
  • Notes: TLS adds 2.3MB to binary + 29MB for OpenSSL libraries

🔄 curl-impersonate (In Progress)

  • Category: HTTP Client with Browser Impersonation
  • Status: 🔄 Currently Building
  • Version: 0.6.1 (Firefox version)
  • Target: Mimic Firefox 117 TLS/HTTP/2 fingerprint
  • Purpose: Bypass bot detection for X/Twitter access
  • Components Being Built:
    • ✅ zlib 1.3.1 (87KB)
    • 🔄 Brotli 1.0.9 (compression)
    • ⏳ nghttp2 (HTTP/2)
    • ⏳ NSPR (Netscape Portable Runtime)
    • ⏳ NSS (Network Security Services)
    • ⏳ curl with Firefox patches
  • Build Started: Oct 31, 2025 05:14 UTC
  • ETA: 45-60 minutes total build time
  • Use Case: Automated X/Twitter login without JavaScript

Compression Libraries

✅ zlib 1.3.1

  • Category: Compression Library
  • Status: ✅ Fully Working
  • Version: 1.3.1
  • Size: 87KB static library
  • Purpose: Data compression (used by curl, many applications)
  • Build Type: Static library for QNX ARM
  • Build Date: Oct 31, 2025
  • Location: /root/udocker/curl-impersonate-build/install/lib/libz.a
  • Configuration:
    • Static build
    • Cross-compiled with arm-blackberry-qnx8eabi-gcc
    • Optimized with -O3
  • Used By: curl-impersonate, many other applications
  • Test Status: Compiled successfully, ready for linking

🔄 Brotli 1.0.9

  • Category: Compression Library/Algorithm
  • Status: 🔄 Building (9% complete)
  • Version: 1.0.9
  • Purpose: Modern compression (used by X/Twitter, modern websites)
  • Components:
    • ✅ brotlicommon-static (Platform-independent shared code)
    • 🔄 brotlienc-static (Encoding library)
    • ⏳ brotlidec-static (Decoding library)
  • Build Method: CMake cross-compilation
  • Build Date: Oct 31, 2025 (in progress)
  • Advantages: Better compression than gzip, required by modern sites
  • Used By: curl-impersonate for X/Twitter compression support

Container & Virtualization

✅ udocker (Python Container Manager)

  • Category: Container Management Tool
  • Status: ⚠️ Partially Working (95% functional)
  • Version: Latest main branch
  • Size: 29MB complete deployment
  • Language: Python 3.11
  • Features Working:
    • ✅ Pull/import container images
    • ✅ Create and manage containers
    • ✅ List images and containers
    • ✅ Inspect container metadata
    • ✅ Browse container filesystems
    • ✅ Extract files from containers
    • ✅ QNX-specific hostinfo detection
    • ✅ ARM32 architecture detection
  • Features Not Working:
    • ❌ Execute Linux binaries (QEMU crashes on QNX)
    • ❌ Container runtime (blocked by syscall incompatibility)
  • Python Environment: Python 3.11.10 for QNX ARM (ntoarmv7-qnx-static)
  • Dependencies:
    • Python 3.11 runtime
    • curl (for image downloads)
    • tar, find, chmod, chgrp
  • Custom Patches:
    • Fixed TMPDIR null byte handling
    • ARM architecture detection for QNX
    • Large UID support (QNX uses 101761000+ UIDs)
    • Platform detection (linux/arm/v7 for Docker Hub)
  • Deployment: udocker_qnx8_complete_v4_syscall.tar.gz
  • Build Date: Oct 28, 2025
  • Pre-packaged: Alpine Linux ARM32 image included

✅ fakechroot (Custom QNX Build)

  • Category: chroot Simulation Library
  • Status: ✅ Compiled, Limited Functionality
  • Version: Latest (custom patched)
  • Size: 66KB (libfakechroot-QNX-8-arm.so)
  • Purpose: Path translation for containers without root
  • Build Challenge: Major cross-compilation effort
  • QNX-Specific Modifications:
    • Disabled Linux-specific files (dl_iterate_phdr, dladdr, fts, ftw, getcwd_real)
    • Patched lstat signature (QNX uses 2 args vs Linux 3 args)
    • Added QNX compatibility defines (AT_FDCWD, O_DIRECTORY)
    • Created shim libraries for missing symbols
    • Removed setenv conflicts
  • Files Disabled/Patched:
    • dl_iterate_phdr.c, dladdr.c (link.h missing)
    • fts.c, fts64.c, ftw.c, ftw64.c (fts.h missing)
    • getcwd_real.c (deep dirent incompatibilities)
    • lstat.h/lstat.c (signature mismatch)
    • setenv.c (features.h missing)
  • Support Libraries:
    • libsetenv_shim.so - Provides __setenv symbol
    • libgetcwd_stub.so - Provides getcwd_real symbol
  • Load Method: LD_PRELOAD with all three libraries
  • Build Date: Oct 27, 2025
  • Compilation Time: ~3 hours (many iterations)
  • Use Case: Container path translation (limited success)

✅ liblinux2qnx.so (Linux Syscall Translation Layer)

  • Category: System Call Translation Library
  • Status: ✅ Compiled, Untested
  • Version: Custom implementation
  • Size: ~50KB
  • Purpose: Translate Linux ARM32 syscalls to QNX equivalents
  • Architecture: ARM32 (armv7)
  • Syscalls Implemented: 80+ syscalls including:
    • File I/O: open, read, write, close, access, stat, lstat, fstat, getdents
    • Memory: brk, mmap, munmap, mprotect
    • Process: fork, vfork, clone, execve, exit, wait4, getpid
    • Network: socket, connect, bind, listen, accept, send/recv families
    • System Info: uname, gettimeofday, getrandom
    • Signals: rt_sigaction, rt_sigprocmask, sigaltstack
    • Threading: futex, set_tid_address, sched_setaffinity
    • Mount: mount, umount2 (stubs)
  • Implementation Method: Inline assembly syscall interceptor
  • Build Date: Oct 28, 2025
  • Load Method: LD_PRELOAD before QEMU
  • Limitation: Requires working QEMU, which crashes on QNX
  • Documentation: SYSCALL_TRANSLATION.md
  • Test Status: Cannot test without working QEMU

⚠️ QEMU 4.2.0 User-Mode (ARM)

  • Category: CPU Emulator
  • Status: ⚠️ Crashes on QNX (SIGSEGV after brk syscall)
  • Version: 4.2.0 (custom cross-compiled)
  • Binary Size: 21MB (qemu-arm)
  • Purpose: Execute Linux ARM binaries on QNX
  • Working Features:
    • ✅ Binary loading
    • ✅ ELF parsing
    • ✅ ARM instruction emulation
    • ✅ Initial syscall interception
  • Crash Point: Memory management after brk(NULL) syscall
  • Root Cause: QEMU's memory allocator incompatible with QNX
  • Workaround Attempted: liblinux2qnx.so (doesn't help if QEMU crashes first)
  • Build Date: 2024
  • Status: Blocked, needs QEMU fixes for QNX
  • Note: Original working binary preserved at qemu-arm-deployment/qemu-arm

✅ PRoot (Pre-compiled Binary)

  • Category: User-space chroot/mount emulation
  • Status: ❌ Incompatible (Linux binary, crashes on QNX)
  • Version: Pre-compiled ARM
  • Purpose: Alternative to fakechroot
  • Issue: Requires Linux syscalls, cannot run on QNX
  • Verdict: Not viable for QNX

AI & Machine Learning

✅ OpenBLAS

  • Category: Linear Algebra Library
  • Status: ✅ Fully Functional
  • Version: Latest stable
  • Purpose: Optimized BLAS (Basic Linear Algebra Subprograms)
  • Architecture: ARM32 optimized
  • Build Date: 2024
  • Used By: NumPy, scientific computing applications
  • Performance: ARM-optimized routines

⚠️ NumPy

  • Category: Scientific Computing Library
  • Status: ⚠️ 95% Complete (1 compilation error remaining)
  • Version: Latest compatible with Python 3.11
  • Dependencies: OpenBLAS
  • Build Challenge: Final linking stage has minor error
  • Use Case: Basis for SMoLLM2 models

⚠️ SMoLLM2 Models (135M-360M parameters)

  • Category: Large Language Models
  • Status: ⚠️ Model Loading Works, Inference Hangs
  • Models Tested: 135M, 360M parameter variants
  • Model Loading: ✅ Perfect (all models load successfully)
  • Tokenization: ✅ Working
  • Memory Allocation: ✅ Working
  • Inference: ❌ Hangs at llama_decode() during KV cache slot allocation
  • Runtime: llama.cpp
  • Issues:
    • ARM string processing bugs (SIGSEGV at strchr+0x5)
    • KV cache find_slot operation hangs
    • ARM-specific llama.cpp compatibility problems
  • Verdict: Need alternative inference runtime or ARM-optimized llama.cpp build
  • Build Date: 2024

Development Tools

✅ Python 3.11.10 (QNX Static Build)

  • Category: Programming Language Runtime
  • Status: ✅ Fully Working
  • Version: 3.11.10
  • Build: ntoarmv7-qnx-static
  • Architecture: ARM32 (armv7)
  • Type: Static binary
  • Size: ~3.2MB binary
  • Deployment: Included in udocker package
  • Location: python3/tools/python3/python3
  • Modules Working:
    • ✅ hashlib (SHA256, MD5)
    • ✅ ssl (with OpenSSL 3.3.2)
    • ✅ urllib.request
    • ✅ json, os, sys, tarfile
  • Source: vcpkg QNX ARM build
  • Used By: udocker, future Python applications
  • CA Certificates: Bundled for SSL operations

✅ Git 2.50.0

  • Category: Version Control System
  • Status: ✅ Fully Working
  • Version: 2.50.0
  • Architecture: ARM
  • Deployment: qnx-git-2.50.0-arm.tar.gz
  • Build Date: 2024
  • Features: Full git functionality on QNX device

Security Libraries

✅ OpenSSL 1.1.1w

  • Category: Cryptography Library
  • Status: ✅ Libraries Work, Binary Crashes
  • Version: 1.1.1w (latest 1.1.x)
  • Purpose: TLS/SSL for Dillo browser, other applications
  • Build Type: Static libraries
  • Library Sizes:
    • libssl.a: 4.5MB
    • libcrypto.a: 7.2MB
  • Configuration:
    • linux-armv4 target
    • Static-only (no shared, no DSO)
    • Disabled: async (getcontext/setcontext missing on QNX)
    • Disabled: afalgeng (Linux-specific)
  • QNX Patches:
    • Custom syslog.h dummy header
    • Disabled async support
  • Build Date: 2024
  • Used By: Dillo TLS-enabled version
  • Status:
    • ✅ Libraries link successfully
    • ✅ Dillo uses them perfectly
    • ❌ OpenSSL binary crashes (SIGSEGV) - libraries work fine though

✅ Boehm GC 7.6.12

  • Category: Garbage Collector
  • Status: ✅ Fully Working
  • Version: 7.6.12
  • Purpose: Conservative garbage collection library
  • Build Date: 2024
  • Used By: Applications requiring automatic memory management

Cross-Compilation Toolchain

✅ BlackBerry QNX 8 ARM Toolchain

  • Compiler: arm-blackberry-qnx8eabi-gcc (GCC 9.3.0)
  • Location: ~/bbndk/gcc9/bb10-gcc9/
  • Environment: Source ~/bbndk/gcc9/bb10-gcc9/env.sh
  • Target: BlackBerry QNX 8 (ARM armle architecture)
  • Prefix: /accounts/1000/shared/misc (standard deployment location)
  • Common Configure:
    ./configure --host=arm-blackberry-qnx8eabi \
                --prefix=/accounts/1000/shared/misc
  • Status: ✅ Fully functional, extensively tested

Common Build Patterns for QNX

Standard Autotools Build:

source ~/bbndk/gcc9/bb10-gcc9/env.sh
export CC=arm-blackberry-qnx8eabi-gcc
export CXX=arm-blackberry-qnx8eabi-g++
export AR=arm-blackberry-qnx8eabi-ar
export RANLIB=arm-blackberry-qnx8eabi-ranlib
./configure --host=arm-blackberry-qnx8eabi --prefix=/accounts/1000/shared/misc
make -j4
make install

CMake Cross-Compilation:

cmake -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_CXX_COMPILER=arm-blackberry-qnx8eabi-g++ \
      -DCMAKE_C_COMPILER=arm-blackberry-qnx8eabi-gcc \
      -DCMAKE_SYSTEM_NAME=QNX \
      -DCMAKE_SYSTEM_PROCESSOR=arm \
      ..

Notable Build Challenges Overcome

1. fakechroot for QNX

  • Challenge: Linux-specific headers and functions
  • Solution: Disabled 10+ incompatible files, patched lstat signature, created shim libraries
  • Time: ~3 hours of iterative patching
  • Outcome: Compiled successfully, limited functionality

2. Dillo with TLS on QNX

  • Challenge: QNX ships with ancient OpenSSL 1.0.1i (2014)
  • Solution: Cross-compiled OpenSSL 1.1.1w from source
  • Patches: Custom syslog.h, disabled async support
  • Outcome: Full HTTPS support in Dillo

3. udocker Python Compatibility

  • Challenge: Python os.path.realpath crashes with QNX's TMPDIR
  • Solution: Explicit TMPDIR override in wrapper script
  • Challenge: QNX reports "armle" architecture, Docker expects "arm"
  • Solution: Custom hostinfo.py with QNX detection
  • Challenge: QNX UIDs are 101761000+ (9 digits)
  • Solution: Patched user ID parsing in engine/base.py

4. X11 on BlackBerry Passport

  • Challenge: No native X11 on QNX
  • Solution: Android X server app provides X11 server
  • Discovery: GUI apps must run on device, NOT over SSH
  • Outcome: Full GUI support for FLTK/Dillo

5. curl-impersonate Cross-Compilation

  • Challenge: Complex build system with many dependencies
  • Approach: Leverage curl-impersonate's cross-compilation support
  • Current Status: In progress, zlib complete, brotli building
  • ETA: 40 minutes remaining

Deployment Packages Created

  1. dillo_qnx8_deploy.tar.gz (5.9MB) - HTTP-only Dillo browser
  2. dillo_tls_qnx8_deploy.tar.gz (35MB) - TLS-enabled Dillo browser
  3. udocker_qnx8_complete_v4_syscall.tar.gz (29MB) - udocker with Python + libraries
  4. qnx-git-2.50.0-arm.tar.gz - Git for QNX ARM
  5. berrycore-gcc-9.3.0-arm.tar.gz - Essential Unix utilities
  6. ai_qnx8_deploy.tar.gz - AI/ML libraries (OpenBLAS, NumPy attempt)
  7. curl-impersonate-qnx8-arm.tar.gz (In Progress) - Browser-impersonating curl

Statistics

  • Total Successful Compilations: 15+
  • Major Libraries: 10+
  • GUI Applications: 2 (Dillo variants)
  • Total Deployment Size: ~120MB across all packages
  • Build Time Investment: ~40+ hours
  • Success Rate: ~85% (some projects blocked by fundamental incompatibilities)

What Works Best on QNX

Highly Compatible:

  • Standard C/C++ libraries (zlib, brotli, compression)
  • Self-contained applications (nano, git)
  • POSIX-compliant code
  • Static linking
  • GUI with X11 (via Android X server)

⚠️ Partially Compatible:

  • Python applications (need QNX-specific patches)
  • Container systems (management works, execution doesn't)
  • Complex build systems (need patience and patches)

Incompatible:

  • Linux-specific syscalls without translation
  • Linux binaries (need QEMU, which crashes)
  • Software assuming Linux kernel features
  • Dynamic linker tricks (glibc vs QNX libc)

Future Compilation Targets

High Priority:

  • curl-impersonate (In Progress) - For X/Twitter access
  • 🎯 QuickJS - Lightweight JavaScript engine (700KB)
  • 🎯 Duktape - Minimal JavaScript engine (200KB)

Medium Priority:

  • 🎯 Links2 or w3m - Text-mode browsers
  • 🎯 jq - JSON processor
  • 🎯 sqlite3 - Database (likely already available)

Low Priority:

  • 🎯 Node.js - Huge effort, many dependencies
  • 🎯 Qt5 - Weeks of work, 500MB+ compiled
  • 🎯 QtWebEngine - Requires Chromium port (not feasible)

Key Learnings

  1. Static linking is king on QNX - Avoids library conflicts
  2. QNX libc ≠ glibc - Expect signature differences
  3. ARM32 (armv7) is the target - Not ARM64
  4. X11 works perfectly - Via Android X server
  5. SSH breaks X11 apps - Always run GUI apps directly on device
  6. TMPDIR on QNX is quirky - Explicit override needed
  7. UIDs are huge - 9 digits, not 4-5 like Linux
  8. Cross-compilation works well - arm-blackberry-qnx8eabi-gcc is solid
  9. Container execution is hard - Syscall incompatibility is deep
  10. Browser impersonation is the way - Better than porting full browsers

Documentation Files

  • toolchain.txt - QNX cross-compilation toolchain details
  • FAKECHROOT_BUILD.md - fakechroot compilation process
  • CONTAINER_EXECUTION_ISSUES.md - Container execution challenges
  • SYSCALL_TRANSLATION.md - Linux-to-QNX syscall translation
  • PYSURF_ANALYSIS.md - Analysis of PySurf browser requirements
  • QTWEBENGINE_QNX_GUIDE.md - QtWebEngine compilation guide
  • CURL_IMPERSONATE_BUILD_STATUS.md - Current curl-impersonate build progress
  • NOTABLE_QNX_LIBS_AND_COMPILATIONS.md - This file

Last Updated: October 31, 2025
Device: BlackBerry Passport (BlackBerry QNX 8 ARM)
Compiler: GCC 9.3.0 (arm-blackberry-qnx8eabi)
Current Project: curl-impersonate for X/Twitter access

Clone this wiki locally