fuzzix dot org

Slackware64-current, multilib, and perlbrew

29 Jul 2026

Slackware64-current is multilib capable by default. System native libraries are in, e.g. /usr/lib64, with 32-bit alternatives in, e.g. /usr/lib.

I encountered an issue where DynaLoader was locating 32-bit libraries instead of 64-bit ones - many XS/FFI type dists failing to build. DynaLoader's set of library paths was prioritising the 32-bit lib directories:

$ reply
0> use DynaLoader
1> @DynaLoader::dl_library_path
$res[0] = [
    [0] "/usr/local/lib",
    [1] "/usr/lib",
    [2] "/lib64",
    [3] "/usr/lib64",
    [4] "/lib",
    [5] "/usr/local/lib64",
]

This array is sourced from, among other places, a Config variable named libpth, which looks like this in my perlbrewed perl:

2> use Config
3> $Config{libpth}
$res[1] = "/usr/local/lib /usr/lib /lib64 /usr/lib64 /lib /usr/local/lib64"

The system perl does not exhibit this behaviour:

$ /usr/bin/perl -MConfig -E'say $Config{libpth}'
/usr/local/lib64 /usr/lib64 /lib64 /usr/local/lib /usr/lib /lib

Checking out the build script for Slackware's system perl, we can see that libpth is explicitly set at the Configure stage:

-Dlibpth="/usr/local/lib${LIBDIRSUFFIX} /usr/lib${LIBDIRSUFFIX} /lib${LIBDIRSUFFIX}"

$LIBDIRSUFFIX will be "64" on x86_64 systems, blank otherwise.

So, we can just add this to the perlbrew invocation. Thankfully we don't need to remember to do this every time, as gugod provides. The PERLBREW_CONFIGURE_FLAGS environment variable contains options which will be passed on to Configure for each build, so I have set it like so:

export PERLBREW_CONFIGURE_FLAGS="-Dlibpth='/usr/local/lib64 /usr/lib64 /lib64' \
-de $PERLBREW_CONFIGURE_FLAGS"

As we are overriding default Configure options, we need to restore -de to configure builds non-interactively.

...and perlbrewed perls now behave appropriately:

$ perl -MConfig -E'say $Config{libpth}'
/usr/local/lib64 /usr/lib64 /lib64 /usr/local/lib /usr/lib /lib
$ perl -MDynaLoader -E'say join " ", @DynaLoader::dl_library_path'
/usr/local/lib64 /usr/lib64 /lib64 /usr/local/lib /usr/lib /lib