While poking at building openmpi with clang, I started wondering about flang and some things:

* Should %set_build_flags set FC?  I think it should since it sets FCFLAGS.

* Is flang-new even worth bothering with? See the following configure check:

configure:32655: flang-new -c -O2 -flto -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules conftest.F >&5
flang-new: warning: argument unused during compilation: '-fexceptions'
flang-new: warning: argument unused during compilation: '-g'
flang-new: warning: argument unused during compilation: '-grecord-command-line'
flang-new: warning: argument unused during compilation: '-Wall'
flang-new: warning: argument unused during compilation: '-Wp,-D_FORTIFY_SOURCE=2' flang-new: warning: argument unused during compilation: '-Wp,-D_GLIBCXX_ASSERTIONS' flang-new: warning: argument unused during compilation: '-fstack-protector-strong'
flang-new: warning: argument unused during compilation: '-mtune=generic'
flang-new: warning: argument unused during compilation: '-fasynchronous-unwind-tables' flang-new: warning: argument unused during compilation: '-fstack-clash-protection' flang-new: warning: argument unused during compilation: '-fcf-protection=full'
error: Only `-Werror` is supported currently.

Of particular note is ignoring the '-g' option.

* If we do, it looks like we need a different set of FCFLAGS for flang-new - in particular dropping the -Werror=format-security option as seen above, as well as LTO options per:

configure:33152: flang-new -o conftest -O2 -flto -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -flto -fno-openmp-implicit-rpath -Wl,--build-id=sha1 conftest.f >&5
flang-new: warning: argument unused during compilation: '-fexceptions'
flang-new: warning: argument unused during compilation: '-grecord-command-line'
flang-new: warning: argument unused during compilation: '-Wall'
flang-new: warning: argument unused during compilation: '-Wp,-D_FORTIFY_SOURCE=2' flang-new: warning: argument unused during compilation: '-Wp,-D_GLIBCXX_ASSERTIONS' flang-new: warning: argument unused during compilation: '-fstack-protector-strong'
flang-new: warning: argument unused during compilation: '-mtune=generic'
flang-new: warning: argument unused during compilation: '-fasynchronous-unwind-tables' flang-new: warning: argument unused during compilation: '-fstack-clash-protection' flang-new: warning: argument unused during compilation: '-fcf-protection=full' /usr/bin/ld: error: LLVM gold plugin has failed to create LTO module: input module has no datalayout flang-new: error: linker command failed with exit code 1 (use -v to see invocation)


I started poking at implementing this in redhat-rpm-config, but it seems pretty tricky as for the most part we seem to assume that every compiler can accept the same set of flags.

This also bites us if we try to use gfortran with clang as I end up with it trying to use the clang config.

configure:33152: gfortran -o conftest -O2 -flto -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -flto -fno-openmp-implicit-rpath -Wl,--build-id=sha1 conftest.f >&5 gfortran: error: unrecognized command-line option '--config'; did you mean '-mpconfig'? gfortran: error: unrecognized command-line option '-fno-openmp-implicit-rpath'

Thoughts?


--
Orion Poplawski
he/him/his  - surely the least important thing about me
IT Systems Manager                         720-772-5637
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       or...@nwra.com
Boulder, CO 80301                 https://www.nwra.com/

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to