Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Compilation with SDCC fails on winxp

(1/2) > >>

squalyl:
Hi,

here's an annoying bug: When compiling a static library with SDCC, the whole IDE crashes.

The report file .rpt shows that it's a NULL read in compiler.dll: http://www.mirari.fr/vAxK

- What is the problem?
CodeBlocks crashes, either in the 8.02 release or in the latest svn nightly (21 june)

- What did you do to when it happened?
Compiled a static lib containing a few C source files

- Can you reproduce it? How?
install codeblocks as usual
install SDCC-win32-2.9.0-setup.exe from sourceforge
create a "static lib project" with the SDCC compiler. The wizard complains about compiler settings, discard.
No need to add new files, the crash is there with the default file.
run "rebuild"
*crash*

- What release of Code::Blocks are you using?
both release 8.02 and 21 june nightly showed the problem

- Which was the latest release that did not have this problem?
no idea :)

Any clue?

I noticed that in the advanced compiler settings, the macro for compiling static libraries was empty.
I tried to fill it, to add what it should be, ie " $lib_linker $static_output $link_objects "
When closing dialogs with OK, then reopening the advanced settings, the macro has gone.
I suspect a bad textbox reading, then the command to execute is not defined and calling it results in null pointer dereference.
But I don't know C::B internals so someone with this knownledge may be faster than me to detect the problem.

Thanks in advance.
Sebastien

stahta01:
SDCC Compiler most likely is not compatible with the Static Lib Template; It crashed on my also.
Will see if I can find cause; but, might not be worth it.

An Line of code in file src\plugins\compilergcc\compilerSDCC.cpp is commented out; it defines ctLinkStaticCmd which is needed in the code that crashes (src/plugins/compilergcc/directcommands.cpp:575). Removing comment and seeing what breaks with the old code.

Tim S

stahta01:
Patch that appears to fix the problem, but should be tested by an more regular SDCC user. It looks like it is working using the sdcclib -m (option -m lists modules in library).
Tim S


--- Code: ---Index: src/plugins/compilergcc/compilerSDCC.cpp
===================================================================
--- src/plugins/compilergcc/compilerSDCC.cpp (revision 5679)
+++ src/plugins/compilergcc/compilerSDCC.cpp (working copy)
@@ -138,7 +138,7 @@
     m_Commands[(int)ctGenDependenciesCmd].push_back(CompilerTool(_T("$compiler -MM $options -MF $dep_object -MT $object $includes $file")));
     m_Commands[(int)ctLinkExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $options $link_options $libs $link_objects")));
     m_Commands[(int)ctLinkConsoleExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $options $link_options $libs $link_objects")));
-    //m_Commands[(int)ctLinkStaticCmd].push_back(CompilerTool(_T("$lib_linker -r $static_output $link_objects\n\tranlib $exe_output")));
+    m_Commands[(int)ctLinkStaticCmd].push_back(CompilerTool(_T("$lib_linker -r $static_output $link_objects")));
     m_Commands[(int)ctLinkNativeCmd] = m_Commands[(int)ctLinkConsoleExeCmd]; // unsupported currently
 
     LoadDefaultRegExArray();

--- End code ---

squalyl:
Hi,

I will test today with my project that builds a binary with dependencies on 3 different static libs.

Keeping you up to date.

Hey, HUGE thanks Tim, That's really nice to see so strong support! C::B is definitely the only IDE I need (along with netbeans :) )

squalyl:
Well, I tried to recompile CB from SVN sources, and while the program builds, it does not run. All I get is a splash screen, then a windows crash message, and nothing more, not even a crash report.

I have mingw with gcc 3.4.5, I recompiled wxmsw 2.8.4.

The share/ folder was empty except the plugins subdirectory. This makes CB complains of missing resources, thus the crash comes after this check, if that helps.
I copied the share/subdirectory (except plugins) from my 8.02 release.

Do I have to use a gcc 4 series? not sure.
Do I have to recompile contrib plugins? I think not.

PS: Also tried to replace the 8.02 compiler.dll with the just compiled version (no patch applied yet) but it does not work :(

Any help ? I feel lame :(

Navigation

[0] Message Index

[#] Next page

Go to full version