Bug 207559 - [PATCH] games/pioneer: armv6 support issue
Summary: [PATCH] games/pioneer: armv6 support issue
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Some People
Assignee: Dmitry Marakasov
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-02-28 13:32 UTC by lightside
Modified: 2016-04-03 12:00 UTC (History)
2 users (show)

See Also:


Attachments
Proposed patch (since 409733 revision) for testing (396 bytes, patch)
2016-02-28 13:32 UTC, lightside
no flags Details | Diff
Proposed patch (since 411981 revision) with profiler non-default option (1.01 KB, patch)
2016-03-31 07:32 UTC, lightside
no flags Details | Diff
Proposed patch (since 411981 revision) with profiler non-default option (1.06 KB, patch)
2016-03-31 07:39 UTC, lightside
no flags Details | Diff
Proposed patch (since 411981 revision) with profiler non-default option (1.07 KB, patch)
2016-03-31 08:16 UTC, lightside
no flags Details | Diff
Proposed patch (since 411981 revision) with profiler non-default option (1.16 KB, patch)
2016-03-31 09:19 UTC, lightside
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lightside 2016-02-28 13:32:54 UTC
Created attachment 167513 [details]
Proposed patch (since 409733 revision) for testing

Hello.

I raised issue about armv6 support for games/pioneer port in the bug 206811.
Guido Falsi recommended to create a new bug report for it here.

Current proposed patch contains the code to switch from default (presumably Clang) to GCC compiler on armv6 architecture. This may fix a configure error, which was found on 0.0.20151130 version on PortsMon for following poudriere build log:
http://beefy8.nyi.freebsd.org/data/head-armv6-default/p407727_s295126/logs/errors/pioneer-0.0.20151130.log

The presumable reason of such configure error is "core dump", when running a test case for assimp library support, which is GCC compiled in the multimedia/assimp port currently. This was a case for previous FreeBSD versions before 10 (e.g. 9.3) after a switch to default Clang compiler, but the same issue appeared again for FreeBSD head (11) version on armv6 architecture.

It's known, that GCC compiled pioneer application on FreeBSD 10.2 amd64 creates a "core dump" after launch, while it was ok on FreeBSD 9.3 amd64 (for some releases, which I tested in a time, when I used FreeBSD 9.x version). Therefore, just a guessed switch to GCC compiler on FreeBSD armv6 may not be enough, if it core dumps also. I think, there is a "running test" needed for pioneer application on FreeBSD armv6 machine for such a patch, else it may block a further testing of default armv6 compiler on FreeBSD build machine(s), while the pioneer application may core dump on it after launch.

The status of this bug report required to be new/open before confirmation of running (or not running) pioneer application on FreeBSD armv6 machine(s) from interested user(s). The pioneer application may require OpenGL 3.x graphics support, but building and/or running results (with(out) core dump(s)) are welcome to decide about armv6 support for games/pioneer port. Otherwise, this bug report might be solved by itself after successful build result(s) on PortsMon, in case of possible fixes of default armv6 compiler (or toolchain/libraries) on FreeBSD, I guess.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2016-03-03 02:09:24 UTC
Update hardware category to arm from arm64 based on the headline
Comment 2 lightside 2016-03-03 09:14:18 UTC
(In reply to Ed Maste from comment #1)
> Update hardware category to arm from arm64 based on the headline
Ok, thanks.

Currently, I also explore the possibility to build multimedia/assimp port with native armv6 compiler, instead of GCC, on bug 207575. Maybe, if multimedia/assimp and games/pioneer ports will built with the same compiler, then the issue will be fixed.
Comment 3 Dmitry Marakasov freebsd_committer freebsd_triage 2016-03-30 17:49:43 UTC
assimp was recently fixed, but pioneer still doesn't build as it uses x86 assembly:

Profiler.cpp:84:9: error: invalid output constraint '=q' in asm
                                                : "=q" (ret), "=m" (ptr_)
                                                  ^

This is upstream problem. I think we should mark pioneer with ONLY_FOR_ARCHS=i386 amd64 here.
Comment 4 lightside 2016-03-31 07:32:16 UTC
Created attachment 168806 [details]
Proposed patch (since 411981 revision) with profiler non-default option

Hello, Dmitry Marakasov.

(In reply to comment #3)
> pioneer still doesn't build as it uses x86 assembly:
> 
> Profiler.cpp:84:9: error: invalid output constraint '=q' in asm
>                                                : "=q" (ret), "=m" (ptr_)
>                                                  ^
The error is related to internal profiler, which is optional and enabled with "--enable-profiler" configure option.
Looks like, upstream developers uses modified version of "High performance C++ Profiler implementation" (https://github.com/michael-mayes/high-performance-cplusplus-profiler) and tried to use it on arm platform, for example on following Git commit:
"Rework slightly so that std::chrono is always used on __arm__ platforms to avoid x86 assembler!"
https://github.com/pioneerspacesim/pioneer/commit/fffd081f567313687b1fbff6b2d60295308b5bbe
but not all parts were ported, according to the error.

Some guess why contrib/profiler source code wasn't removed from build in case of not using internal profiler is possibility to use Travis builds for pioneer on GitHub.

Therefore, I propose to add optional "PROFILER" option (which is not "PROFILE", because of different meaning, not related to compiler options), which adds "--enable-profiler" option to configure arguments, in case of enabled, or removes profiler related files from build scripts, in case of disabled. The proposed patch attached.

(In reply to comment #3)
> This is upstream problem. I think we should mark pioneer with
> ONLY_FOR_ARCHS=i386 amd64 here.
There is a possibility for such a route (may be with a BROKEN_armv6 message instead), but (currently) I propose to use attached patch, e.g. included in the next version update, and see how it builds on FreeBSD armv6 build server(s).

Thanks for your attention.
Comment 5 lightside 2016-03-31 07:39:19 UTC
Created attachment 168807 [details]
Proposed patch (since 411981 revision) with profiler non-default option

Just changed the order of post-patch-PROFILER-off after post-patch-MODELCOMPILER-off.
Comment 6 lightside 2016-03-31 08:16:59 UTC
Created attachment 168809 [details]
Proposed patch (since 411981 revision) with profiler non-default option

Changed PROFILER_CONFIGURE_ENABLE to PROFILER_CONFIGURE_ON, because on opposite it still adds -DPIONEER_PROFILER to EXTRA_CPPFLAGS on --disable-profiler, according to config.log file.
Comment 7 lightside 2016-03-31 09:19:17 UTC
Created attachment 168810 [details]
Proposed patch (since 411981 revision) with profiler non-default option

- Added sed patch to remove "contrib/profiler/Makefile" from ${WRKSRC}/configure.ac file.
- Added proper sed extensions for repeatedly changed files.
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-04-03 12:00:44 UTC
A commit references this bug:

Author: amdmi3
Date: Sun Apr  3 12:00:26 UTC 2016
New revision: 412462
URL: https://svnweb.freebsd.org/changeset/ports/412462

Log:
  - Switch profiler which depends on x86 assembly off by default, fixing build on arm

  PR:		207559
  Submitted by:	lightside@gmx.coma (maintainer)

Changes:
  head/games/pioneer/Makefile