sysutils/fluxengine apparently needs to use an appropriate -Wl,-rpath=/usr/local/lib/gcc*

From: Mark Millard <>
Date: Fri, 08 Apr 2022 00:46:36 UTC
[This was discovered while looking into another issue not
known at the time to be associated with fluxengine.]

sysutils/fluxengine on the FreeBSD ports bulk-build servers for
targetting aarch64 currently uses gcc10 to satisfy:

USES=           compiler:gcc-c++11-lib . . .

but it fails to build via: /lib/ version GCC_4.5.0 required by . . .

errors. Basically, the wrong is in use.

It turns out a form of this happens even for building fairly trivial
code with gcc10 or gcc11 (or . . .? Unknown range) when the matching:


is not supplied. (I happen to have gcc11 installed, thus some
details of the below example.)

# g++11 locale_failure_test.cpp
# ./a.out /lib/ version GCC_4.5.0 required by /usr/local/lib/gcc11/ not found
# ldd a.out
a.out: => /usr/local/lib/gcc11/ (0x82400000) => /lib/ (0x81411000) => /lib/ (0x82b01000) => /lib/ (0x8376e000)

compared to:

# g++11 -Wl,-rpath=/usr/local/lib/gcc11 locale_failure_test.cpp
# ./a.out
# ldd a.out
a.out: => /usr/local/lib/gcc11/ (0x83400000) => /lib/ (0x81a6f000) => /usr/local/lib/gcc11/ (0x8265c000) => /lib/ (0x83fbe000)

where the source code compiled is:

#include <iostream>
#include <locale>

int main()
        try {
                std::locale l = std::locale("en_US.UTF-8");
        catch(std::exception const &e) {
                std::cerr << e.what() << std::endl;
        catch(...) {
                std::cerr << "Unknown exception " << std::endl;

There may be other ports with the issue.

Mark Millard
marklmi at