Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 22bbcbb

Browse files
adrpoOpenModelica-Hudson
authored andcommitted
Fixes for ticket:5117 and ticket:5119
- link in static libs (even for Modelica tables) for FMU and for the generated executable (all except sundials) - on 32bit, pass gcc flag -mstackrealign to reallign SSE functions (so they can be used from other Windows processes, such as fmuChecker) - build SimulationRuntime/c/ with -mstackrealign Belonging to [master]: - #2646
1 parent f9edf28 commit 22bbcbb

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Compiler/runtime/omc_config.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
#define DEFAULT_MAKE "make"
8484

8585
/* adrpo: add -loleaut32 as is used by ExternalMedia */
86-
#define DEFAULT_LDFLAGS "-lregex -lexpat -lomcgc -Wl,-Bstatic -lpthread -Wl,-Bdynamic -fopenmp -loleaut32 -limagehlp -lz -lhdf5"
86+
#define DEFAULT_LDFLAGS "-fopenmp -Wl,-Bstatic -lregex -ltre -lintl -liconv -lexpat -lomcgc -lpthread -loleaut32 -limagehlp -lz -lhdf5 -lszip -Wl,-Bdynamic"
8787

8888

8989
#define CONFIG_WITH_OPENMP 1
@@ -96,10 +96,10 @@
9696
#endif
9797

9898
/* adrpo: add -loleaut32 as is used by ExternalMedia */
99-
#define BASIC_LDFLAGS_RT " -lomcgc -lexpat -lregex -static-libgcc -luuid -loleaut32 -lole32 -limagehlp -lws2_32 -llis -lumfpack -lklu -lcolamd -lbtf -lamd -lsundials_idas -lsundials_kinsol -lsundials_nvecserial -lipopt -lcoinmumps -Wl,-Bstatic -lpthread -Wl,-Bdynamic -lm -lgfortranbegin -lgfortran -lmingw32 -lgcc_eh -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lopenblas -lcminpack"
99+
#define BASIC_LDFLAGS_RT " -Wl,-Bstatic -lomcgc -lregex -ltre -lintl -liconv -lexpat -static-libgcc -luuid -loleaut32 -lole32 -limagehlp -lws2_32 -llis -lumfpack -lklu -lcolamd -lbtf -lamd -Wl,-Bdynamic -lsundials_idas -lsundials_kinsol -lsundials_nvecserial -Wl,-Bstatic -lipopt -lcoinmumps -lpthread -lm -lgfortranbegin -lgfortran -lquadmath -lmingw32 -lgcc_eh -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lopenblas -lcminpack -Wl,-Bdynamic"
100100
#define LDFLAGS_RT " -lOpenModelicaRuntimeC" BASIC_LDFLAGS_RT
101-
#define LDFLAGS_RT_SIM " -lSimulationRuntimeC" BASIC_LDFLAGS_RT " -lwsock32 -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic"
102-
#define LDFLAGS_RT_SOURCE_FMU " -lregex -static-libgcc -Wl,-Bstatic -lpthread -Wl,-Bdynamic -lm -lgfortranbegin -lgfortran -lmingw32 -lgcc_eh -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -limagehlp -lopenblas -lz -lhdf5"
101+
#define LDFLAGS_RT_SIM " -Wl,-Bstatic -lSimulationRuntimeC -Wl,-Bdynamic" BASIC_LDFLAGS_RT " -lwsock32 -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic"
102+
#define LDFLAGS_RT_SOURCE_FMU " -Wl,-Bstatic -lregex -ltre -lintl -liconv -static-libgcc -lpthread -lm -lgfortranbegin -lgfortran -lquadmath -lmingw32 -lgcc_eh -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -limagehlp -lopenblas -lz -lhdf5 -lszip -Wl,-Bdynamic"
103103
#define CONFIG_EXE_EXT ".exe"
104104
#define CONFIG_DLL_EXT ".dll"
105105
#define CONFIG_OS "Windows_NT"
@@ -115,7 +115,7 @@
115115
* Visual Studio then use the SSE instructions,
116116
* not the normal i387 FPU
117117
*/
118-
#define DEFAULT_CFLAGS "-falign-functions -msse2 -mfpmath=sse ${MODELICAUSERCFLAGS}"
118+
#define DEFAULT_CFLAGS "-falign-functions -mstackrealign -msse2 -mfpmath=sse ${MODELICAUSERCFLAGS}"
119119
#else
120120
#define DEFAULT_CFLAGS "-falign-functions ${MODELICAUSERCFLAGS}"
121121
#endif

SimulationRuntime/c/Makefile.omdev.mingw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ AR = ar -ru
1717
CC = gcc
1818
FC = g77
1919
#include the sundials, ipopt from OMDev and the top_builddir for revision.h
20-
CONFIG_CFLAGS = -O2 -falign-functions -msse2 -mfpmath=sse \
20+
CONFIG_CFLAGS = -O2 -falign-functions -mstackrealign -msse2 -mfpmath=sse \
2121
-I$(OMDEV)/lib/3rdParty/Ipopt/include/ \
2222
-I$(top_builddir)/3rdParty/sundials/build/include \
2323
-I$(OMDEV)/include/lis -I$(top_builddir)/ -I$(builddir_inc)/ \

0 commit comments

Comments
 (0)