Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DWARF unwinding with Clang to avoid overproduction of linking warnings with clang + gfortran #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all 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
21 changes: 21 additions & 0 deletions acsm_compiler_flags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,27 @@ 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_LDFLAGS="$LDFLAGS"
LDFLAGS+=" -Wl,-femit-dwarf-unwind=no_compact_unwind"
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <iostream>
void main(int argc, char **argv)
{
std::cout << "Hello World!" << std::endl;
}
]])],
[
AC_MSG_RESULT(<<<Disabling compact unwinding, retaining dwarf unwinding for gfortran compatibility>>>)
ACSM_LDFLAGS+=" -Wl,-femit-dwarf-unwind=no_compact_unwind"
],[
dnl Failed to link with new flags, do not add them
])
dnl Reset to old flags in case for any potential other test
LDFLAGS="$old_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