Summary: | games/flightgear: fails to build with clang 7 | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Jan Beich <jbeich> | ||||
Component: | Individual Port(s) | Assignee: | Ganael LAPLANCHE <martymac> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | Keywords: | needs-patch | ||||
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(martymac) |
||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 230355 | ||||||
Attachments: |
|
Description
Jan Beich
![]() ![]() Thanks for your report. I'll be able to take a look at this within one or two weeks. Best regards, Ganael. Created attachment 196400 [details]
First patch attempt
Hi Jan, Unfortunately my poudriere box is still running 11.2 and building packages for 12-CURRENT does not work anymore (python 2.7 cannot be built). Would the attached patch be enough to fix the problem ? Comment on attachment 196400 [details] First patch attempt In file included from src/FDM/UIUCModel/uiuc_gear.cpp:72: In file included from src/FDM/UIUCModel/uiuc_gear.h:4: In file included from src/FDM/UIUCModel/uiuc_aircraft.h:150: src/FDM/UIUCModel/uiuc_parsefile.h:26:17: error: reference to 'stack' is ambiguous stack commands; ^ src/FDM/UIUCModel/uiuc_parsefile.h:20:22: note: candidate found by name lookup is 'stack' typedef list<string> stack; //list to contain the input file "command_lines" ^ /usr/include/c++/v1/stack:113:28: note: candidate found by name lookup is 'std::__1::stack' class _LIBCPP_TEMPLATE_VIS stack ^ In file included from src/FDM/UIUCModel/uiuc_gear.cpp:72: In file included from src/FDM/UIUCModel/uiuc_gear.h:4: In file included from src/FDM/UIUCModel/uiuc_aircraft.h:150: src/FDM/UIUCModel/uiuc_parsefile.h:40:17: error: reference to 'stack' is ambiguous stack getCommands(); ^ src/FDM/UIUCModel/uiuc_parsefile.h:20:22: note: candidate found by name lookup is 'stack' typedef list<string> stack; //list to contain the input file "command_lines" ^ /usr/include/c++/v1/stack:113:28: note: candidate found by name lookup is 'std::__1::stack' class _LIBCPP_TEMPLATE_VIS stack ^ In file included from src/FDM/UIUCModel/uiuc_gear.cpp:72: In file included from src/FDM/UIUCModel/uiuc_gear.h:4: src/FDM/UIUCModel/uiuc_aircraft.h:153:9: error: reference to 'stack' is ambiguous typedef stack :: iterator LIST; ^ src/FDM/UIUCModel/uiuc_parsefile.h:20:22: note: candidate found by name lookup is 'stack' typedef list<string> stack; //list to contain the input file "command_lines" ^ /usr/include/c++/v1/stack:113:28: note: candidate found by name lookup is 'std::__1::stack' class _LIBCPP_TEMPLATE_VIS stack ^ In file included from src/FDM/UIUCModel/uiuc_gear.cpp:72: In file included from src/FDM/UIUCModel/uiuc_gear.h:4: src/FDM/UIUCModel/uiuc_aircraft.h:153:18: error: use of class template 'iterator' requires template arguments typedef stack :: iterator LIST; ^ /usr/include/c++/v1/iterator:521:29: note: template is declared here struct _LIBCPP_TEMPLATE_VIS iterator ^ 4 errors generated. build log: https://ptpb.pw/L7aF Hi Jan, As I am not able to run a poudriere build on -CURRENT, I have tried to reproduce the build problem using clang 7 from *ports* on 10.4/i386 and 11.2/amd64 by adding a dependency to the port and settinf CPP/CC/CXX variables. Unfortunately, flightgear builds fine on 11.2, see logs : http://box.martymac.org/FreeBSD-Packages/data/FBSD112amd64-default/2018-08-27_19h12m17s/logs/flightgear-2018.2.1_2.log On 10.4/i386, compilation fails with another error than yours : http://box.martymac.org/FreeBSD-Packages/data/FBSD104i386-default/2018-08-27_18h59m25s/logs/errors/flightgear-2018.2.1_2.log I presume those differences come from base path still being included for headers and libraries. Are you aware of an easy way to reproduce the build problem on 10.4 or 11.2 ? Best regards, Ganael. (In reply to Ganael LAPLANCHE from comment #5) > http://box.martymac.org/FreeBSD-Packages/data/FBSD112amd64-default/2018-08-27_19h12m17s/logs/flightgear-2018.2.1_2.log [...] > CC="gcc7" ... CPP="cpp7" ... CXX="g++7 What? Better replace 40 with 70 in the following conditional. See my build log: https://ptpb.pw/C3Bv (11.2 amd64) .if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 40 BUILD_DEPENDS+= ${LOCALBASE}/bin/clang40:devel/llvm40 CPP= ${LOCALBASE}/bin/clang-cpp40 CC= ${LOCALBASE}/bin/clang40 CXX= ${LOCALBASE}/bin/clang++40 .endif Note, the above conditional can be replaced with USES=compiler:c++14-lang where it'd be the subject to bug 230790. Note2, according my build log llvm70 can also be pulled via mesa-libs per bug 230789. Weird... If you look further in the logs, you'll see that /usr/local/bin/clang++70 is used. Anyway, I must have missed something. I'll double-check the Makefile (and MAKE_ENV) and try again, thanks! (In reply to Ganael LAPLANCHE from comment #5) > I presume those differences come from base path still being included for headers and libraries. No. comment 0 is strictly a Clang 7 issue, specific to C++ code. The affected file builds fine with clang++60 from devel/llvm60 on clang700-import branch. GCC hides malformed ordered comparison issues behind -Wextra but, unfortunately, even GCC 8.2.0 doesn't report this case. libc++ issues are usually more ambiguous but easy to bisect. When object files are built (before linking) only libc++ headers are used, so checking out libc++ trunk, passing -nostdinc++ -isystem/path/to/libcxx/include and jumping a hundred or more commits back is enough to start bisecting then come up with a fix. > Are you aware of an easy way to reproduce the build problem on 10.4 or 11.2 ? No, devel/llvm70 was supposed to be the easiest. I'm trying to figure out why the exact same clang++70 command line builds fine for you but not for me. Slightly more complicated would be to temporarily boot -CURRENT kernel with COMPAT_FREEBSD11 (like in GENERIC). As long as you don't install world/userland you shouldn't bump into ino64 and other ABI issues. poudriere actually relies on backward compatibility to run jails for older releases. A commit references this bug: Author: martymac Date: Sat Sep 1 20:22:08 UTC 2018 New revision: 478723 URL: https://svnweb.freebsd.org/changeset/ports/478723 Log: Fix build with Clang7 PR: 230502 Submitted by: jbeich Changes: head/games/flightgear/files/patch-clang7-src-AIModel-AIFlightPlanCreatePushBack.cxx head/games/flightgear/files/patch-clang7-stack_scope.diff Hi Jan, I have finally rebooted on a -CURRENT kernel with COMPAT_FREEBSD11 and have been able to reproduce the build problem :) I've just committed a fix that I'll submit upstream soon. Thanks a lot for your help and feedback. Best regards, Ganael. Merge request submitted upstream: https://sourceforge.net/p/flightgear/flightgear/merge-requests/141/ |