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 756154 - qtmux: doesn't compile on OS X 10.6: strnlen not available
qtmux: doesn't compile on OS X 10.6: strnlen not available
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.6.0
Other Mac OS
: Normal major
: 1.6.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-06 23:41 UTC by Ryan Hendrickson
Modified: 2015-10-20 07:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to provide strnlen implementation on OS X <10.7 (564 bytes, patch)
2015-10-08 07:20 UTC, Ryan Hendrickson
needs-work Details | Review
Patch to unconditionally not use strnlen (841 bytes, patch)
2015-10-15 21:24 UTC, Ryan Hendrickson
committed Details | Review

Description Ryan Hendrickson 2015-10-06 23:41:41 UTC
From make:

    Undefined symbols for architecture x86_64:
      "_strnlen", referenced from:
          _gst_qt_mux_prepare_tx3g_buffer in libgstisomp4_la-gstqtmux.o

strnlen is used in gst/isomp4/gstqtmux.c (added in commit 66953415). Apparently strnlen was only added to the OS X libc in 10.7 [http://stackoverflow.com/questions/32468480/strnlen-does-not-exist-in-gcc-4-2-1-on-mac-os-x-10-6-8-how-to-define-it].

I'm compiling the source from https://download.gnome.org/sources/gst-plugins-good/1.6/gst-plugins-good-1.6.0.tar.xz, on OS X 10.6.8, using Homebrew and gcc 5.2.0.
Comment 1 Sebastian Dröge (slomo) 2015-10-07 10:24:57 UTC
Do you want to provide a patch for this? Not sure if we want to continue supporting 10.6 at this point, many interesting features are just not available there.
Comment 2 Ryan Hendrickson 2015-10-08 07:20:53 UTC
Created attachment 312886 [details] [review]
Patch to provide strnlen implementation on OS X <10.7
Comment 3 Sebastian Dröge (slomo) 2015-10-08 14:09:10 UTC
Comment on attachment 312886 [details] [review]
Patch to provide strnlen implementation on OS X <10.7

This should also get a configure check instead of using the Apple macros. Looks good otherwise
Comment 4 Ryan Hendrickson 2015-10-15 18:56:58 UTC
I'm new to autoconf, and I've been trying to learn but I'm a little stuck. I found the AC_FUNC_STRNLEN macro, which got me excited, but just adding that to configure.ac wasn't enough to get the project compiling. Then I guessed that autoconf wasn't going to actually provide the replacement strnlen implementation for me, so I added one to lib/strnlen.c, but still no dice. Do you know what I'm missing?
Comment 5 Tim-Philipp Müller 2015-10-15 19:15:22 UTC
I don't know, I think the code should either be rewritten to not use strnlen() or to just use the same static inline qtmux_strnlen() everywhere on all platforms unconditionally.
Comment 6 Ryan Hendrickson 2015-10-15 21:24:46 UTC
Created attachment 313403 [details] [review]
Patch to unconditionally not use strnlen

Ah! Well, not using strnlen is easy enough, if that's the maintainers' preference.
Comment 7 Sebastian Dröge (slomo) 2015-10-19 12:38:08 UTC
Comment on attachment 313403 [details] [review]
Patch to unconditionally not use strnlen

commit fc203a4bd7eb1cecc0e17bcb7ec67e0672806867
Author: Ryan Hendrickson <ryan.hendrickson@alum.mit.edu>
Date:   Mon Oct 19 15:36:37 2015 +0300

    qtmux: Don't unconditionally use strnlen()
    
    It's not available on older OSX and we can as well use memchr() here.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756154