Skip to content

Commit

Permalink
- handle -Wl,--no-as-needed via configure
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2489
  • Loading branch information
adrpo authored and OpenModelica-Hudson committed Jun 3, 2018
1 parent cc5bf4b commit e8a3024
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile.common
Expand Up @@ -467,7 +467,7 @@ sundials: umfpack
$(MAKE) -f $(defaultMakefileTarget) $(builddir_lib_omc)/libsundials_ida.a
$(builddir_lib_omc)/libsundials_ida.a: 3rdParty/sundials/CMakeLists.txt
mkdir -p 3rdParty/sundials/build
cd 3rdParty/sundials/build && $(CMAKE) .. -G $(CMAKE_TARGET) -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_INSTALL_PREFIX=`pwd` -DKLU_ENABLE:Bool=ON -DKLU_LIBRARY_DIR="$(builddir_lib_omc)" -DKLU_INCLUDE_DIR="$(OMBUILDDIR)/include/omc/c/suitesparse/Include/" -DCMAKE_C_FLAGS="$(CFLAGS) -Wl,--no-as-needed -lm -L $(builddir_lib_omc)" $(SUITESPARSE_LIBS) $(IS_MINGW32) $(IS_MINGW64) -DSUITESPARSECONFIG_LIBRARY="" -DLAPACK_ENABLE:Bool=ON
cd 3rdParty/sundials/build && $(CMAKE) .. -G $(CMAKE_TARGET) -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_INSTALL_PREFIX=`pwd` -DKLU_ENABLE:Bool=ON -DKLU_LIBRARY_DIR="$(builddir_lib_omc)" -DKLU_INCLUDE_DIR="$(OMBUILDDIR)/include/omc/c/suitesparse/Include/" -DCMAKE_C_FLAGS="$(CFLAGS) -lm -L $(builddir_lib_omc)" $(SUITESPARSE_LIBS) $(IS_MINGW32) $(IS_MINGW64) -DSUITESPARSECONFIG_LIBRARY="" -DLAPACK_ENABLE:Bool=ON
$(MAKE) -C 3rdParty/sundials/build install
# adrpo: do not copy the headers as they are not needed!
mkdir -p $(OMBUILDDIR)/include/omc/c/sundials
Expand Down
6 changes: 4 additions & 2 deletions configure.ac
Expand Up @@ -203,9 +203,11 @@ if $CC --version | grep -q gcc && $CC -dumpversion | grep -q "^5"; then
TRY_FLAGS="$TRY_FLAGS -fno-ipa-pure-const"
fi

# GCC 7.x generates RUNPATH instead of RPATH
# GCC 7.x issues:
# - RUNPATH instead of RPATH, disable that via -Wl,--disable-new-dtags
# - sqrt from libcolamd is not found in -lm if -Wl,--no-as-needed is not specified
if $CC --version | grep -q gcc && $CC -dumpversion | grep -q "^7"; then
TRY_FLAGS="$TRY_FLAGS -Wl,--disable-new-dtags"
TRY_FLAGS="$TRY_FLAGS -Wl,--disable-new-dtags -Wl,--no-as-needed"
fi

for flag in $TRY_FLAGS; do
Expand Down

0 comments on commit e8a3024

Please sign in to comment.