Bug 207099 - lang/qt5-qml: for armv7 (rpi2), error: "The cacheFlush support is missing on this platform." (stops the build)
Summary: lang/qt5-qml: for armv7 (rpi2), error: "The cacheFlush support is missing on ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-11 03:38 UTC by Mark Millard
Modified: 2017-12-19 01:55 UTC (History)
5 users (show)

See Also:
rakuco: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Millard 2016-02-11 03:38:04 UTC
[Context basics: projects/clang380-import -r295351 for buildworld/buildkernel that targeted an rpi2 (armv7-a/cortex-a7). This context requires strict alignment: FreeBSD 11.0-CURRENT has SCTLR bit[1]==1 for such contexts.]

When I attempt portinstall/portmaster builds for lang/qt5-qml I get the following.

. . .
--- .obj/qv4isel_masm.o ---
In file included from jit/qv4isel_masm.cpp:34:
In file included from jit/qv4isel_masm_p.h:48:
In file included from jit/qv4assembler_p.h:42:
In file included from jit/qv4targetplatform_p.h:42:
In file included from ../3rdparty/masm/assembler/MacroAssembler.h:34:
In file included from ../3rdparty/masm/assembler/MacroAssemblerARMv7.h:32:
../3rdparty/masm/assembler/ARMv7Assembler.h:2315:2: error: "The cacheFlush support is missing on this platform."
#error "The cacheFlush support is missing on this platform."
 ^
../3rdparty/masm/assembler/ARMv7Assembler.h:2284:34: warning: unused parameter 'code' [-Wunused-parameter]
    static void cacheFlush(void* code, size_t size)
                                 ^
../3rdparty/masm/assembler/ARMv7Assembler.h:2284:47: warning: unused parameter 'size' [-Wunused-parameter]
    static void cacheFlush(void* code, size_t size)
                                              ^
--- .obj/qv4assembler.o ---
2 warnings and 1 error generated.
*** [.obj/qv4assembler.o] Error code 1
. . .

which stops the overall build.

Stop reading the description here if you do not care about supporting details at this point.

Other context details:

# svnlite info /usr/ports/lang/qt5-qml
Path: lang/qt5-qml
Working Copy Root Path: /usr/ports
URL: https://svn0.us-west.freebsd.org/ports/head/lang/qt5-qml
Relative URL: ^/head/lang/qt5-qml
Repository Root: https://svn0.us-west.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 408464
Node Kind: directory
Schedule: normal
Last Changed Author: rakuco
Last Changed Rev: 407169
Last Changed Date: 2016-01-24 18:10:14 +0000 (Sun, 24 Jan 2016)

# freebsd-version -ku; uname -aKU
11.0-CURRENT
11.0-CURRENT
FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CURRENT #14 r295351M: Sun Feb  7 03:23:24 PST 2016     markmi@FreeBSDx64:/usr/obj/clang/arm.armv6/usr/src/sys/RPI2-NODBG  arm 1100097 1100097

# more /etc/make.conf 
DEFAULT_VERSIONS+=perl5=5.22
WRKDIRPREFIX=/usr/obj/portswork
WITH_DEBUG=
WITH_DEBUG_FILES=
MALLOC_PRODUCTION=
#
TO_TYPE=armv6
VERSION_CONTEXT=11.0
CFLAGS+=-target ${TO_TYPE}--freebsd${VERSION_CONTEXT}-gnueabi -march=armv7-a -mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access
.if ${.MAKE.LEVEL} == 0
CC=/usr/bin/clang
CXX=/usr/bin/clang++
CPP=/usr/bin/clang-cpp
.export CC
.export CXX
.export CPP
.endif

(In case it is not clear: This is a clang 3.8.0 usage/testing context.)
Comment 1 w.schwarzenfeld 2016-02-11 04:30:10 UTC
Similar error happend here:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197483
(patch https://bz-attachments.freebsd.org/attachment.cgi?id=153286)

=>
usr/ports/lang/qt5-qml/work/qtdeclarative-opensource-src-5.5.1//src//3rdparty/masm/assembler/ARMv7Assembler.h:
I think
+#elif CPU(ARM_TRADITIONAL) && OS(FREEBSD) && COMPILER(CLANG)
+	__clear_cache(code, reinterpret_cast<char*>(code) + size);

should inserted here:
2305 #elif OS(WINCE)
   2306         CacheRangeFlush(code, size, CACHE_SYNC_ALL);
   2307 #elif OS(QNX)
   2308 #if !ENABLE(ASSEMBLER_WX_EXCLUSIVE)
   2309         msync(code, size, MS_INVALIDATE_ICACHE);
Comment 2 Mark Millard 2016-02-11 05:04:47 UTC
(In reply to w.schwarzenfeld from comment #1)

I tried this just to provide a cross check but I still got the same error. The text from the updated file that I used looks like:

. . .
        linuxPageFlush(current, end);
#elif OS(WINCE)
        CacheRangeFlush(code, size, CACHE_SYNC_ALL);
#elif CPU(ARM_TRADITIONAL) && OS(FREEBSD) && COMPILER(CLANG)
        __clear_cache(code, reinterpret_cast<char*>(code) + size);
#elif OS(QNX)
#if !ENABLE(ASSEMBLER_WX_EXCLUSIVE)
        msync(code, size, MS_INVALIDATE_ICACHE);
#else
        UNUSED_PARAM(code);
        UNUSED_PARAM(size);
#endif
#else
#error "The cacheFlush support is missing on this platform."
#endif


May be -march=armv7-a -mcpu=cortex-a7 is not "traditional" for arm?
Comment 3 w.schwarzenfeld 2016-02-11 05:16:02 UTC
I think this it is. But I don't know the correct notation.
Comment 4 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-02-11 10:25:05 UTC
CC'ing some ARM folks, as I have no idea about ARM code and how to best fix this.
Comment 5 Mikael Urankar freebsd_committer freebsd_triage 2017-02-05 11:29:11 UTC
bug #207099 contains a patch for armv7
Comment 6 Mikael Urankar freebsd_committer freebsd_triage 2017-06-06 08:42:16 UTC
crap I linked the wrong pr :( the good one is bug #216735
the issue should be fixed with ports r442470
Comment 7 Mark Millard 2017-09-25 08:48:09 UTC
FYI: there is the same error for www/qt5-webkit (even
with the patches from bugzilla 215974 and 216816 in
order to get this far):

The cacheFlush support is missing on this platform.

The specific lines from the www/qt5-webkit log file
for the build attempt are:

In file included from /wrkdirs/usr/ports/www/qt5-webkit/work/qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:28:
In file included from /wrkdirs/usr/ports/www/qt5-webkit/work/qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/bytecode/ArrayProfile.h:30:
In file included from /wrkdirs/usr/ports/www/qt5-webkit/work/qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/runtime/JSArray.h:25:
In file included from /wrkdirs/usr/ports/www/qt5-webkit/work/qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/runtime/ButterflyInlines.h:31:
In file included from /wrkdirs/usr/ports/www/qt5-webkit/work/qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/heap/CopiedSpaceInlines.h:32:
In file included from /wrkdirs/usr/ports/www/qt5-webkit/work/qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/runtime/VM.h:32:
In file included from /wrkdirs/usr/ports/www/qt5-webkit/work/qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/runtime/ControlFlowProfiler.h:30:
In file included from /wrkdirs/usr/ports/www/qt5-webkit/work/qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/runtime/BasicBlockLocation.h:30:
In file included from /wrkdirs/usr/ports/www/qt5-webkit/work/qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/assembler/MacroAssembler.h:40:
In file included from /wrkdirs/usr/ports/www/qt5-webkit/work/qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/assembler/MacroAssemblerARM.h:33:
/wrkdirs/usr/ports/www/qt5-webkit/work/qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/assembler/ARMAssembler.h:1132:2: error: "The cacheFlush support is missing on this platform."
#error "The cacheFlush support is missing on this platform."
 ^
1 error generated.
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/www/qt5-webkit
=>> Cleaning up wrkdir
===>  Cleaning for qt5-webkit-5.212.0.a2_1
build of www/qt5-webkit | qt5-webkit-5.212.0.a2_1 ended at Mon Sep 25 01:26:16 PDT 2017
build time: 00:05:12
!!! build failure encountered !!!

This was with /usr/ports -r450478 (patched=) under head -r323676 .
Comment 8 Michal Meloun freebsd_committer freebsd_triage 2017-11-06 06:05:43 UTC
lang/qt5-qml on armv[67] has been fixed in r442470.