PERLQNX(1)

πŸ’– PERLQNX β€” perlqnx(1) πŸ’–

okay bestie, sit DOWN because we're talking about Perl version 5 on QNX and this one is a whole journey. it's giving vintage unix port energy, it's giving "I fought a compiler and the compiler won a few rounds", and honestly? iconic. let's get into it 🫢


✨ DESCRIPTION ✨

so as of perl5.7.2, all the tests pass under:

  QNX 4.24G
  Watcom 10.6 with Beta/970211.wcc.update.tar.F
  socket3r.lib Nov21 1996.

slay. but then β€” and this is the plot twist 😭 β€” as of perl5.8.1 there's at least one test still failing.

also, some tests may complain under known circumstances. like, it's not a mystery, we know why, we're just not gonna pretend it's fine.

see below and hints/qnx.sh for more info, bestie, it's all in there.

and under QNX 6.2.0 there are still a few tests which fail. again: see below and hints/qnx.sh for more information. the lore is documented πŸ’…

🌸 Required Software for Compiling Perl on QNX4 🌸

ngl, like so many unix ports, this one leans on a few "standard" unix utilities which are not necessarily standard for QNX4. so you gotta round them up first:

  • /bin/sh β€” this gets used heavily by Configure and then by perl itself. QNX4's version is fine, BUT Configure will choke on the 16-bit version. so if you are running QNX 4.22, link /bin/sh to /bin32/ksh. do it, don't be messy πŸ™ˆ
  • ar β€” this is the standard unix library builder. we use wlib. with Watcom 10.6, when wlib is linked as "ar", it behaves like ar and all is fine. under 9.5, a cover is required. one is included in ../qnx.
  • nm β€” this is used (optionally) by configure to list the contents of libraries. I will generate a cover function on the fly in the UU directory.
  • cpp β€” Configure and perl need a way to invoke a C preprocessor. I have created a simple cover for cc which does the right thing. without this, Configure will create its own wrapper which works, but it doesn't handle some of the command line arguments that perl will throw at it.
  • make β€” you really need GNU make to compile this. GNU make ships by default with QNX 4.23, but you can get it from quics for earlier versions. no cap, get the real make πŸ‘‘

πŸ’€ Outstanding Issues with Perl on QNX4 πŸ’€

there is no support for dynamically linked libraries in QNX4. that's just the vibe, periodt.

if you wish to compile with the Socket extension, you need to have the TCP/IP toolkit, and you need to make sure that -lsocket locates the correct copy of socket3r.lib. beware that the Watcom compiler ships with a stub version of socket3r.lib which has very little functionality. also beware the order in which wlink searches directories for libraries. you may have /usr/lib/socket3r.lib pointing to the correct library, but wlink may pick up /usr/watcom/10.6/usr/lib/socket3r.lib instead. 😭 make sure they both point to the correct library, that is, /usr/tcptk/current/usr/lib/socket3r.lib.

⚠️ for real, double-check that path. the wrong socket3r.lib is a trap and it will lowkey ruin your day.

the following tests may report errors under QNX4:

  • dist/Cwd/Cwd.t will complain if pwd and cwd don't give the same results. cwd calls fullpath -t, so if you cd fullpath -t before running the test, it will pass. easy fix, we love a workaround ✨
  • lib/File/Find/taint.t will complain if '.' is in your PATH. the PATH test is triggered because cwd calls fullpath -t.
  • ext/IO/lib/IO/t/io_sock.t: Subtests 14 and 22 are skipped due to the fact that the functionality to read back the non-blocking status of a socket is not implemented in QNX's TCP/IP. this has been reported to QNX and it may work with later versions of TCP/IP. fingers crossed bestie 🫢
  • t/io/tell.t: Subtest 27 is failing. We are still investigating. πŸ‘€ the mystery continues

πŸŽ€ QNX auxiliary files πŸŽ€

the files in the "qnx" directory are:

  • qnx/ar β€” a script that emulates the standard unix archive (aka library) utility. under Watcom 10.6, ar is linked to wlib and provides the expected interface. with Watcom 9.5, a cover function is required. this one is fairly crude but has proved adequate for compiling perl. she's not fancy but she WORKS πŸ’…
  • qnx/cpp β€” a script that provides C preprocessing functionality. Configure can generate a similar cover, but it doesn't handle all the command-line options that perl throws at it. this might be reasonably placed in /usr/local/bin.

😭 Outstanding issues with perl under QNX6 😭

the following tests are still failing for Perl 5.8.1 under QNX 6.2.0:

  op/sprintf.........................FAILED at test 91
  lib/Benchmark......................FAILED at test 26

this is due to a bug in the C library's printf routine. printf("'%e'", 0. ) produces '0.000000e+0', but ANSI requires '0.000000e+00'. QNX has acknowledged the bug. so like β€” not our fault, we're just out here living with it πŸ’€

🌈 Cross-compilation 🌈

Perl supports cross-compiling to QNX NTO through the Native Development Kit (NDK) for the Blackberry 10. this means that you can cross-compile for both ARM and x86 versions of the platform. versatile queen πŸ‘‘

Setting up a cross-compilation environment

you can download the NDK from <http://developer.blackberry.com/native/downloads/>.

see <http://developer.blackberry.com/native/documentation/cascades/getting_started/setting_up.html> for instructions to set up your device prior to attempting anything else. do this FIRST, bestie, don't skip steps πŸ™ˆ

once you've installed the NDK and set up your device, all that's left to do is setting up the device and the cross-compilation environment. Blackberry provides a script, "bbndk-env.sh" (occasionally named something like "bbndk-env_10_1_0_4828.sh") which can be used to do this. however, there's a bit of a snag that we have to work through: the script modifies PATH so that gcc or ar point to their cross-compilation equivalents, which screws over the build process. 😀 rude honestly.

so instead you'll want to do something like this:

    $ orig_path=$PATH
    $ source $location_of_bbndk/bbndk-env*.sh
    $ export PATH="$orig_path:$PATH"

besides putting the cross-compiler and the rest of the toolchain in your PATH, this will also provide the QNX_TARGET variable, which we will pass to Configure through -Dsysroot.

Preparing the target system

it's quite possible that the target system doesn't have a readily available /tmp, so it's generally safer to do something like this:

 $ ssh $TARGETUSER@$TARGETHOST 'rm -rf perl; mkdir perl; mkdir perl/tmp'
 $ export TARGETDIR=`ssh $TARGETUSER@$TARGETHOST pwd`/perl
 $ export TARGETENV="export TMPDIR=$TARGETDIR/tmp; "

later on, we'll pass this to Configure through -Dtargetenv. keep it noted πŸ“

Calling Configure

if you are targetting an ARM device β€” which currently includes the vast majority of phones and tablets β€” you'll want to pass -Dcc=arm-unknown-nto-qnx8.0.0eabi-gcc to Configure. alternatively, if you are targetting an x86 device, or using the simulator provided with the NDK, you should specify -Dcc=ntox86-gcc instead.

a sample Configure invocation looks something like this:

    ./Configure -des -Dusecrosscompile \
        -Dsysroot=$QNX_TARGET          \
        -Dtargetdir=$TARGETDIR         \
        -Dtargetenv="$TARGETENV"       \
        -Dcc=ntox86-gcc                \
        -Dtarghost=... # Usual cross-compilation options

πŸ‘‘ AUTHOR πŸ‘‘

Norton T. Allen (allen@huarp.harvard.edu) β€” thank you for your service, king 🫑✨


and that's the whole page bestie!! this one's from perl v5.42.3, dated 2026-08-03, and it's a PERLQNX(1) moment. go compile something, slay, and remember: check your socket3r.lib paths before you cry πŸ’–πŸ¦‹πŸ’…

πŸ“¦ where this page comes from