Bug 211258 - games/xonotic: Fails to build with GCC 4.2.1 (internal compiler error), Use C11 compiler (clang)
Summary: games/xonotic: Fails to build with GCC 4.2.1 (internal compiler error), Use C...
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: Dmitry Marakasov
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-07-21 00:39 UTC by Jan Beich
Modified: 2016-07-27 16:56 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (amdmi3)
jbeich: merge-quarterly?


Attachments
v1 (875 bytes, patch)
2016-07-21 00:39 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2016-07-21 00:39:15 UTC
Created attachment 172761 [details]
v1

The following issue only affects GCC 4.2.x in base. If there're no runtime issues let's use default compiler on FreeBSD 10+ and /usr/bin/clang on FreeBSD 9.

cc -MD -DPREFER_PRELOAD -DDP_FS_BASEDIR=\"/usr/local/share/xonotic\"  -DLINK_TO_ZLIB -I/usr/local/include -DLINK_TO_LIBJPEG  -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES -I../../../ -DCONFIG_MENU -DCONFIG_CD -DCONFIG_VIDEO_CAPTURE   -O2 -pipe -fno-strict-aliasing -fno-strict-aliasing -funroll-loops -c ../../..//dpsoftrast.c -o dpsoftrast.o -msse2
../../..//dpsoftrast.c: In function 'DPSOFTRAST_Draw_Span_Texture2DVaryingBGRA8':
../../..//dpsoftrast.c:2825: internal compiler error: in trunc_int_for_mode, at explow.c:56
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Dmitry Marakasov freebsd_committer freebsd_triage 2016-07-25 12:36:53 UTC
compiler:c11 is not suitable here as the code doesn't really require c11. We can instead check compiler version directly. What do you think?

+.if ${COMPILER_TYPE} == gcc && ${COMPILER_VERSION} == 42
+# internal compiler error with base gcc
+USE_GCC=      yes
+.endif
Comment 2 Jan Beich freebsd_committer freebsd_triage 2016-07-26 01:02:03 UTC
USES=compiler:c11 allows building with /usr/bin/clang on FreeBSD 9.x but USE_GCC currently pulls around 306 MiB of dependencies as part of RUN_DEPENDS. Not to mention COMPILER_TYPE cannot be checked before <bsd.port.pre.mk> unless you include <bsd.compiler.mk> which is forbidden in ports.

I find ports' Makefiles with conditionals more error prone than those written in declarative style. But this port is still maintained, so whatever...
Comment 3 Dmitry Marakasov freebsd_committer freebsd_triage 2016-07-26 15:40:19 UTC
(In reply to Jan Beich from comment #2)

> USES=compiler:c11

Again, it is not suitable as there's no c11 requirement at all.

> allows building with /usr/bin/clang on FreeBSD 9.x

Don't forget that 9.x is not the only platform which uses base gcc. Afair there's still no clang for mips.

> but USE_GCC currently pulls around 306 MiB of dependencies as part of
> RUN_DEPENDS.

I don't see a big problem here. First, it's much less than xonotic pulls itself, second, obsolete 9.x pulls gcc for a lot of stuff anyway.

> Not to mention COMPILER_TYPE cannot be checked before <bsd.port.pre.mk>

Of course it is to be checked after <bsd.port.pre.mk>.

> I find ports' Makefiles with conditionals more error prone than those
> written in declarative style. But this port is still maintained, so
> whatever...

There's no declarative machinery for this case, unfortunately.
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-07-27 16:56:41 UTC
A commit references this bug:

Author: amdmi3
Date: Wed Jul 27 16:55:39 UTC 2016
New revision: 419187
URL: https://svnweb.freebsd.org/changeset/ports/419187

Log:
  - Use clang where possible
  - Add missing xorg dependency

  PR:		211258
  Submitted by:	jbeich@FreeBSD.org

Changes:
  head/games/xonotic/Makefile