Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTBFS with GCC 13 #1558

Closed
marxin opened this issue Jul 1, 2022 · 4 comments
Closed

FTBFS with GCC 13 #1558

marxin opened this issue Jul 1, 2022 · 4 comments

Comments

@marxin
Copy link

marxin commented Jul 1, 2022

Fails with:

[   78s] cd /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/build/libdnf && /usr/bin/c++ -DLIBDNF_UNSTABLE_API -D_FILE_OFFSET_BITS=64 -Dlibdnf_EXPORTS -I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/json-c -I/usr/include/libxml2 -I/home/abuild/rpmbuild/BUILD/libdnf-0.67.0 -I/home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/utils -I/home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/transaction -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -DWITH_ZCHUNK -std=c++11 -Wmissing-declarations -O2 -g -DNDEBUG -fPIC   -DPACKAGE_VERSION=\"0.67.0\" -DGETTEXT_DOMAIN=\"libdnf\" -DG_LOG_DOMAIN=\"libdnf\" -DTESTDATADIR=\"/home/abuild/rpmbuild/BUILD/libdnf-0.67.0/data/tests\" -Wcast-align -Wno-uninitialized -Wredundant-decls -Wwrite-strings -Wformat-nonliteral -Wmissing-format-attribute -Wsign-compare -Wtype-limits -Wuninitialized -Wall -Wl,--as-needed -MD -MT libdnf/CMakeFiles/libdnf.dir/dnf-advisoryref.cpp.o -MF CMakeFiles/libdnf.dir/dnf-advisoryref.cpp.o.d -o CMakeFiles/libdnf.dir/dnf-advisoryref.cpp.o -c /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/dnf-advisoryref.cpp
[   78s] In file included from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/sack/../transaction/Swdb.hpp:38,
[   78s]                  from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/sack/query.hpp:32,
[   78s]                  from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/dnf-sack-private.hpp:31,
[   78s]                  from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/dnf-advisoryref.cpp:40:
[   78s] /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/sack/../transaction/../utils/sqlite3/Sqlite3.hpp:100:33: error: 'std::int64_t' has not been declared
[   78s]   100 |         void bind(int pos, std::int64_t val)
[   78s]       |                                 ^~~~~~~
[   78s] /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/sack/../transaction/../utils/sqlite3/Sqlite3.hpp:100:14: error: 'void SQLite3::Statement::bind(int, int)' cannot be overloaded with 'void SQLite3::Statement::bind(int, int)'
[   78s]   100 |         void bind(int pos, std::int64_t val)
[   78s]       |              ^~~~
[   78s] /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/sack/../transaction/../utils/sqlite3/Sqlite3.hpp:93:14: note: previous declaration 'void SQLite3::Statement::bind(int, int)'
[   78s]    93 |         void bind(int pos, int val)
[   78s]       |              ^~~~
[   78s] /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/sack/../transaction/../utils/sqlite3/Sqlite3.hpp:107:33: error: 'std::uint32_t' has not been declared
[   78s]   107 |         void bind(int pos, std::uint32_t val)
[   78s]       |                                 ^~~~~~~~
[   78s] /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/sack/../transaction/../utils/sqlite3/Sqlite3.hpp:107:14: error: 'void SQLite3::Statement::bind(int, int)' cannot be overloaded with 'void SQLite3::Statement::bind(int, int)'
[   78s]   107 |         void bind(int pos, std::uint32_t val)
[   78s]       |              ^~~~
[   78s] /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/sack/../transaction/../utils/sqlite3/Sqlite3.hpp:93:14: note: previous declaration 'void SQLite3::Statement::bind(int, int)'
[   78s]    93 |         void bind(int pos, int val)
[   78s]       |              ^~~~
[   78s] In file included from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/repo/../conf/ConfigMain.hpp:29,
[   78s]                  from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/repo/../conf/ConfigRepo.hpp:26,
[   78s]                  from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/repo/Repo.hpp:26,
[   78s]                  from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/repo/Repo-private.hpp:24,
[   78s]                  from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/hy-repo-private.hpp:24,
[   78s]                  from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/repo/solvable/Package.hpp:10,
[   78s]                  from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/module/ModulePackage.hpp:30,
[   78s]                  from /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/dnf-sack-private.hpp:32:
[   78s] /home/abuild/rpmbuild/BUILD/libdnf-0.67.0/libdnf/repo/../conf/OptionNumber.hpp:94:41: error: 'int32_t' is not a member of 'std'; did you mean 'int32_t'?
[   78s]    94 | extern template class OptionNumber<std::int32_t>;
[   78s]       |                                         ^~~~~~~

due to:
https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes

@m-blaha m-blaha added dnf5 and removed dnf5 labels Jul 4, 2022
ctxnop added a commit to ctxnop/libdnf that referenced this issue May 15, 2023
With last versions of gcc, some headers don't include cstdint anymore,
but some sources assume that it is.

Signed-off-by: ctxnop <[email protected]>
@ctxnop
Copy link
Contributor

ctxnop commented May 15, 2023

This issue makes my yocto builds to fails on systems with gcc-13. I fixed only the ones requires by my yocto builds, there is probably more.

@ctxnop
Copy link
Contributor

ctxnop commented May 16, 2023

The PR to fix this: #1602

@MamaTierra
Copy link

MamaTierra commented Jun 26, 2023

This issue makes my yocto builds to fails on systems with gcc-13. I fixed only the ones requires by my yocto builds, there is probably more.

Hi @ctxnop, i'm experiencing the same problem in a yocto build. Care to explain how you fixed it ?

I tried to force the GCC version with adding GCCVERSION = "11.%" in local.conf file but it does not seem to change anything...

Also tried to add your PR as patch in my custom layer with this config:

[meta-mylayer]$ tree recipe-devtools/
recipe-devtools/
└── libdnf
    ├── libdnf
    │   └── pr-1602.patch
    └── libdnf_%.bbappend

3 directories, 2 files
[meta-mylayer]$ cat recipe-devtools/libdnf/libdnf_%.bbappend 
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = "file://pr-16023.patch"

But the patch does not seem to be applied ...

@ctxnop
Copy link
Contributor

ctxnop commented Jun 27, 2023

Depending on the version of libdnf you have my patch may not be enough. I experienced the issue with the kirkstone version and the uninative feature disabled. I was experimenting something, using the official release with uninative should prevent the issue.

Use the bitbake -c devshell and try to compile with it. Then follow the errors: when it complains about std::uint8_t or something not being defined in foo.cpp, just open the said file and add a #include <cstdint> near the top. Once you successfully compile, use git to generate the patch to apply.

yashi added a commit to spacecubics/scsat1-rpi that referenced this issue Jul 13, 2023
Add template files for local.conf and bblayers.conf.  With these
files, we can now do:

    $ git clone https://github.com/spacecubics/scsat1-rpi
    $ cd scsat1-rpi/zero
    $ git clone -b kirkstone git://git.yoctoproject.org/meta-raspberrypi
    $ git clone -b kirkstone git://git.yoctoproject.org/poky
    $ TEMPLATECONF=$(readlink -f ./meta-scsat-rpi/conf) source ./poky/oe-init-build-env
    $ bitbake core-image-minimal

    Loading cache: 100% |                                                 | ETA:  --:--:--
    Loaded 0 entries from dependency cache.
    Parsing recipes: 100% |###############################################| Time: 0:00:04
    Parsing of 913 .bb files complete (0 cached, 913 parsed). 1675 targets, 96 skipped, 0 masked, 0 errors.
    NOTE: Resolving any missing task queue dependencies

    Build Configuration:
    BB_VERSION           = "2.0.0"
    BUILD_SYS            = "x86_64-linux"
    NATIVELSBSTRING      = "debian"
    TARGET_SYS           = "arm-oe-linux-gnueabi"
    MACHINE              = "raspberrypi0-wifi"
    DISTRO               = "nodistro"
    DISTRO_VERSION       = "nodistro.0"
    TUNE_FEATURES        = "arm thumb vfp arm1176jzfs callconvention-hard"
    TARGET_FPU           = "hard"
    meta                 = "kirkstone:471318ae2f6b3c142822001f4a18e2fed8c78f1a"
    meta-raspberrypi     = "kirkstone:43683cb14b6afc144619335b3a2353b70762ff3e"

    Initialising tasks: 100% |############################################| Time: 0:00:00
    Sstate summary: Wanted 721 Local 0 Mirrors 0 Missed 721 Current 0 (0% match, 0% complete)
    NOTE: Executing Tasks
    NOTE: Tasks Summary: Attempted 2005 tasks of which 0 didn't need to be rerun and all succeeded.

Note that currently this only works with G++ 12.  Debian Sid already
have G++ 13 and libdns FTBFS.

rpm-software-management/libdnf#1558

Signed-off-by: Yasushi SHOJI <[email protected]>
yashi added a commit to spacecubics/scsat1-rpi that referenced this issue Jul 13, 2023
Add template files for local.conf and bblayers.conf.  With these
files, we can now do:

    $ git clone https://github.com/spacecubics/scsat1-rpi
    $ cd scsat1-rpi/zero
    $ git clone -b kirkstone git://git.yoctoproject.org/meta-raspberrypi
    $ git clone -b kirkstone git://git.yoctoproject.org/poky
    $ TEMPLATECONF=$(readlink -f ./meta-scsat-rpi/conf) source ./poky/oe-init-build-env
    $ bitbake core-image-minimal

    Loading cache: 100% |                                                 | ETA:  --:--:--
    Loaded 0 entries from dependency cache.
    Parsing recipes: 100% |###############################################| Time: 0:00:04
    Parsing of 913 .bb files complete (0 cached, 913 parsed). 1675 targets, 96 skipped, 0 masked, 0 errors.
    NOTE: Resolving any missing task queue dependencies

    Build Configuration:
    BB_VERSION           = "2.0.0"
    BUILD_SYS            = "x86_64-linux"
    NATIVELSBSTRING      = "debian"
    TARGET_SYS           = "arm-oe-linux-gnueabi"
    MACHINE              = "raspberrypi0-wifi"
    DISTRO               = "nodistro"
    DISTRO_VERSION       = "nodistro.0"
    TUNE_FEATURES        = "arm thumb vfp arm1176jzfs callconvention-hard"
    TARGET_FPU           = "hard"
    meta                 = "kirkstone:471318ae2f6b3c142822001f4a18e2fed8c78f1a"
    meta-raspberrypi     = "kirkstone:43683cb14b6afc144619335b3a2353b70762ff3e"

    Initialising tasks: 100% |############################################| Time: 0:00:00
    Sstate summary: Wanted 721 Local 0 Mirrors 0 Missed 721 Current 0 (0% match, 0% complete)
    NOTE: Executing Tasks
    NOTE: Tasks Summary: Attempted 2005 tasks of which 0 didn't need to be rerun and all succeeded.

Note that currently this only works with G++ 12.  Debian Sid already
have G++ 13 and libdns FTBFS.

rpm-software-management/libdnf#1558

Signed-off-by: Yasushi SHOJI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants