Please see the description here: https://github.com/flang-compiler/flang/issues/113
Addressing this will require upstream to change flang when used for linking to "know" about its own libraries so that we can remove the current wrapper script in our port.
In the meanwhile, maybe the wrapper could do something like [1] to avoid the warnings? [1] ============================================== #!/bin/sh CPPFLAGS="-I/usr/local/flang/include" LDFLAGS="-L/usr/local/flang/lib -lflang -lflangmain -lflangrti -lompstub -lexecinfo" for arg in $@; do case "$arg" in -c|-E) LDFLAGS="";; -v) CPPFLAGS=""; LDFLAGS="";; esac done exec /usr/local/flang/bin/flang $LDFLAGS $CPPFLAGS $@
Thanks, I'll give your suggestion a poudriere run to see if anything pops up!
Unfortunately, this breaks math/R in the configure stage when it tries to figure out the libraries of the Fortran compiler (to link against them in hybrid Fortran/C code).
Oh well, that's actually me thinking for years that -v was for "show the version" when it was "be verbose" and running stuff like "cc -v" to get compiler name/version is an unintended use. In that case, the -v line makes no sense in the option test. The script should be simply (let's keep the case if somebody need to do more?): #!/bin/sh CPPFLAGS="-I/usr/local/flang/include" LDFLAGS="-L/usr/local/flang/lib -lflang -lflangmain -lflangrti -lompstub -lexecinfo" for arg in $@; do case "$arg" in -c|-E) LDFLAGS="";; esac done exec /usr/local/flang/bin/flang $LDFLAGS $CPPFLAGS $@
A commit references this bug: Author: jmd Date: Tue Dec 12 02:43:49 UTC 2017 New revision: 456079 URL: https://svnweb.freebsd.org/changeset/ports/456079 Log: devel/flang: silence warnings caused by the wrapper script shortcomings and only add linking flags if needed. PR: 220588 Reviewed by: swills (mentor) Approved by: swills (mentor) Obtained from: PR220588 (with changes) Differential Revision: https://reviews.freebsd.org/D13371 Changes: head/devel/flang/Makefile head/devel/flang/files/flang.in
Comitted. Closing, thanks for your patch!