Bug 220829 - devel/flang: flang sources ready for llvm 4.0 now
Summary: devel/flang: flang sources ready for llvm 4.0 now
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: Johannes M Dieterich
URL: https://github.com/flang-compiler/cla...
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2017-07-18 13:34 UTC by Rainer Hurling
Modified: 2017-07-31 02:34 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (jmd)


Attachments
patch updates devel/flang-clang from version 3.9 to 4.0 (13.04 KB, patch)
2017-07-18 16:28 UTC, Rainer Hurling
no flags Details | Diff
patch updates devel/flang from version 3.9 to 4.0 (2.68 KB, patch)
2017-07-18 16:29 UTC, Rainer Hurling
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Hurling freebsd_committer freebsd_triage 2017-07-18 13:34:12 UTC
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
Comment 1 Rainer Hurling freebsd_committer freebsd_triage 2017-07-18 16:28:24 UTC
Created attachment 184474 [details]
patch updates devel/flang-clang from version 3.9 to 4.0
Comment 2 Rainer Hurling freebsd_committer freebsd_triage 2017-07-18 16:29:56 UTC
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.
Comment 3 Rainer Hurling freebsd_committer freebsd_triage 2017-07-18 17:22:19 UTC
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.
Comment 4 Johannes M Dieterich freebsd_committer freebsd_triage 2017-07-21 03:30:13 UTC
Thanks for the patches! I'll try to test them these days and will then commit them to the port unless something comes up.
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-07-31 02:33:51 UTC
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
Comment 6 Johannes M Dieterich freebsd_committer freebsd_triage 2017-07-31 02:34:31 UTC
Committed in r446946. Thanks again!