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)

patch-src-sdk-wxscintilla-src-PlatWX.cpp.diff (817 bytes) - added by mojca (Mojca Miklavec) 11 years ago.
patch-src-plugins-contrib-profiler-cbprofiler.cpp.diff (1.1 KB) - added by mojca (Mojca Miklavec) 11 years ago.
patch-src-plugins-contrib-lib_finder-librariesdlg.cpp.diff (1.0 KB) - added by mojca (Mojca Miklavec) 11 years ago.

Download all attachments as: .zip

Change History (12)

Changed 11 years ago by mojca (Mojca Miklavec)

comment:1 Changed 11 years ago by mojca (Mojca Miklavec)

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.

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.

comment:4 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

Changed 11 years ago by mojca (Mojca Miklavec)

Changed 11 years ago by mojca (Mojca Miklavec)

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:

The following patches haven't been reported/submitted yet:

  • patch-Makefile.diff - I don't know what it does and why it is needed
  • patch-sdk-configmanager.cpp - I don't know what it does and why it is needed
  • patch-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)

Fixed in r110757, r110758, but I would like to leave this ticket open until all the patches are at least reported upstream (even if not fixed yet). I would like to ask for some help with that (in particular with understanding the patches).

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: newclosed

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.

Note: See TracTickets for help on using tickets.