GNOME Bugzilla – Bug 708257
gcab 0.4 fails to build on OS X
Last modified: 2016-11-19 14:55:17 UTC
I don't see a separate bug tracker for gcab, so I'll try here. gcab fails to build on OS X with this error: CCLD libgcab-1.0.la ld: unknown option: --version-script=./libgcab.syms collect2: ld returned 1 exit status make[2]: *** [libgcab-1.0.la] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Workaround is to remove the offending linker arguments from Makefile.am.
Created attachment 302408 [details] [review] Makefile: remove --version-script This is still an issue. Would this patch break anything on non-OSX systems?
"-Wl,--version-script=${srcdir}/libgcab.syms" is a single flag (the "-Wl," part means "use this flag for the linker stage only" not a separate flag that happens to be on the same line), so you have to include or exclude the whole thing together.
Got it. The attached patch is actually from the existing Homebrew formula (https://github.com/Homebrew/homebrew/blob/master/Library/Formula/gcab.rb), so that needs to be modified. Can the addition of that flag be conditional on the detection of a non-OSX system?
(In reply to AlexD from comment #3) > Got it. The attached patch is actually from the existing Homebrew formula > (https://github.com/Homebrew/homebrew/blob/master/Library/Formula/gcab.rb), > so that needs to be modified. Can the addition of that flag be conditional > on the detection of a non-OSX system? sure, I'd accept such patch
Probably not much harder (and definitely more correct) to test directly for this flag being supported than to use the platform as a heuristic. autoconf-archive has an AC_CHECK_VSCRIPT that's pretty full-featured. Googling for: "version-script" configure.ac gets lots of simple implementations from other open-source projects.
Created attachment 339733 [details] [review] build-sys: Don't use version script if unsupported This incorporates the AX_CHECK_VSCRIPT macro from autoconf-archive in order to make symbol versioning portable across platforms (and not use it on platforms that don't support it.)
Attachment 339733 [details] pushed as ef8d02b - build-sys: Don't use version script if unsupported