Opened 11 years ago
Closed 11 years ago
#40386 closed defect (fixed)
codeblocks: allow compilation with clang
Reported by: | mojca (Mojca Miklavec) | Owned by: | mojca (Mojca Miklavec) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | cooljeanius (Eric Gallager) | |
Port: | codeblocks |
Description
I opened this ticket to collect issues related to compile errors with clang in Code::Blocks.
The goal is to find patches to allow compilation and to submit them upstream.
Attachments (3)
Change History (12)
Changed 11 years ago by mojca (Mojca Miklavec)
Attachment: | patch-src-sdk-wxscintilla-src-PlatWX.cpp.diff added |
---|
comment:1 Changed 11 years ago by mojca (Mojca Miklavec)
comment:2 Changed 11 years ago by mojca (Mojca Miklavec)
Next compile error is:
/bin/sh ../../../../libtool --tag=CXX --mode=compile /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I../../../../src/include -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8/lib/wx/include/gtk2-unicode-release-2.8 -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -I../../../../src/include -I../../../../src/sdk/wxscintilla/include -I./../wxContribItems/wxFlatNotebook/include -I../../../../src/include/scripting/include -I../../../../src/include/scripting/sqplus -I../../../../src/include/scripting/squirrel -I../../../../src/include/scripting/bindings -I../../../../src/include/mozilla_chardet -I/opt/local/include -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -pipe -Os -arch x86_64 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT projectmissinglibs.lo -MD -MP -MF .deps/projectmissinglibs.Tpo -c -o projectmissinglibs.lo projectmissinglibs.cpp libtool: compile: /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I../../../../src/include -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8/lib/wx/include/gtk2-unicode-release-2.8 -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -I../../../../src/include -I../../../../src/sdk/wxscintilla/include -I./../wxContribItems/wxFlatNotebook/include -I../../../../src/include/scripting/include -I../../../../src/include/scripting/sqplus -I../../../../src/include/scripting/squirrel -I../../../../src/include/scripting/bindings -I../../../../src/include/mozilla_chardet -I/opt/local/include -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -pipe -Os -arch x86_64 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT projectmissinglibs.lo -MD -MP -MF .deps/projectmissinglibs.Tpo -c projectmissinglibs.cpp -fno-common -DPIC -o .libs/projectmissinglibs.o librariesdlg.cpp:93:7: error: array initializer must be an initializer list , m_WorkingCopy(knownLibraries) ^ 1 error generated.
I'm not sure how to fix that one, but a quick workaround is to disable the libfinder
plugin.
configure.args "--with-contrib-plugins=all,-FileManager,-libfinder"
In case that anyone has any idea, here are some possibly relevant blocks from the code:
enum LibraryResultType { rtDetected = 0, ///< \brief Cnofiguration detected by lib_finder rtPredefined, ///< \brief Predefined configuration rtPkgConfig, ///< \brief Library provided by pkg-config /////// rtCount, ///< \brief Here will be the number of result types rtUnknown = -1 ///< \brief Used for unknown result types }; class ResultMap { ... } typedef ResultMap TypedResults[rtCount]; class LibrariesDlg: public wxScrollingDialog { ... private: TypedResults& m_KnownLibraries; TypedResults m_WorkingCopy; ... } LibrariesDlg::LibrariesDlg(wxWindow* parent, TypedResults& knownLibraries) : m_KnownLibraries(knownLibraries) , m_WorkingCopy(knownLibraries) , m_SelectedConfig(0) , m_WhileUpdating(false) { ... }
comment:3 Changed 11 years ago by mojca (Mojca Miklavec)
Next error:
libtool: compile: /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I../../../../src/include -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8/lib/wx/include/gtk2-unicode-release-2.8 -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -I../../../../src/include -I../../../../src/sdk/wxscintilla/include -I/opt/local/include -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -pipe -Os -arch x86_64 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT cbprofilerconfig.lo -MD -MP -MF .deps/cbprofilerconfig.Tpo -c cbprofilerconfig.cpp -fno-common -DPIC -o .libs/cbprofilerconfig.o cbprofiler.cpp:104:25: error: variable length array of non-POD element type 'wxString' wxString choices[project->GetBuildTargetsCount()]; ^ 1 error generated. make[5]: *** [cbprofiler.lo] Error 1
most probably requires a similar patch as the first one.
Changed 11 years ago by mojca (Mojca Miklavec)
Attachment: | patch-src-plugins-contrib-profiler-cbprofiler.cpp.diff added |
---|
Changed 11 years ago by mojca (Mojca Miklavec)
Attachment: | patch-src-plugins-contrib-lib_finder-librariesdlg.cpp.diff added |
---|
comment:5 Changed 11 years ago by mojca (Mojca Miklavec)
I'm currently testing the patch for librariesdlg.cpp
which was sent to the mailing list earlier today, but excluding libfinder
led to a successful compilation after the other two patches have been applied.
comment:6 Changed 11 years ago by mojca (Mojca Miklavec)
Here's the list of upstream reports:
- avoid clang compilation error in profiler for
src/plugins/contrib/profiler/cbprofiler.cpp
- ld: unknown option: --no-undefined only a problem is SVN trunk
- m_WorkingCopy: array initializer must be an initializer list without the patch for
librariesdlg.cpp
- missing #include <string> in CallTip.h only a problem in SVN
- _rpl_malloc: Undefined symbols for architecture x86_64 only a problem in SVN
- MouseSap's Makefile isn't including GTK libs a patch for
src/plugins/contrib/MouseSap/Makefile.am
(maybe it should be moved to patches?) - source_exporter might need to link against fontconfig patch for
src/plugins/contrib/source_exporter/Makefile.am
The following patches haven't been reported/submitted yet:
patch-Makefile.diff
- I don't know what it does and why it is neededpatch-sdk-configmanager.cpp
- I don't know what it does and why it is neededpatch-src-plugins-contrib-lib_finder-librariesdlg.cpp.diff
- not tested yet, but reported (see above)
comment:7 Changed 11 years ago by mojca (Mojca Miklavec)
comment:8 Changed 11 years ago by mojca (Mojca Miklavec)
Owner: | changed from afb@… to mojca@… |
---|
comment:9 Changed 11 years ago by mojca (Mojca Miklavec)
Resolution: | → fixed |
---|---|
Status: | new → closed |
All patches but patch-Makefile.diff
have been reported upstream. I'm not sure when this issues will get fixed upstream, but I'm closing this ticket now.
The first patch (
patch-src-sdk-wxscintilla-src-PlatWX.cpp.diff
) comes from upstream (it's already included in SVN) and is needed to fix the first compile error.