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

Fix build of perl bindings without external _FORTIFY_SOURCE define #223

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

kontura
Copy link
Contributor

@kontura kontura commented Jan 10, 2023

Outside of fedora build infrastructure _FORTIFY_SOURCE is not defined but the perl bindings require it.

@pkratoch pkratoch self-assigned this Jan 10, 2023
Outside of fedora build infrastructure `_FORTIFY_SOURCE` is not defined
but the perl bindings require it.
We also have to handle different `_FORTIFY_SOURCE` definitions in
rawhide vs stable fedoras.
@jan-kolarik
Copy link
Member

LGTM

@pkratoch
Copy link
Contributor

Hm, locally in Fedora 36 container, I get "-D_FORTIFY_SOURCE defined but value is too low"...

@kontura
Copy link
Contributor Author

kontura commented Jan 10, 2023

Interesting it seems to work for me:

$ podman run -ti fedora:36
[root@bb6af645582c /]# dnf install git
[root@bb6af645582c /]# git clone https://github.com/kontura/dnf5
[root@bb6af645582c /]# cd dnf5/
[root@bb6af645582c dnf5]# git checkout perl
[root@bb6af645582c dnf5]# dnf install 'dnf-command(builddep)'
[root@bb6af645582c dnf5]# dnf builddep ./dnf5.spec 
[root@bb6af645582c dnf5]# mkdir build
[root@bb6af645582c dnf5]# cd build/
[root@bb6af645582c dnf5]# cmake ..
[root@bb6af645582c build]# make -j10

Did I do something differently?

@pkratoch
Copy link
Contributor

Ok, I am sorry, I used an old dbox and I can't reproduce it elsewhere. Otherwise it looks good, so I am merging it.

@pkratoch pkratoch merged commit d0d9e41 into rpm-software-management:main Jan 11, 2023
@m-blaha
Copy link
Member

m-blaha commented Jan 11, 2023

Hm, I still get this error on my fully updated Fedora 36:

/home/mblaha/src/dnf5/build/bindings/perl5/libdnf5/CMakeFiles/perl5_conf.dir/confPERL_wrap.cxx: error: -D_FORTIFY_SOURCE defined but value is too low [-Werror]
cc1plus: note: unrecognized command-line option ‘-Wno-sometimes-uninitialized’ may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors
make[2]: *** [bindings/perl5/libdnf5/CMakeFiles/perl5_conf.dir/build.make:76: bindings/perl5/libdnf5/CMakeFiles/perl5_conf.dir/CMakeFiles/perl5_conf.dir/confPERL_wrap.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1666: bindings/perl5/libdnf5/CMakeFiles/perl5_conf.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

It builds in the container, thougt. So I guess I need to investigate what the difference between my system and the container is.

@pkratoch
Copy link
Contributor

Oh my, sorry. I really thought it must have been something only in the very old dbox container and didn't want to block this on it. I'll keep looking into it as well then.

@m-blaha
Copy link
Member

m-blaha commented Jan 12, 2023

Looks like it's a ccache problem - https://bugzilla.redhat.com/show_bug.cgi?id=2160275
Without ccache the build is clean.

@pkratoch
Copy link
Contributor

Thank you, Marek!

@pmatilai
Copy link
Member

Just ran into the build failure on F36. Okay, cleared up by ccache --clean, but...

This weird dance around a distro and distro-version specific compiler setting seems a bit much. I think it's best for upstreams to stay away from this stuff to a large degree, distros will want to override your flags anyhow and the more you have flags by default the more likely weird conflicts become.

@kontura kontura deleted the perl branch January 16, 2023 07:21
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

Successfully merging this pull request may close these issues.

5 participants