Bug 216816 - [PATCH] devel/qt5: In arch.test, use CXXFLAGS from make environment
Summary: [PATCH] devel/qt5: In arch.test, use CXXFLAGS from make environment
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (Team)
URL:
Keywords: patch
: 206348 217278 (view as bug list)
Depends on: 215974 qt5-rearm-webkit
Blocks: 222612
  Show dependency treegraph
 
Reported: 2017-02-05 10:15 UTC by Michal Meloun
Modified: 2017-11-03 18:11 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (kde)


Attachments
arch.test patch (250 bytes, patch)
2017-02-05 10:15 UTC, Michal Meloun
no flags Details | Diff
Plug new extra patch to make infrastructure. (769 bytes, patch)
2017-02-05 10:16 UTC, Michal Meloun
no flags Details | Diff
patch (1.71 KB, patch)
2017-09-25 07:09 UTC, Mikael Urankar
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Meloun freebsd_committer 2017-02-05 10:15:01 UTC
Created attachment 179632 [details]
arch.test patch

For many architectures (armv6, aarch64), is -mcpu is essential for proper detection of  CPU features. Follow compile.test case and reuse CXXFLAGS from make environment also in arch.test.
Comment 1 Michal Meloun freebsd_committer 2017-02-05 10:16:06 UTC
Created attachment 179633 [details]
Plug new extra patch to make infrastructure.
Comment 2 Mikael Urankar freebsd_committer 2017-02-28 08:21:09 UTC
*** Bug 217278 has been marked as a duplicate of this bug. ***
Comment 3 Mikael Urankar freebsd_committer 2017-06-03 12:15:21 UTC
Can we have a review of this patch please?
Thanks in advance.
Comment 4 Tobias C. Berner freebsd_committer 2017-06-03 12:44:54 UTC
Do you know how Linux distributions solved this issue?
Comment 5 Michal Meloun freebsd_committer 2017-06-04 08:48:11 UTC
Linux didn't notice this problem, I think.
For ARM, Linux have separate distros for specific cpu architecture (armv6, armv7) and its base compiler is configured with right defaults. 

Due to this, arch.test select least common denominator of features for given CPU architecture -  so it produces valid result.

Michal
Comment 6 Michal Meloun freebsd_committer 2017-09-06 05:02:21 UTC
*** Bug 206348 has been marked as a duplicate of this bug. ***
Comment 7 Mark Millard 2017-09-06 07:00:09 UTC
Time warp: 206348 < 216816 but 206348 is the closed
duplicate of the later 216816. :)

I will note here a little of what I reported earlier
today in 206348's comment 11:

An experiment with building based on
/usr/ports being from -r449313 shows that the
problem of undefined references still exists.
This test was via head (so 12) -r323147 .

I'll not list the full undefined reference
messages I included there.

qt_memfill32
convert_RGB888_to_RGB32_neon
qt_destFetchRGB16_neon
qt_blend_rgb32_on_rgb32_neon
comp_func_solid_SourceOver_neon

and more are listed as undefined. Most names
mention neon explicitly, I expect all but
qt_memfill32 mention neon.
Comment 8 Michal Meloun freebsd_committer 2017-09-06 08:31:47 UTC
This patch affects many (if not all) of qt5 ports, so you must rebuild  all of them. 
In any case, I can build qt5-gui without problem:
http://build.humusoft.cz/data/head12armv7-default/2017-03-11_19h10m04s/logs/qt5-gui-5.7.1.log
Comment 9 Tobias C. Berner freebsd_committer 2017-09-06 10:01:54 UTC
Sorry for the delay... 

So will the above patches make everything work fine on armv6/aarch64?
Comment 10 Mark Millard 2017-09-06 19:52:20 UTC
(In reply to Tobias C. Berner from comment #9)

[Note: My activity has only been doing some test builds,
not installing and using what is built. I've not been
one testing the patch but just normal builds.]

arm64.aarch64 has been building qt5-gui just fine,
including qt5-gui-5.7.1_1 . No patch required.
This is with (my typical context so far for
arm64.aarch64 ):

CFLAGS+= -mcpu=cortex-a53
CXXFLAGS+= -mcpu=cortex-a53
CPPFLAGS+= -mcpu=cortex-a53


arm.armv6 has not been building qt5-gui for a
long time (no patch applied). Bugzilla 206348
goes back to 2016-Jan-17 for its submittal.
This is with (my typical context for arm.armv6 ):

CFLAGS+= -mcpu=cortex-a7
CXXFLAGS+= -mcpu=cortex-a7
CPPFLAGS+= -mcpu=cortex-a7

(Nothing depending on qt5-gui has had a
build start in my activity for this
context.)


adm64.adm64 has been building qt5-gui just fine.
(No explicit -mcpu assignments.)


(It has been years since I've tried on/for
powerpc.powerpc or powerpc.powerpc64 . I've
never tried any other architectures.)


The only context that I know of failing to
build without the patch is tied to arm.armv6 .
Comment #8 reports that this context builds
qt50-ui with the patch just fine.

I do not know if the likes of amd64.amd64 or
arm64.aarch64 or any others have been tested
with the patch to see if they still build.
Comment 11 Mark Millard 2017-09-06 20:12:45 UTC
(In reply to Michal Meloun from comment #8)

Note: without the patch what I tried to
build indirectly did build the following
qt5-* items before failing to build qt5-gui
for -mcpu=cortex-a7 :

zrFBSDx64CjailArmV7-default/All/qt5-linguisttools-5.7.1.txz
zrFBSDx64CjailArmV7-default/All/qt5-qml-5.7.1_1.txz
zrFBSDx64CjailArmV7-default/All/qt5-xmlpatterns-5.7.1.txz
zrFBSDx64CjailArmV7-default/All/qt5-network-5.7.1_1.txz
zrFBSDx64CjailArmV7-default/All/qt5-dbus-5.7.1.txz
zrFBSDx64CjailArmV7-default/All/qt5-sqldrivers-sqlite3-5.7.1.txz
zrFBSDx64CjailArmV7-default/All/qt5-testlib-5.7.1.txz
zrFBSDx64CjailArmV7-default/All/qt5-sql-5.7.1.txz
zrFBSDx64CjailArmV7-default/All/qt5-xml-5.7.1.txz
zrFBSDx64CjailArmV7-default/All/qt5-concurrent-5.7.1.txz
zrFBSDx64CjailArmV7-default/All/qt5-core-5.7.1_2.txz
zrFBSDx64CjailArmV7-default/All/qt5-buildtools-5.7.1.txz
zrFBSDx64CjailArmV7-default/All/qt5-qmake-5.7.1_4.txz

So some qt5 ports do build for that
context.

Some of them might be appropriate to
rebuild once the patch is present. I'd
likely rebuild everything (via my usual
criteria).
Comment 12 Mark Millard 2017-09-06 20:29:29 UTC
(In reply to Mark Millard from comment #10)

FYI: My context was explicitly trying to build
lumina and xscreensaver.

xscreensaver and what it depends on
built for all 3 architectures tried:

arm.armv6 (with -mcpu=cortex-a7 )
arm64.aarch64 (with -mcpu=cortex-a53 )
amd64.amd64 (no -mcpu )

lumina and what it depends on built for
2 architectures of the 3:

arm64.aarch64 (with -mcpu=cortex-a53 )
amd64.amd64 (no -mcpu )

but was prevented from finishing by
qt5-gui failing for:

arm.armv6 (with -mcpu=cortex-a7 )

It left about 11 other ports in the
"skipped" status.
Comment 13 Mark Millard 2017-09-25 00:23:53 UTC
As of /usr/ports -r450478 things are still not
updated.

I'll note that the 2 patches seem mismatched
or something seems to be missing:

arch.test patch indicates:

--- config.tests/unix/arch.test.orig	2017-02-05 07:43:57 UTC
+++ config.tests/unix/arch.test

but the other one indicates:

-					${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_features_qt__module.prf
+					${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_features_qt__module.prf \
+					${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-config.tests_unix_arch.test


So far I've not found a file named:

extrapatch-config.tests_unix_arch.test

or anything that would create one, at least
in https://svnweb.freebsd.org/ports/head/devel/qt5/files/ 
or other places that I looked.

May be the patches are only intended to be suggestive of
what needs to be done in various qt5* ports or something.
Comment 14 Mikael Urankar freebsd_committer 2017-09-25 07:09:57 UTC
Created attachment 186692 [details]
patch

(In reply to Mark Millard from comment #13)
Try with the attached patch, cd /usr/ports ; svn patch /path/qt5.patch
Comment 15 Mark Millard 2017-09-25 07:48:25 UTC
(In reply to mikael.urankar from comment #14)

x11-toolkits/qt5-gui built fine after your
patch was applied.
Comment 16 Mark Millard 2017-09-25 08:40:37 UTC
(In reply to mikael.urankar from comment #14)

FYI: there is a www/qt5-webkit error even with the patch:

The cacheFlush support is missing on this platform.

[bugzilla 207099 was a report of this sort of message
for lang/qt5-qml . 216735 was as well but was closed
as fixed for lang/qt5-qml.]

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 !!!


Note: To get this far a patch for a patch from
bugzilla 215974 for audio/liba52 was also needed.
Comment 17 Mikael Urankar freebsd_committer 2017-09-25 08:45:32 UTC
The kde team has dropped some patches needed for armv6:
https://svnweb.freebsd.org/ports?view=revision&revision=448361

You can try to restore these files:
patch-Source_JavaScriptCore_assembler_ARMAssembler.h
patch-Source_WTF_wtf_Platform.h
patch-Source_WebCore_platform_graphics_cpu_arm_filters_FELightingNEON.cpp
Comment 18 Mark Millard 2017-09-25 09:01:21 UTC
(In reply to mikael.urankar from comment #17)

Summary: patch patch-Source_JavaScriptCore_assembler_ARMAssembler.h failed to apply cleanly.


I tried:

# svnlite update -r440357 /usr/ports/www/qt5-webkit/files/patch-Source_JavaScriptCore_assembler_ARMAssembler.h
Updating 'www/qt5-webkit/files/patch-Source_JavaScriptCore_assembler_ARMAssembler.h':
A    www/qt5-webkit/files/patch-Source_JavaScriptCore_assembler_ARMAssembler.h
Updated to revision 440357.

# svnlite update -r440357 /usr/ports/www/qt5-webkit/files/patch-Source_WTF_wtf_Platform.h
Updating 'www/qt5-webkit/files/patch-Source_WTF_wtf_Platform.h':
A    www/qt5-webkit/files/patch-Source_WTF_wtf_Platform.h
Updated to revision 440357.

# svnlite update -r440357 /usr/ports/www/qt5-webkit/files/patch-Source_WebCore_platform_graphics_cpu_arm_filters_FELightingNEON.cpp
Updating 'www/qt5-webkit/files/patch-Source_WebCore_platform_graphics_cpu_arm_filters_FELightingNEON.cpp':
A    www/qt5-webkit/files/patch-Source_WebCore_platform_graphics_cpu_arm_filters_FELightingNEON.cpp
Updated to revision 440357.


But the result was:

===>  Applying FreeBSD patches for qt5-webkit-5.212.0.a2_1
1 out of 1 hunks failed--saving rejects to Source/JavaScriptCore/assembler/ARMAssembler.h.rej
=> FreeBSD patch patch-Source_JavaScriptCore_assembler_ARMAssembler.h failed to apply cleanly.
*** 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:58:08 PDT 2017
build time: 00:00:21
!!! build failure encountered !!!
Comment 19 Mikael Urankar freebsd_committer 2017-09-25 09:12:51 UTC
Try this patch (from mmel@)
http://build.humusoft.cz/patches/www/qt5-webkit/qt5-webkit.diff
Comment 20 Tobias C. Berner freebsd_committer 2017-09-25 09:14:39 UTC
Oh nice -- we'll try to get that in soon too :)
Comment 21 Tobias C. Berner freebsd_committer 2017-09-25 09:15:35 UTC
(In reply to mikael.urankar from comment #19)
Ps. Could you open a fresh pr for the qt5-webkit one?
Comment 22 Mark Millard 2017-09-25 10:07:30 UTC
(In reply to mikael.urankar from comment #19)

FYI: with the other patches as well, applying:

http://build.humusoft.cz/patches/www/qt5-webkit/qt5-webkit.diff

allowed www/qt5-webkit to build just fine.




Note: To get this far a patch from bugzilla 215974 for
audio/liba52 was also needed.
Comment 23 Mark Millard 2017-09-26 01:39:39 UTC
(In reply to Tobias C. Berner from comment #21)

I've submitted 222612:

www/qt5-webkit: for armv6/v7: The cacheFlush support is missing on this platform

with some material extracted from the notes
from here.
Comment 24 Tobias C. Berner freebsd_committer 2017-11-03 18:11:09 UTC
Landed in r453418.  Thanks for the patch