GNOME Bugzilla – Bug 767255
build failure in flatpak apps for gstreamer
Last modified: 2018-11-03 12:34:49 UTC
Some apps fail to build in the flatpak builder with this error: In file included from /usr/include/gstreamer-1.0/gst/gstpad.h:69:0, from /usr/include/gstreamer-1.0/gst/gstelement.h:57, from /usr/include/gstreamer-1.0/gst/gstbin.h:27, from /usr/include/gstreamer-1.0/gst/gst.h:35, from /usr/include/gstreamer-1.0/gst/pbutils/encoding-profile.h:24, from /usr/include/gstreamer-1.0/gst/pbutils/encoding-target.h:24, from rb-gst-media-types.c:32: /usr/include/gstreamer-1.0/gst/gstbuffer.h: In function ‘gst_buffer_ref’: /usr/include/gstreamer-1.0/gst/gstbuffer.h:353:10: error: cast increases required alignment of target type [-Werror=cast-align] See e.g. https://gnome7.codethink.co.uk//logs/build-2016-06-04-200001/build-org.gnome.Rhythmbox3.txt
This looks like a bug in your toolchain. That cast should be valid, otherwise all kinds of casts between e.g. compatible GObject structs (base class to sub class or other way around) would result in such warnings. Which version of gcc is this?
(In reply to Sebastian Dröge (slomo) from comment #1) > This looks like a bug in your toolchain. That cast should be valid, > otherwise all kinds of casts between e.g. compatible GObject structs (base > class to sub class or other way around) would result in such warnings. Well, the same toolchain builds e.g. gtk just fine (which has 'all kinds of casts between e.g. compatible GObject structs'). So, there must be something specific to this GstMiniObject that upsets gcc. > Which version of gcc is this? Looks like this is gcc 5.2.0 on aarch64
Seems like a known problem: https://bugzilla.redhat.com/show_bug.cgi?id=1190358 (CLOSED NOTABUG) and https://bugzilla.gnome.org/show_bug.cgi?id=615698 (RESOLVED FIXED by not using -Wcast-align anymore) Why does it build with -Wcast-align btw? From my understanding the compiler warning is wrong in this case, and it's not clear to me how to work around it. (And the build fails for you because of -Werror).
What to do with this then? WONTFIX?
probably, yes
Created attachment 332122 [details] [review] WIP: buffer, caps, event, message: attempt to silence compiler warnings Wonder if something like this would help? Don't have an aarch64 setup to test with at hand right now, any chance someone else could give it a shot?
Anyone who can test this?
Ping² Matthias maybe? :)
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment. Thanks!
Created attachment 372571 [details] [review] WIP: buffer, caps, event, message: attempt to silence compiler warnings .. with -Wcast-align on aarch64.
Created attachment 372572 [details] build.log Compilation still fails with the rebased patch.
I regularly build on aarch64, and never had this issue. Could it be that the wrong (32bit vs 64bit) *config.h get included ?
(In reply to Nicolas Dufresne (ndufresne) from comment #12) > I regularly build on aarch64, and never had this issue. Could it be that the > wrong (32bit vs 64bit) *config.h get included ? rhythmbox builds with -Wcast-align. You probably don't.
(In reply to Bastien Nocera from comment #13) > (In reply to Nicolas Dufresne (ndufresne) from comment #12) > > I regularly build on aarch64, and never had this issue. Could it be that the > > wrong (32bit vs 64bit) *config.h get included ? > > rhythmbox builds with -Wcast-align. You probably don't. Yes, see this commit commit 246f5dba96a5b50bb74621af67b30942cca72af5 Author: Benjamin Otte <otte@redhat.com> Date: Wed Apr 14 11:19:14 2010 +0200 configure: Remove -Wcast-align Apparently gcc warns that GstMiniObject is not castable to GstEvent/Message/Buffer due to them containing 64bit variables, even though ARM hackers claim that those only need 4byte alignment. And as long as gcc behaves that way, this warning is not very useful. So we'll remove the warning until this problem is fixed. https://bugzilla.gnome.org/show_bug.cgi?id=615698
The commit message is very clear, and this bug is not ours then.
(In reply to Nicolas Dufresne (ndufresne) from comment #15) > The commit message is very clear, and this bug is not ours then. The commit makes gstreamer compile. The problem is that you don't get to differentiate warnings caused by rhythmbox, and the ones caused by inline functions in gstreamer. So if I want to compile rhythmbox with -Wcast-align, then gstreamer's inline functions need to not trigger warnings.
(In reply to Bastien Nocera from comment #16) > So if I want to compile rhythmbox with -Wcast-align, then gstreamer's inline > functions need to not trigger warnings. Which are in the end a gcc bug, but we should try to work around it at least if there's a reasonable workaround that works.
(In reply to Sebastian Dröge (slomo) from comment #17) > (In reply to Bastien Nocera from comment #16) > > > So if I want to compile rhythmbox with -Wcast-align, then gstreamer's inline > > functions need to not trigger warnings. > > Which are in the end a gcc bug, Might very well be. Do you have a reference for it? I couldn't find one. > but we should try to work around it at least > if there's a reasonable workaround that works. Yeah, Tim's patch already fixed some of the cases, but there's a few more lurking according to the build log.
(In reply to Bastien Nocera from comment #18) > (In reply to Sebastian Dröge (slomo) from comment #17) > > (In reply to Bastien Nocera from comment #16) > > > > > So if I want to compile rhythmbox with -Wcast-align, then gstreamer's inline > > > functions need to not trigger warnings. > > > > Which are in the end a gcc bug, > > Might very well be. Do you have a reference for it? I couldn't find one. Ask Benjamin who investigated this very same problem 8 years ago (see comment 14). A short search gave many similar sounding bugs in the GCC Bugzilla.
I think the remaining issues are issues in GType/GObject with GObject's type cast/check macros. There seems to be a patch in https://gitlab.gnome.org/GNOME/glib/issues/1231 for those.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/173.