4

I'm trying to submit a deb to my PPA according to this manual:
https://packaging.ubuntu.com/html/packaging-new-software.html
I'm able to build my app with bzr builddeb -- -nc -us -uc and to sign it with bzr builddeb -S. But execution of pbuilder-dist groovy build myproject_0.2.8-1.dsc in ../build-area fails.
Full log is available in pastebin: https://pastebin.com/whr6Qsd1

I believe that the problem is in following piece:

Determining if the CXX compiler accepts the flag -fno-keep-inline-dllexport failed with the following output:
Change Dir: /build/myapp-0.2.8/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_3ab02/fast && gmake[1]: Entering directory '/build/myapp-0.2.8/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp' /usr/bin/gmake -f CMakeFiles/cmTC_3ab02.dir/build.make CMakeFiles/cmTC_3ab02.dir/build gmake[2]: Entering directory '/build/myapp-0.2.8/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_3ab02.dir/DummyCXXFile.cxx.o /usr/bin/c++ -std=c++0x -fno-keep-inline-dllexport -o CMakeFiles/cmTC_3ab02.dir/DummyCXXFile.cxx.o -c /usr/share/cmake-3.16/Modules/DummyCXXFile.cxx c++: error: command-line option '-fno-keep-inline-dllexport' is not supported by this configuration gmake[2]: *** [CMakeFiles/cmTC_3ab02.dir/build.make:66: CMakeFiles/cmTC_3ab02.dir/DummyCXXFile.cxx.o] Error 1 gmake[2]: Leaving directory '/build/myapp-0.2.8/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp' gmake[1]: *** [Makefile:121: cmTC_3ab02/fast] Error 2 gmake[1]: Leaving directory '/build/myapp-0.2.8/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp'

dh_auto_configure: error: cd obj-x86_64-linux-gnu && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu .. returned exit code 1 make: *** [debian/rules:6: binary] Error 25 dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

So, cmake is checking that /usr/c++ supports -fno-keep-inline-dllexport. Compiller ends with 1 bcs it doesn't support it, cmake returns 2 and dh_auto_configure painics.

If I execute cmake on my system I'm getting following stdout:

-- Checking to see if CXX compiler accepts flag -ffunction-sections -fdata-sections -Wl,--gc-sections
-- Checking to see if CXX compiler accepts flag -ffunction-sections -fdata-sections -Wl,--gc-sections - yes
-- Checking to see if CXX compiler accepts flag -fno-keep-inline-dllexport
-- Checking to see if CXX compiler accepts flag -fno-keep-inline-dllexport - no
-- Checking to see if CXX compiler accepts flag -Werror=return-type
-- Checking to see if CXX compiler accepts flag -Werror=return-type - yes

So even compiller on my system doesn't support -fno-keep-inline-dllexport. And I'm fine with that. It doesn't matter for me. cmake not fails.

It looks that the failed check of non-mandatory feature by cmake ruins whole pbuilder-dist process. Are there any way to change this behaviour or i'm missing something?

P.s. My build-depends are: debhelper-compat (= 13), cmake (>=2.8.9), gcc (>=4.6), qt5-qmake (>= 5.4), qtbase5-dev (>= 5.4), libtiff5-dev (>= 4.0.3), libjpeg8-dev (>= 8c), libpng-dev (>=1.6.2)

truf
  • 231

1 Answers1

2

I am not certain about the exact issue prompted by you configuration. But two possible solutions are

  1. Changing -std=c++0x to -std=c++11.
  2. Remove option -fno-keep-inline-dllexport.

Please check your configuration files, where to modify this.

Prior to this, you can check if any of these options would work. Go to the parent directory of CMakeFiles and try replicating the failed command at the command line, with the suggested modifications:

  1. /usr/bin/c++ -std=c++11 -fno-keep-inline-dllexport -o CMakeFiles/cmTC_3ab02.dir/DummyCXXFile.cxx.o -c /usr/share/cmake-3.16/Modules/DummyCXXFile.cxx
  2. /usr/bin/c++ -std=c++0x -o CMakeFiles/cmTC_3ab02.dir/DummyCXXFile.cxx.o -c /usr/share/cmake-3.16/Modules/DummyCXXFile.cxx

For this to work, you would likely need to call first cmake --debug-trycompile (source).

Notes about your pastebin (messages worth noting, even though not necessarily problems) and procedure:

  1. You have tons of ln: failed to create hard link '...' => '...': Invalid cross-device link messages.
  2. There is a problem reported with Qt5LinguistTools. Perhaps it is worth installing qttools5-dev prior to what you did.
  3. It reports Configuring incomplete, errors occurred!. It is worth checking what are possible sources of problems.
  4. It helps a lot if you specify the exact list of commands you issued, including the directory where each command was issued.
  5. What do you mean by "If I execute cmake on my system..."? Same as point above.

Related:

https://stackoverflow.com/questions/19523412/qt-config-c11-but-std-c0x

https://code-examples.net/en/q/129e754

  • doesn't help. 2. works. Indeed I found the code in one of subfolders that sets default GCC flags using CHECK_CXX_ACCEPTS_FLAG(). This module is deprecated, but updating TestCXXAcceptsFlag to CheckCXXCompilerFlag and CHECK_CXX_COMPILER_FLAG() changed nothing. So I just excluded a check for -fno-keep-inline-dllexport support. Still I believe this is a bug, but seems not to be a pbuilder-dist problem. It's a dh_auto_configure problem.
  • – truf Nov 13 '20 at 04:58
  • Btw, I managed to google out an alternative but bad solution here. They suppressed compiler error by passing -g option. If one make a /tmp/1.cxx with single line int main() { return 0; } he'll be able to reproduce the error with /usr/bin/c++ -fno-keep-inline-dllexport -o 1.o -c 1.cxx. But specifying -g option suppresses it. Looks like compiler just ignores -f optimization and don't parse params. But that's obviously bad workaround as it leads to false positive compiler capabilities detection. – truf Nov 13 '20 at 05:03
  • @truf - Intriguing, at best... PS: It's good to have feedback. – sancho.s ReinstateMonicaCellio Nov 13 '20 at 09:41