Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions acsm_compiler_flags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,24 @@ AC_DEFUN([ACSM_SET_CXX_FLAGS],
],

[clang], [
dnl On Darwin with clang + gfortran, we get very many warnings for compact unwinding issues
dnl We deliberately keep relying on the less performant dwarf unwinding until the over-production of warnings is solved.
OLD_ACSM_LDFLAGS="$ACSM_LDFLAGS"
ACSM_LDFLAGS+=" -Wl,-femit-dwarf-unwind=no_compact_unwind"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it, AC_LINK_IFELSE specifically uses the variables LIBS and LDFLAGS to test linking:

https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Running-the-Linker.html

So I think you need to do like in the xdr example, and set the LIBS variable prior to calling AC_LINK_IFELSE. Also, it seems to me that there is an issue with your test program, it will need to #include <iostream> in order to be well-formed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I changed it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"-femit-dwarf-unwind=always" does not do much here btw, it s the two others that make the warnings disappear

AC_LINK_IFELSE([AC_LANG_SOURCE([[
void main(int argc, char **argv)
{
std::cout << "Hello World!" << std::endl;
}
]])],
[
AC_MSG_RESULT(<<<Disabling compact unwinding, retaining dwarf unwinding for gfortran compatibility>>>)
],[
dnl Failed to link with new flags, remove them
ACSM_LDFLAGS="$OLD_ACSM_LDFLAGS"
])


ACSM_CXXFLAGS_OPT="$ACSM_CXXFLAGS_OPT -O2 -felide-constructors -Qunused-arguments -Wunused-parameter -Wunused"
dnl devel flags are added on two lines since there are so many
ACSM_CXXFLAGS_DEVEL="$ACSM_CXXFLAGS_DEVEL -O2 -felide-constructors -g -pedantic -W -Wall -Wextra -Wno-long-long"
Expand Down