Bug 417679 - kdevelop-pg-qt fails to build on s390x in Ubuntu 20.04 Focal
Summary: kdevelop-pg-qt fails to build on s390x in Ubuntu 20.04 Focal
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR major
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-14 23:40 UTC by Rik Mills
Modified: 2020-03-02 23:49 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rik Mills 2020-02-14 23:40:20 UTC
Build OK on amd64, arm64, armhf, ppc64el, but fails on s390x with the output below:

Upload: https://launchpad.net/ubuntu/+source/kdevelop-pg-qt/2.2.1-1

Failing build: https://launchpad.net/ubuntu/+source/kdevelop-pg-qt/2.2.1-1/+build/18652754

-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1

This failure will prevent kdevelop-pg-qt 2.2.1 being accepted into 20.04

https://people.canonical.com/~ubuntu-archive/proposed-migration/update_excuses.html#kdevelop-pg-qt

**** output ****

[100%] Linking CXX executable kdev-pg-qt
cd /<<PKGBUILDDIR>>/obj-s390x-linux-gnu/kdev-pg && /usr/bin/cmake -E cmake_link_script CMakeFiles/kdev-pg-qt.dir/link.txt --verbose=1
/usr/bin/c++  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fno-operator-names -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -Wno-missing-field-initializers -Wno-unused-local-typedefs -fexceptions  -Wl,--enable-new-dtags -Wl,-Bsymbolic-functions -Wl,-z,relro -rdynamic CMakeFiles/kdev-pg-qt.dir/kdev-pg-qt_autogen/mocs_compilation.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-parser.cc.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-lexer.cc.o CMakeFiles/kdev-pg-qt.dir/ASBeautifier.cpp.o CMakeFiles/kdev-pg-qt.dir/ASFormatter.cpp.o CMakeFiles/kdev-pg-qt.dir/ASResource.cpp.o CMakeFiles/kdev-pg-qt.dir/ASEnhancer.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-visitor.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-default-visitor.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-pretty-printer.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-global.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-code-gen.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-ast-gen.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-visitor-gen.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-visitor-bits-gen.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-default-visitor-gen.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-default-visitor-bits-gen.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-serialize-visitor-gen.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-debug-visitor-gen.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-new-visitor-gen.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-new-visitor-bits-gen.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-token-type-gen.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-beautifier.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-checker.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-inline-checker.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-main.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-generate.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-first.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-follow.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-bnf-visitor.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-clone-tree.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-regexp.cpp.o CMakeFiles/kdev-pg-qt.dir/kdev-pg-unicode-loader.cpp.o CMakeFiles/kdev-pg-qt.dir/qrc_unidata.cpp.o  -o kdev-pg-qt  /usr/lib/s390x-linux-gnu/libQt5Core.so.5.12.5 
/usr/bin/ld: CMakeFiles/kdev-pg-qt.dir/kdev-pg-ast-gen.cpp.o: in function `KDevPG::GenerateAstRule::visitVariableDeclaration(KDevPG::Model::VariableDeclarationItem*)':
./obj-s390x-linux-gnu/kdev-pg/./kdev-pg/kdev-pg-ast-gen.cpp:210: undefined reference to `KDevPG::GenerateVariableDeclaration<true, true>::operator()(KDevPG::Model::VariableDeclarationItem*)'
collect2: error: ld returned 1 exit status

-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
Comment 1 Aaron Puchert 2020-02-15 00:55:56 UTC
Looks valid to me. The template is only declared in kdev-pg/kdev-pg-code-gen.h, while the definition is in kdev-pg/kdev-pg-code-gen.cpp. When the template is referenced from kdev-pg/kdev-pg-ast-gen.cpp, the definition isn't available, so the compiler can't instantiate the template.

The solution would be to move the template to the header file or instantiate all necessary variants explicitly [1]. By the way, Clang can warn about situations like that with -Wundefined-func-template.

[1] https://en.cppreference.com/w/cpp/language/function_template#Explicit_instantiation
Comment 2 Rik Mills 2020-03-01 16:05:12 UTC
Still failing. If there is no fix by time of Ubuntu beta freeze, I may have to ask as precaution ask for 2.2.1 to be removed. :(
Comment 3 Milian Wolff 2020-03-02 21:58:15 UTC
Git commit 0f830b2abc7763f6598f7f1a84f5af403d402a02 by Milian Wolff.
Committed on 02/03/2020 at 21:58.
Pushed by mwolff into branch '2.2'.

Fix linking on s390x

Ensure all symbols are available and don't hide the template
instantiation.

M  +23   -24   kdev-pg/kdev-pg-code-gen.cpp
M  +13   -1    kdev-pg/kdev-pg-code-gen.h

https://commits.kde.org/kdevelop-pg-qt/0f830b2abc7763f6598f7f1a84f5af403d402a02
Comment 4 Milian Wolff 2020-03-02 21:58:50 UTC
I've pushed a fix to the 2.2 branch and master, can you try that please? if it fixes the issue, then we can create a 2.2.2 release
Comment 5 Rik Mills 2020-03-02 23:49:58 UTC
(In reply to Milian Wolff from comment #4)
> I've pushed a fix to the 2.2 branch and master, can you try that please? if
> it fixes the issue, then we can create a 2.2.2 release

Yes, that fixes the build. :)

Thank you!