Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jan 2016 22:44:50 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [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( . . . )
Message-ID:  <bug-206348-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206348

            Bug ID: 206348
           Summary: x11-toolkits/qt5-gui : clang++ used with
                    -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp 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@FreeBSD.org
          Reporter: markmi@dsl-only.net
          Assignee: kde@FreeBSD.org
             Flags: maintainer-feedback?(kde@FreeBSD.org)

For clang++ used with

-target armv6--freebsd11.0-gnueabi -march=3Darmv7-a -mcpu=3Dcortex-a7
-mfloat-abi=3Dsoftfp

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

undefined reference to `qt_convert_rgb888_to_rgb32_neon(unsigned int*, unsi=
gned
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=3Darmv7-a
-mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp -mno-unaligned-access -Wl,--no-undef=
ined
-pthread -shared -o libqjpeg.so .obj/qjpeghandler.o  .obj/main.o=20
.obj/moc_main.o=20
-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=20
.obj/qjpeghandler.o: In function `QJpegHandler::QJpegHandler()':
/usr/obj/portswork/usr/ports/x11-toolkits/qt5-gui/work/qtbase-opensource-sr=
c-5.4.1/src/plugins/imageformats/jpeg/../../../gui/image/qjpeghandler.cpp:1=
024:
undefined reference to `qt_convert_rgb888_to_rgb32_neon(unsigned int*, unsi=
gned
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-sr=
c-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-sr=
c-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 =3D qt_convert_rgb888_to_rgb32_neon;
#endif
. . .

and. . .

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

static const uint qCompilerCpuFeatures =3D 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-sr=
c-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=3D"$QMAKE_CONFIG neon"' never happen=
s as
is.

QMAKE_CONFIG=3D
. . .
CFG_CPUFEATURES=3D

. . .
CFG_NEON=3Dauto
. . .
# check Neon support
if [ "$CFG_NEON" =3D "auto" ]; then
    # no compile test, just check what the compiler has
    case "$CFG_CPUFEATURES" in
        *neon*)
            CFG_NEON=3Dyes
            ;;
        *)
            CFG_NEON=3Dno
            ;;
    esac
fi
. . .
[ "$CFG_NEON" =3D "yes" ] && QMAKE_CONFIG=3D"$QMAKE_CONFIG neon"
. . .
elif [ "$CFG_ARCH" =3D "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-sr=
c-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=3Darmv7-a -mcpu=3Dcortex-a7
-mfloat-abi=3Dsoftfp

is appropriate to a rpi2 (as one example). It is not an arbitrary combinati=
on.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-206348-13>