Changeset c463e0a in OpenModelica


Ignore:
Timestamp:
2016-04-04T16:58:32+02:00 (8 years ago)
Author:
Adrian Pop <adrian.pop@…>
Branches:
Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
25e182c0
Parents:
45d32fb
Message:

adapt to msys2 mingw32/mingw64 - ticket:2578

  • force qt4 build only on Linux
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • OMEdit/OMEditGUI/CrashReport/backtrace.c

    rc01559b8 rc463e0a  
    163163}
    164164
     165#if defined(__MINGW32__) && !defined(__MINGW64__) /* on 32 bit */
     166#define REG_BP Ebp /* frame pointer */
     167#define REG_IP Eip /* program counter */
     168#define REG_SP Esp /* stack pointer */
     169#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_I386
     170#elif defined(__MINGW32__) && defined(__MINGW64__) /* on 64 bit */
     171#define REG_BP Rbp /* frame pointer */
     172#define REG_IP Rip /* program counter */
     173#define REG_SP Rsp /* stack pointer */
     174#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_AMD64
     175#endif
     176
    165177void
    166178_backtrace(struct output_buffer *ob, struct bfd_set *set, int depth , LPCONTEXT context)
     
    173185  STACKFRAME frame;
    174186  memset(&frame,0,sizeof(frame));
    175 #if defined(__MINGW32__) && (GCC_VERSION > 40900)
    176   /* adrpo: this doesn't seem to be working for MinGW GCC 4.9.2 */
    177 #else
    178   frame.AddrPC.Offset = context->Eip;
     187
     188  frame.AddrPC.Offset = context->REG_IP;     /* program counter */
    179189  frame.AddrPC.Mode = AddrModeFlat;
    180   frame.AddrStack.Offset = context->Esp;
     190  frame.AddrStack.Offset = context->REG_SP;  /* stack pointer */
    181191  frame.AddrStack.Mode = AddrModeFlat;
    182   frame.AddrFrame.Offset = context->Ebp;
     192  frame.AddrFrame.Offset = context->REG_BP;  /* frame pointer */
    183193  frame.AddrFrame.Mode = AddrModeFlat;
    184 #endif
     194
    185195  HANDLE process = GetCurrentProcess();
    186196  HANDLE thread = GetCurrentThread();
     
    189199  char module_name_raw[MAX_PATH];
    190200
    191   while(StackWalk(IMAGE_FILE_MACHINE_I386,
     201  while(StackWalk(IMAGE_FILE_MACHINE_NATIVE,
    192202                  process,
    193203                  thread,
     
    206216    symbol->MaxNameLength = 254;
    207217
    208     DWORD module_base = SymGetModuleBase(process, frame.AddrPC.Offset);
     218    HINSTANCE module_base = (HINSTANCE)SymGetModuleBase(process, frame.AddrPC.Offset);
    209219
    210220    const char * module_name = "[unknown module]";
    211221    if (module_base &&
    212         GetModuleFileNameA((HINSTANCE)module_base, module_name_raw, MAX_PATH)) {
     222        GetModuleFileNameA(module_base, module_name_raw, (DWORD)MAX_PATH)) {
    213223      module_name = module_name_raw;
    214224      bc = get_bc(ob, set, module_name);
     
    224234
    225235    if (file == NULL) {
    226       DWORD dummy = 0;
    227       if (SymGetSymFromAddr(process, frame.AddrPC.Offset, &dummy, symbol)) {
     236      if (SymGetSymFromAddr(process, frame.AddrPC.Offset, NULL, symbol)) {
    228237        file = symbol->Name;
    229238      }
  • OMEdit/OMEditGUI/Makefile.omdev.mingw

    r458b0ec8 rc463e0a  
    1919  cp -p $(resourcedir)/*.qm $(builddir_share)/omedit/nls/
    2020  cp -p ../bin/$(NAME)$(EXE) $(builddir_bin)
    21   cp -puf $(OMDEV)/tools/OMTools/dll/libgcc_s_dw2-1.dll $(builddir_bin)
    22   cp -puf $(OMDEV)/tools/OMTools/dll/mingwm10.dll $(builddir_bin)
    23   cp -puf $(OMDEV)/tools/mingw/bin/libintl-8.dll $(builddir_bin)
    24   cp -puf $(OMDEV)/tools/mingw/bin/libiconv-2.dll $(builddir_bin)
    25   cp -puf $(OMDEV)/tools/OMTools/dll/QtCore4.dll $(builddir_bin)
    26   cp -puf $(OMDEV)/tools/OMTools/dll/QtGui4.dll $(builddir_bin)
    27   cp -puf $(OMDEV)/tools/OMTools/dll/QtNetwork4.dll $(builddir_bin)
    28   cp -puf $(OMDEV)/tools/OMTools/dll/QtSvg4.dll $(builddir_bin)
    29   cp -puf $(OMDEV)/tools/OMTools/dll/QtWebKit4.dll $(builddir_bin)
    30   cp -puf $(OMDEV)/tools/OMTools/dll/QtXml4.dll $(builddir_bin)
    31   cp -puf $(OMDEV)/tools/OMTools/dll/QtXmlPatterns4.dll $(builddir_bin)
    32   mkdir -p $(builddir_bin)/iconengines/
    33   cp -puf $(OMDEV)/tools/OMTools/dll/qsvgicon4.dll $(builddir_bin)/iconengines/
    3421
    3522Resources/nls/qm.stamp: OMEditGUI.pro Resources/nls/*.ts
     
    4734parsergen:
    4835  $(MAKE) -C Debugger/Parser -f Makefile.lib.omdev.mingw
    49  
     36
    5037build: version $(NAME)
    5138  $(MAKE) -f Makefile
  • OMEdit/OMEditGUI/OMEditGUI.pro

    rfbf65b8c rc463e0a  
    6666    QMAKE_LFLAGS_RELEASE =
    6767    # required for backtrace
    68     LIBS += -L$$(OMDEV)/tools/mingw/bin -limagehlp -lbfd -lintl -liberty
     68    # win32 vs. win64
     69    UNAME = $$system(uname)
     70    isEmpty(UNAME): UNAME = MINGW32
     71    ISMINGW32 = $$find(UNAME, MINGW32)
     72    message(uname: $$UNAME)
     73    count( ISMINGW32, 1 ) {
     74    LIBS += -L$$(OMDEV)/tools/msys/mingw32/bin -L$$(OMDEV)/tools/msys/mingw32/lib -L$$(OMDEV)/tools/msys/mingw32/lib/binutils -limagehlp -lbfd -lintl -liberty
     75    } else {
     76      LIBS += -L$$(OMDEV)/tools/msys/mingw64/bin -L$$(OMDEV)/tools/msys/mingw64/lib -L$$(OMDEV)/tools/msys/mingw64/lib/binutils -limagehlp -lbfd -lintl -liberty
     77  }
    6978  }
    7079  LIBS += -L../OMEditGUI/Debugger/Parser -lGDBMIParser \
  • OMEdit/OMEditGUI/Options/OptionsDialog.cpp

    rfbf65b8c rc463e0a  
    35363536  mpGDBPathLabel = new Label(tr("GDB Path:"));
    35373537#ifdef WIN32
     3538#if defined(__MINGW32__) && !defined(__MINGW64__)
     3539  const char *sgdb = "/tools/msys/mingw32/bin/gdb.exe";
     3540#endif
     3541#if defined(__MINGW64__)
     3542  const char *sgdb = "/tools/msys/mingw64/bin/gdb.exe";
     3543#endif
    35383544  const char *OMDEV = getenv("OMDEV");
    35393545  if (QString(OMDEV).isEmpty()) {
    3540     mpGDBPathTextBox = new QLineEdit(QString(Helper::OpenModelicaHome).append("/MinGW/bin/gdb.exe"));
     3546    mpGDBPathTextBox = new QLineEdit(QString(Helper::OpenModelicaHome).append(sgdb));
    35413547  } else {
    35423548    QString qOMDEV = QString(OMDEV).replace("\\", "/");
    3543     mpGDBPathTextBox = new QLineEdit(QString(qOMDEV).append("/tools/mingw/bin/gdb.exe"));
     3549    mpGDBPathTextBox = new QLineEdit(QString(qOMDEV).append(sgdb));
    35443550  }
    35453551#else
  • OMEdit/OMEditGUI/Simulation/SimulationProcessThread.cpp

    r66abb94 rc463e0a  
    7777  QStringList args;
    7878#ifdef WIN32
    79   args << simulationOptions.getOutputFileName() << pSimulationPage->getTargetCompilerComboBox()->currentText() << "parallel" << numProcs << "0";
     79#if defined(__MINGW32__) && defined(__MINGW64__) /* on 64 bit */
     80  const char* omPlatform = "mingw64";
     81#else
     82  const char* omPlatform = "mingw32";
     83#endif
     84  args << simulationOptions.getOutputFileName() << pSimulationPage->getTargetCompilerComboBox()->currentText() << omPlatform << "parallel" << numProcs << "0";
    8085  QString compilationProcessPath = QString(Helper::OpenModelicaHome) + "/share/omc/scripts/Compile.bat";
    8186  mpCompilationProcess->start(compilationProcessPath, args);
  • qjson/CMakeLists.txt

    r1501542 rc463e0a  
    4242
    4343option(QT4_BUILD "Force building with Qt4 even if Qt5 is found")
     44IF (WIN32)
     45# set(QT4_BUILD ON)
     46ELSE(WIN32)
    4447set(QT4_BUILD ON)
     48ENDIF(WIN32)
    4549
    4650IF (NOT QT4_BUILD)
Note: See TracChangeset for help on using the changeset viewer.