After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 767255 - build failure in flatpak apps for gstreamer
build failure in flatpak apps for gstreamer
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-04 20:15 UTC by Matthias Clasen
Modified: 2018-11-03 12:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
WIP: buffer, caps, event, message: attempt to silence compiler warnings (6.29 KB, patch)
2016-07-25 23:13 UTC, Tim-Philipp Müller
none Details | Review
WIP: buffer, caps, event, message: attempt to silence compiler warnings (5.92 KB, patch)
2018-06-06 11:14 UTC, Bastien Nocera
none Details | Review
build.log (42.00 KB, text/plain)
2018-06-06 11:40 UTC, Bastien Nocera
  Details

Description Matthias Clasen 2016-06-04 20:15:40 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
Comment 1 Sebastian Dröge (slomo) 2016-06-06 07:42:05 UTC
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?
Comment 2 Matthias Clasen 2016-06-06 12:33:56 UTC
(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
Comment 3 Sebastian Dröge (slomo) 2016-06-06 13:00:58 UTC
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).
Comment 4 Tim-Philipp Müller 2016-07-25 12:14:19 UTC
What to do with this then? WONTFIX?
Comment 5 Matthias Clasen 2016-07-25 18:08:18 UTC
probably, yes
Comment 6 Tim-Philipp Müller 2016-07-25 23:13:27 UTC
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?
Comment 7 Tim-Philipp Müller 2016-08-08 17:53:59 UTC
Anyone who can test this?
Comment 8 Tim-Philipp Müller 2016-11-11 14:44:53 UTC
Ping²

Matthias maybe? :)
Comment 9 Vivia Nikolaidou 2018-05-06 12:31:48 UTC
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!
Comment 10 Bastien Nocera 2018-06-06 11:14:37 UTC
Created attachment 372571 [details] [review]
WIP: buffer, caps, event, message: attempt to silence compiler warnings

.. with -Wcast-align on aarch64.
Comment 11 Bastien Nocera 2018-06-06 11:40:44 UTC
Created attachment 372572 [details]
build.log

Compilation still fails with the rebased patch.
Comment 12 Nicolas Dufresne (ndufresne) 2018-06-06 11:49:12 UTC
I regularly build on aarch64, and never had this issue. Could it be that the wrong (32bit vs 64bit) *config.h get included ?
Comment 13 Bastien Nocera 2018-06-06 11:53:29 UTC
(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.
Comment 14 Sebastian Dröge (slomo) 2018-06-06 12:07:36 UTC
(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
Comment 15 Nicolas Dufresne (ndufresne) 2018-06-06 12:46:42 UTC
The commit message is very clear, and this bug is not ours then.
Comment 16 Bastien Nocera 2018-06-06 12:52:43 UTC
(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.
Comment 17 Sebastian Dröge (slomo) 2018-06-06 13:02:12 UTC
(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.
Comment 18 Bastien Nocera 2018-06-06 13:04:36 UTC
(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.
Comment 19 Sebastian Dröge (slomo) 2018-06-06 13:20:17 UTC
(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.
Comment 20 Tim-Philipp Müller 2018-06-12 10:39:45 UTC
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.
Comment 21 GStreamer system administrator 2018-11-03 12:34:49 UTC
-- 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.