It seems, flang can now be build by clang4.0 [1][2]. So I would vote for a change within the devel/flang and devel/flang-clang ports. [1] https://github.com/flang-compiler/flang/commit/5a5a8cdea310056417f734a338d0f6ca85dd9d9f [2] https://github.com/flang-compiler/clang/commits/flang_release_40
Created attachment 184474 [details] patch updates devel/flang-clang from version 3.9 to 4.0
Created attachment 184475 [details] patch updates devel/flang from version 3.9 to 4.0 These two patches build and install fine, but have problems to run, at least on recent HEAD amd64.
It turns out, that run time problems only occur, if flang is called without a fortran source file, i.e. >flang /usr/local/flang/lib/libflangmain.a(flangmain.c.o): In function `main': /usr/ports/devel/flang/work/flang-cd44bcd/runtime/flangmain/flangmain.c:(.text.main+0x39): undefined reference to `MAIN_' clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation) Compiling something like 'flang hello.f90' gives an executable a.out, as expected: >./a.out hello world So I think, the updated version 4.0 should be usable in princible.
Thanks for the patches! I'll try to test them these days and will then commit them to the port unless something comes up.
A commit references this bug: Author: jmd Date: Mon Jul 31 02:33:10 UTC 2017 New revision: 446946 URL: https://svnweb.freebsd.org/changeset/ports/446946 Log: devel/flang and devel/flang-clang: Update to snapshots supporting llvm 4.0 and upgrade dependencies to this version. PR: 220829 Submitted by: Rainer Hurling (rhurlin@gwdg.de) Reviewed by: swills (mentor) Approved by: swills (mentor) Differential Revision: https://reviews.freebsd.org/D11709 Changes: head/devel/flang/Makefile head/devel/flang/distinfo head/devel/flang/files/patch-CMakeLists.txt head/devel/flang-clang/Makefile head/devel/flang-clang/distinfo head/devel/flang-clang/pkg-plist
Committed in r446946. Thanks again!