GNOME Bugzilla – Bug 756154
qtmux: doesn't compile on OS X 10.6: strnlen not available
Last modified: 2015-10-20 07:17:19 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.
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.
Created attachment 312886 [details] [review] Patch to provide strnlen implementation on OS X <10.7
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
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?
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.
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 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