GNOME Bugzilla – Bug 742097
iOS: AT_FDCWD not available before XCode 6.1
Last modified: 2015-01-09 09:40:56 UTC
Created attachment 293454 [details] XCode project that manifests those issues Creating a bug report after discussing it with Sebastian Dröge Hello, I installed the binaries found at: http://gstreamer.freedesktop.org/data/pkg/ios/1.4.4/ Then I used the GStreamer Template 'GStreamer Single View Application' and tried to build in XCode without success. The problem is undefined symbols for fstatat, openat and fdopendir as can be seen in XCode's output below: ------------------- Undefined symbols for architecture armv7s: "_fstatat", referenced from: _g_local_file_measure_size_of_file in GStreamer(libgio-2_0_a_armv7s_-libgio_2_0_la-glocalfile.o) "_openat", referenced from: _g_local_file_measure_size_of_file in GStreamer(libgio-2_0_a_armv7s_-libgio_2_0_la-glocalfile.o) "_fdopendir", referenced from: _g_local_file_measure_size_of_file in GStreamer(libgio-2_0_a_armv7s_-libgio_2_0_la-glocalfile.o) ld: symbol(s) not found for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation) ------------------- Please note that I get the same issues both for device (iOS 7.1) and simulator (i386 and x86_64 architectures). Tried to spot which dynamic libs from the relevant SDK contain those functions/symbols in order to add them but I wasn't able to find any, so I tried to add glibc.dylib in XCode and various others but to no avail. Any ideas what might be wrong? Thanks a lot, Antonis P.S. After Sebastian's request I also tried example project @ http://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/tree/gst-sdk/tutorials/xcode%20iOS but I got he same problem. P.S.2 I also switched to my GNU/Linux box to see where those 3 undefined symbols reside (using nm) and most of them are defined in glibc.so, so I wonder why in iOS glibc.dylib doesn't have define/export those symbols...
There's a newer version available here btw: http://gstreamer.freedesktop.org/data/pkg/ios/1.4.5/ Which XCode version are you using?
(In reply to comment #1) > There's a newer version available here btw: > http://gstreamer.freedesktop.org/data/pkg/ios/1.4.5/ > > Which XCode version are you using? I believe its XCode 5.1 Thanks
As discussed on the mailing list, the problem is that XCode 6.1 at least has these symbols so we use them. Older versions don't. But we need newer versions for the build because of features of newer iOS versions (which are only used conditionally). One solution could be to explicitly disable usage of all the symbols in questions in all the software we include. Are the 3 symbols listed above the only ones?
Just making sure that AT_FDCWD is not #defined during the GLib build would be enough for those 3 at least... which would need a small patch to glib/gio/glocalfile.c.
commit 94e0e3c5fd8a0566d25003fb07b5ba12284cd496 Author: Sebastian Dröge <sebastian@centricular.com> Date: Fri Jan 9 10:37:43 2015 +0100 glib: Don't use AT_FDCWD on iOS for now AT_FDCWD is available since XCode 6.1 and cause linking failures when linking an application later with older XCode versions https://bugzilla.gnome.org/show_bug.cgi?id=742097