[kde-freebsd] [Bug 206348] x11-toolkits/qt5-gui : clang++ used with -mcpu=cortex-a7 -mfloat-abi=softfp results in: undefined reference to `qt_convert_rgb888_to_rgb32_neon( . . . )

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jan 17 22:44:50 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206348

            Bug ID: 206348
           Summary: x11-toolkits/qt5-gui : clang++ used with
                    -mcpu=cortex-a7 -mfloat-abi=softfp results in:
                    undefined reference to
                    `qt_convert_rgb888_to_rgb32_neon( . . . )
           Product: Ports & Packages
           Version: Latest
          Hardware: arm
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: kde at FreeBSD.org
          Reporter: markmi at dsl-only.net
          Assignee: kde at FreeBSD.org
             Flags: maintainer-feedback?(kde at FreeBSD.org)

For clang++ used with

-target armv6--freebsd11.0-gnueabi -march=armv7-a -mcpu=cortex-a7
-mfloat-abi=softfp

the eventual result of "portmaster -DK x11-toolkits/qt5-gui" is:

undefined reference to `qt_convert_rgb888_to_rgb32_neon(unsigned int*, unsigned
char const*, int)'

Details follow. First the message generated during the attempted portmaster -DK
:

--- ../../../../plugins/imageformats/libqjpeg.so ---
rm -f libqjpeg.so
/usr/bin/clang++ -target armv6--freebsd11.0-gnueabi -march=armv7-a
-mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access -Wl,--no-undefined
-pthread -shared -o libqjpeg.so .obj/qjpeghandler.o  .obj/main.o 
.obj/moc_main.o 
-L/usr/obj/portswork/usr/ports/x11-toolkits/qt5-gui/work/qtbase-opensource-src-5.4.1/lib
-L/usr/local/lib -ljpeg -lQt5Gui -lQt5Core -lGL 
.obj/qjpeghandler.o: In function `QJpegHandler::QJpegHandler()':
/usr/obj/portswork/usr/ports/x11-toolkits/qt5-gui/work/qtbase-opensource-src-5.4.1/src/plugins/imageformats/jpeg/../../../gui/image/qjpeghandler.cpp:1024:
undefined reference to `qt_convert_rgb888_to_rgb32_neon(unsigned int*, unsigned
char const*, int)'
clang++: error: linker command failed with exit code 1 (use -v to see
invocation)
*** [../../../../plugins/imageformats/libqjpeg.so] Error code 1

make[2]: stopped in
/usr/obj/portswork/usr/ports/x11-toolkits/qt5-gui/work/qtbase-opensource-src-5.4.1/src/plugins/imageformats/jpeg
1 error
. . .

That reference to the routine is compiled in because. . .

/usr/obj/portswork/usr/ports/x11-toolkits/qt5-gui/work/qtbase-opensource-src-5.4.1/src/plugins/imageformats/jpeg/../../../gui/image/qjpeghandler.cpp
has:

Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst,
const uchar *src, int len);
. . .
QJpegHandler::QJpegHandler()
    : d(new QJpegHandlerPrivate(this))
{
#if defined(__ARM_NEON__) && !defined(Q_PROCESSOR_ARM_64)
    // from qimage_neon.cpp

    if (qCpuHasFeature(NEON))
        rgb888ToRgb32ConverterPtr = qt_convert_rgb888_to_rgb32_neon;
#endif
. . .

and. . .

/usr/obj/portswork/usr/ports/x11-toolkits/qt5-gui/work/qtbase-opensource-src-5.4.1/src/corelib/tools/qsimd_p.h
has:

static const uint qCompilerCpuFeatures = 0
. . .
#if defined __ARM_NEON__
        | NEON
#endif
. . .
#define qCpuHasFeature(feature)  ((qCompilerCpuFeatures & (feature)) ||
(qCpuFeatures() & (feature)))

So qCpuHasFeature(NEON) also is doing auto-detection of NEON.

(The above is not the necessarily the only code to do such automatic
detections.)

But the infrastructure that decides if it is going to compile the file that
defines qt_covert_rgb888_to_rgb32_neon does not do automatic detection. In fact
no command line option can enable such compilation: a file such as
qtbase-opensource-src-5.4.1/configure has to be edited.

In other words:
/usr/obj/portswork/usr/ports/x11-toolkits/qt5-gui/work/qtbase-opensource-src-5.4.1/configure
has no way to add neon to QMAKE_CONFIG as things are: See below for the
properties that CFG_CPUFEATURES is never modified after being initialized. Nor
is CFG_NEON. So the only 'QMAKE_CONFIG="$QMAKE_CONFIG neon"' never happens as
is.

QMAKE_CONFIG=
. . .
CFG_CPUFEATURES=

. . .
CFG_NEON=auto
. . .
# check Neon support
if [ "$CFG_NEON" = "auto" ]; then
    # no compile test, just check what the compiler has
    case "$CFG_CPUFEATURES" in
        *neon*)
            CFG_NEON=yes
            ;;
        *)
            CFG_NEON=no
            ;;
    esac
fi
. . .
[ "$CFG_NEON" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG neon"
. . .
elif [ "$CFG_ARCH" = "arm" ]; then
    echo "    Neon ................. ${CFG_NEON}"

There is even this note from 5.3.0:

/usr/obj/portswork/usr/ports/x11-toolkits/qt5-gui/work/qtbase-opensource-src-5.4.1/dist/changes-5.3.0,
says:

   * [QTBUG-30440] Qt no longer checks for support for the Neon FPU on
     ARM platforms at runtime. Code optimized for Neon must be enabled
     unconditionally at compile time by ensuring the compiler supports
     Neon.  You may need to edit your mkspec for that.

Note the "edit your mkspec" part of that wording.

I'll report that

-target armv6--freebsd11.0-gnueabi -march=armv7-a -mcpu=cortex-a7
-mfloat-abi=softfp

is appropriate to a rpi2 (as one example). It is not an arbitrary combination.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the kde-freebsd mailing list