Created attachment 203608 [details] patch Add -fpermissive to CXXFLAGS when compiling with GCC to fix build. Failing build: https://talos.anongoth.pl/data/powerpc64-default/2019-04-06_01h45m28s/logs/errors/diaspora-1.1.1_1.log While here, also add USES=gl.
Hello. Thanks for PR and patch submission. As I understood, the provided build log mentions about GCC 4.2.1 compiler: _CCVERSION_921dbbb2=cc (GCC) 4.2.1 20070831 patched [FreeBSD] <..> I checked build with using newer GCC 8.3 compiler (lang/gcc8, USE_GCC=yes) (at least on amd64 architecture, but mentioned compiler errors might be the same) and it builds without errors. The newer GCC 8.3 compiler doesn't require CXXFLAGS+=-fpermissive for this case also. This may mean, that this is GCC 4.2.1 (or 4.x) related compiler issue. The ".if exists(/usr/lib/libstdc++.so)" (in attachment #203608 [details]) is inderect check for installed GCC 4.2.1 compiler in FreeBSD base, if I'm not wrong. There are cases in current FreeBSD ports for such check. But maybe possible to add some comment about GCC 4.2.1 related issue for this case. I guess, that possible alternative approach is explicit check for GCC compiler version, for example: -8<-- USES+= compiler .include <bsd.port.pre.mk> .if ${CHOSEN_COMPILER_TYPE} == gcc && ${COMPILER_VERSION} < 43 CXXFLAGS+= -fpermissive .endif # <..> .include <bsd.port.post.mk> -->8- (In reply to comment #0) > While here, also add USES=gl. You also proposed to add sdl to USES. There is a space character between "+=" and "-fpermissive" on 76 (19 in patch) line in attachment #203608 [details]: "WARN: Makefile: [76]: use a tab (not space) after a variable name". Please fix this and I may approve this patch.
(In reply to lightside from comment #1) When using GCC8, I get: bmpman/bmpman.cpp: In function 'int bm_make_render_target(int, int, int)': bmpman/bmpman.cpp:2817:71: error: cast from 'void*' to 'ptr_u' {aka 'unsigned int'} loses precision [-fpermissive] bm_bitmaps[n].bm.data = (ptr_u) bm_malloc(n, bm_bitmaps[n].mem_taken); That's how I found that -fpermissive fixes that and it turns out it works with base GCC. You could add: .if ${CHOSEN_COMPILER_TYPE} == gcc && ${COMPILER_VERSION} < 43 if this is the approach you want to use. However, you can drop the check for CHOSEN_COMPILER_TYPE, there's no Clang version lower than 4.3 in currently supported FreeBSD versions.
Created attachment 203620 [details] v2 Patch with corrected space.
Comment on attachment 203620 [details] v2 (In reply to comment #2) Thanks for explanations. I approved new patch.
A commit references this bug: Author: swills Date: Sat Apr 13 00:57:27 UTC 2019 New revision: 498783 URL: https://svnweb.freebsd.org/changeset/ports/498783 Log: games/diaspora: fix build with GCC-based architectures PR: 237215 Submitted by: Piotr Kubaj <pkubaj@anongoth.pl> Approved by: lightside <lightside@gmx.com> (maintainer) Changes: head/games/diaspora/Makefile
Committed, thanks!