Summary: | dev-perl/Wx-0.993.200-r3 fails to compile | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Attila Tóth <atoth> |
Component: | Current packages | Assignee: | Gentoo Perl team <perl> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ago, cook60020tmp, parona, r.wolf.gentoo |
Priority: | Normal | Keywords: | PATCH, PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/gentoo/gentoo/pull/38459 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 351559 | ||
Attachments: |
patch to force gcc compile .c files as c++
emerge --info build.log for failed compilation build.log for .c compiled as c++ build.log for -j1 environment for -j1 emerge --info for -j1 build.log for -j1 and patch environment for -j1 and patch emerge --info for -j1 and patch |
Description
Attila Tóth
2024-05-15 08:56:37 UTC
Full build.log please? Hello, the problem is, that Wx.c is compiled as "C" code, not as "C++" code. If the file would be named Wx.cpp, the gcc could compile it as C++. Gcc can be forced to compile as C++ using -x c++. ====================================================================== # x86_64-pc-linux-gnu-gcc -c -I. -I. -I/usr/lib64/wx/include/gtk3-unicode-3.2-gtk3 -I/usr/include/wx-3.2-gtk3 -O2 -pipe -fomit-frame-pointer -fno-strict-aliasing -DNO_PERL_RAND_SEED -fwrapv -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -pipe -fomit-frame-pointer -DVERSION=\"0.9932\" -DXS_VERSION=\"0.9932\" -fPIC "-I/usr/lib64/perl5/5.38/x86_64-linux/CORE" -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ Wx.c ; echo "GCC error code $?" ; ls -l Wx.o In file included from /usr/include/wx-3.2-gtk3/wx/strconv.h:17, from /usr/include/wx-3.2-gtk3/wx/strvararg.h:17, from /usr/include/wx-3.2-gtk3/wx/string.h:37, from /usr/include/wx-3.2-gtk3/wx/memory.h:15, from /usr/include/wx-3.2-gtk3/wx/object.h:19, from ./cpp/helpers.h:16, from cpp/wxapi.h:170, from Wx.c:32: /usr/include/wx-3.2-gtk3/wx/buffer.h:19:1: error: unknown type name ‘class’; did you mean ‘OPclass’? 19 | class WXDLLIMPEXP_FWD_BASE wxCStrData; | ^~~~~ | OPclass .... GCC error code 1 ls: cannot access 'Wx.o': No such file or directory ====================================================================== Using "-x c++" option compiles without error (only with warnings): ====================================================================== # x86_64-pc-linux-gnu-gcc -c -I. -I. -I/usr/lib64/wx/include/gtk3-unicode-3.2-gtk3 -I/usr/include/wx-3.2-gtk3 -O2 -pipe -fomit-frame-pointer -fno-strict-aliasing -DNO_PERL_RAND_SEED -fwrapv -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -pipe -fomit-frame-pointer -DVERSION=\"0.9932\" -DXS_VERSION=\"0.9932\" -fPIC "-I/usr/lib64/perl5/5.38/x86_64-linux/CORE" -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -x c++ Wx.c ; echo "GCC error code $?" ; ls -l Wx.o In file included from cpp/v_cback.h:782, from Wx.c:67: cpp/tipprovider.h: In member function ‘wxString wxPliTipProvider::PreprocessTip(const wxString&)’: ./cpp/v_cback_def.h:443:103: warning: ‘wxString wxTipProvider::PreprocessTip(const wxString&)’ is deprecated: this method does nothing, simply don't call it [-Wdeprecated-declarations] 443 | DEF_V_CBACK_ANY__WXSTRING_( wxString, wxPli_sv_2_wxString( aTHX_ ret ), CLASS, return BASE::METHOD(p1), METHOD, wxPli_NOCONST ) ./cpp/v_cback_def.h:204:13: note: in definition of macro ‘DEF_V_CBACK_ANY__WXSTRING_’ 204 | CALLBASE; \ | ^~~~~~~~ cpp/tipprovider.h:35:1: note: in expansion of macro ‘DEF_V_CBACK_WXSTRING__WXSTRING’ 35 | DEF_V_CBACK_WXSTRING__WXSTRING( wxPliTipProvider, wxTipProvider, PreprocessTip ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Wx.c:3928: /usr/include/wx-3.2-gtk3/wx/tipdlg.h:53:14: note: declared here 53 | wxString PreprocessTip(const wxString& tip) { return tip; } | ^~~~~~~~~~~~~ Wx.c: In function ‘void XS_Wx__TipProvider_PreprocessTip(CV*)’: Wx.c:5066:37: warning: ‘wxString wxTipProvider::PreprocessTip(const wxString&)’ is deprecated: this method does nothing, simply don't call it [-Wdeprecated-declarations] 5066 | RETVAL = THIS->PreprocessTip(tip); | ~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/wx-3.2-gtk3/wx/tipdlg.h:53:14: note: declared here 53 | wxString PreprocessTip(const wxString& tip) { return tip; } | ^~~~~~~~~~~~~ Wx.c: In function ‘void XS_Wx__Variant_GetList(CV*)’: Wx.c:20517:23: warning: ‘wxListBase::operator const wxList&() const’ is deprecated [-Wdeprecated-declarations] 20517 | wxPli_objlist_push( aTHX_ lst ); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ In file included from ./cpp/helpers.h:17, from cpp/wxapi.h:170, from Wx.c:32: /usr/include/wx-3.2-gtk3/wx/list.h:1208:8: note: declared here 1208 | inline wxListBase::operator const wxList&() const { return *static_cast<const wxList*>(this); } | ^~~~~~~~~~ GCC error code 0 -rw-r--r-- 1 root root 1331072 May 29 13:22 Wx.o ====================================================================== Could you somehow add the "-x c++" option? Thank you. Regards, Robert. Created attachment 894598 [details, diff]
patch to force gcc compile .c files as c++
with this ebuild patch I can successfully compile Wx
Maybe this ebuild patch is not correct solution, but the error is probably caused by gcc compiling .c files as C code instead of C++. I am not sure if the gcc should be forced to compile .c files as C++ or the files should be renamed to .cpp or somehow else gcc should be informed about compiling these files as C++.
Thank you.
Regards,
Robert.
Can you please include the build.log and emerge --info? I'd like to know why this works for me. Created attachment 894602 [details]
emerge --info
Created attachment 894603 [details]
build.log for failed compilation
Created attachment 894604 [details]
build.log for .c compiled as c++
Do you see any crucial difference? *** Bug 932260 has been marked as a duplicate of this bug. *** I wonder if it's a parallelism thing. Could you perhaps: 1) give me both logs with MAKEOPTS="-j1" 2) try https://sources.debian.org/patches/libwx-perl/1:0.9932-8/0001-fix-incomplete-Wx_Exp.pm-due-to-missing-dependecy-in.patch/? Created attachment 898683 [details]
build.log for -j1
Created attachment 898684 [details]
environment for -j1
Created attachment 898685 [details]
emerge --info for -j1
Created attachment 898686 [details]
build.log for -j1 and patch
Created attachment 898687 [details]
environment for -j1 and patch
Created attachment 898688 [details]
emerge --info for -j1 and patch
*** Bug 937547 has been marked as a duplicate of this bug. *** parona, mind looking? The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df72bb6d4a18a552c6ef7d989bf477e56bb1109f commit df72bb6d4a18a552c6ef7d989bf477e56bb1109f Author: Alfred Wingate <parona@protonmail.com> AuthorDate: 2024-09-05 16:50:59 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-09-05 19:32:48 +0000 dev-perl/Wx: export CC as CXX due to xspp expectations Previous eclass change modified behavior to explicitly set CC. This broke expectiations for xspp as Wx was setting CC to CXX in a weak way. https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a650e223a09b0616a4e619c73cc033478fb7a61 https://metacpan.org/release/MDOOTSON/Wx-0.9932/source/build/Wx/build/MakeMaker/Any_wx_config.pm#L27 Closes: https://bugs.gentoo.org/931939 Signed-off-by: Alfred Wingate <parona@protonmail.com> Signed-off-by: Sam James <sam@gentoo.org> dev-perl/Wx/Wx-0.993.200-r3.ebuild | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) |