Author Topic: BUG : Compiler Fight  (Read 8703 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
BUG : Compiler Fight
« on: February 02, 2006, 11:56:53 am »
It seems that different compilers influence one another in CB.

Using the following setup :
1) MingW GCC (3.4.4)
2) MsVC ToolKit 2003
3) Digital Mars

Attached is a project that creates a simple library, just one stupid file in it.
When you remove Digital Mars target, you can build both the default (with gnu compiler) and the MsVC (with M$ compiler) targets. No problem at all. Rebuild through all targets, or each target independently, everything is ok.

The moment you add the dm target (using digital mars), the M$ VC is broken. It seems that Digital Mars settings already have been applied, though it's not Dm's turn yet.

This is the error output during the M$VC target being build :
Quote
-------------- Build: MsVc in Lib1 ---------------
sample.cpp
Linking static library: MsVc\libLib1.a
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
   
OPTLINK : Warning 9: Unknown Option : LIB
OPTLINK : Warning 9: Unknown Option : LIBPATH
OPTLINK : Warning 9: Unknown Option : OUT
:C:\Program Files\Microsoft Visual C.obj
 Error 2: File Not Found :C:\Program Files\Microsoft Visual C.obj
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 

for some reason the Digital Mars programs are running 'or found or mounted or ..' when it should be the M$ programs. Could it be the paths ?? My normal PATH only contains C:\Ming\bin and none of the others. Off course CB adds some, maybe to many too early ??


Lieven

PS : there's seems to be also a problem with the linking step of digital mars, will look into that later.

[attachment deleted by admin]
« Last Edit: February 02, 2006, 11:59:52 am by killerbot »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: BUG : Compiler Fight
« Reply #1 on: February 02, 2006, 12:26:31 pm »
The second problem, for the digital mars is because the command is incorrect.

For example we have here :
lib Dm\libLib1.a Dm\src\sample.obj

this should be :
lib -c Dm\libLib1.a Dm\src\sample.obj

In the advanced option for the compiler we see :
Link object files to static library :
$lib_linker $link_options $static_output $link_objects

So either that -c should be added here (but then in the Cb source code), or it should be part of $link_options (also in Cb source ;-) )

As a work around the user could do these changes himself in the compiler settings.





Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: BUG : Compiler Fight
« Reply #2 on: February 02, 2006, 12:31:36 pm »
OK, it's not serious :)
The compiler paths are set all in one go, when they should be set just before a target is built.
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: BUG : Compiler Fight
« Reply #3 on: February 02, 2006, 12:31:39 pm »
Well, even a minor third issue :

I also found an inconsistency. In the cbp file it is said for example that M$VC should generate a lib with the .a extension, the output in the message pane is talking about that .a, but in reality a .lib is created, since the advanced compiler options specify that as the default extension for that compiler.
Which one should win, the one from the project, the one from the compiler, and certainly if it's the one or the other, the reporting then should also use the winner.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: BUG : Compiler Fight
« Reply #4 on: February 02, 2006, 12:59:34 pm »
Fixed in revision 1920.
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: BUG : Compiler Fight
« Reply #5 on: February 02, 2006, 02:43:59 pm »
builded and tested --> works

@Yiannis, can you also adjust the following so the static libs build with Digital Mars :
compilerDMC.cpp

    m_Commands[(int)ctLinkStaticCmd] = _T("$lib_linker $link_options $static_output $link_objects");
into
    m_Commands[(int)ctLinkStaticCmd] = _T("$lib_linker -c $link_options $static_output $link_objects");

NOTE : we have another issue, even when this has been adjusted, it does not work immediately, since the default.conf still has the old one stated and overrules the code !!!!!! Very dangerous !!!

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: BUG : Compiler Fight
« Reply #6 on: February 02, 2006, 02:50:34 pm »
and just discovered another thing, you can use the atteched project from the start of the topic.

Althoug the active project is not stored in the cbp file anymore, CB still thinks the cbp has changed when you switch targets.

Open cb, open the lib1.cbp, change the target (for example thourh the toolbar), close CV --> wants to save yes/no changes. But no changes made.

[EDIT] It's patch day again, yipeeeeeeeeeeeee  :lol:

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: BUG : Compiler Fight
« Reply #7 on: February 02, 2006, 03:18:18 pm »
Quote
@Yiannis, can you also adjust the following so the static libs build with Digital Mars :
compilerDMC.cpp

    m_Commands[(int)ctLinkStaticCmd] = _T("$lib_linker $link_options $static_output $link_objects");
into
    m_Commands[(int)ctLinkStaticCmd] = _T("$lib_linker -c $link_options $static_output $link_objects");

Fixed in revision 1932.
Be patient!
This bug will be fixed soon...

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: BUG : Compiler Fight
« Reply #8 on: February 02, 2006, 03:24:09 pm »
Fixed in revision 1932.

Very fast work, indeed. I have just finished to build rev1920...around 30 minutes of building time..... :D

Michael

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: BUG : Compiler Fight
« Reply #9 on: February 02, 2006, 03:26:48 pm »
same here, one build finished, do svn update, can start all over again.

Maybe we can create a new project Code::Blocks Builder. A nice litlle program that in an endless loop, connects to sv, update, rebuild CB, back to the beginning of the loop.
version 2 of this program, will be optimized, in case no new stuff from svn, you will be able to choose from
 - play minesweeper
 - read CB forum
 - use CB   ;-)