瀏覽代碼

Use --outputbin-main-only (ld-tigcc switch) instead of linking twice for compressed programs with an external data file. TIGCC 0.96 Beta 7 r1 required.

git-svn-id: file:///var/svn/tigccpp/trunk@757 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 18 年之前
父節點
當前提交
41c7b27d64
共有 2 個文件被更改,包括 4 次插入37 次删除
  1. 1 36
      ktigcc/mainform.ui.h
  2. 3 1
      ktigcc/tpr.cpp

+ 1 - 36
ktigcc/mainform.ui.h

@@ -4118,42 +4118,7 @@ void MainForm::linkProject()
     procio=static_cast<KProcIO *>(NULL);
     if (errorsCompilingFlag || stopCompilingFlag) return;
     // Rename the data file so it doesn't conflict with PPGs.
-    // If the program is compressed, we actually need to relink it without the
-    // outputbin flag.
-    // FIXME: Use --outputbin-main-only instead when the ld-tigcc supporting it
-    //        gets released.
     if (dataFileGenerated)  {
-      if (settings.pack) {
-        linkerOptions.remove("--outputbin");
-        // The QTextCodec has to be passed explicitly, or it will default to
-        // ISO-8859-1 regardless of the locale, which is just broken.
-        procio=new KProcIO(QTextCodec::codecForLocale());
-        // Use MergedStderr instead of Stderr so the messages get ordered
-        // properly.
-        procio->setComm(static_cast<KProcess::Communication>(
-          KProcess::Stdout|KProcess::MergedStderr));
-        procio->setWorkingDirectory(projectDir);
-        *procio<<(QString("%1/bin/ld-tigcc").arg(tigcc_base))
-               <<"-o"<<projectBaseName<<"-n"<<projectName;
-        if (!dataVarName.isNull()) *procio<<"-d"<<dataVarName;
-        *procio<<linkerOptions<<objectFiles;
-        if (settings.std_lib)
-          *procio<<QString(settings.flash_os?"%1/lib/flashos.a"
-                                            :(settings.fargo?"%1/lib/fargo.a"
-                                                            :"%1/lib/tigcc.a"))
-                   .arg(tigcc_base);
-        connect(procio,SIGNAL(processExited(KProcess*)),this,SLOT(procio_processExited()));
-        // Don't connect readReady, the errors/warnings have already been displayed!
-        procio->start();
-        // We need to block here, but events still need to be handled. The most
-        // effective way to do this is to enter the event loop recursively,
-        // even though it is not recommended by Qt.
-        QApplication::eventLoop()->enterLoop();
-        // This will be reached only after exitLoop() is called.
-        delete procio;
-        procio=static_cast<KProcIO *>(NULL);
-        if (errorsCompilingFlag || stopCompilingFlag) return;
-      }
       QDir qdir;
       const int numTargets=3;
       bool targeted[numTargets]={ti89_targeted,ti92p_targeted,v200_targeted};
@@ -4163,7 +4128,7 @@ void MainForm::linkProject()
       for (int target=0; target<numTargets; target++) {
         if (targeted[numTargets]) {
           qdir.remove(projectBaseName+"-data"+dexts[target]);
-          if (!qdir.rename(projectBaseName+dexts[target],
+          if (!qdir.rename(linkOutput+dexts[target],
                            projectBaseName+"-data"+dexts[target])) {
             new ErrorListItem(this,etError,QString::null,QString::null,
                               "Failed to rename data file.",

+ 3 - 1
ktigcc/tpr.cpp

@@ -1369,7 +1369,9 @@ QStringList process_settings(const QString &prjNameUnicode,
     args.append("--merge-constants");
   }
 
-  if (settings.outputbin || settings.pack) {
+  if (settings.pack) {
+    args.append("--outputbin-main-only");
+  } else if (settings.outputbin) {
     args.append("--outputbin");
   }