Description: add back support for libraries without GObjects on systems
 that default to linking with --as-needed
Author: Stephen M. Webb
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gobject-introspection/+bug/1511047
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=757261

--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -37,6 +37,7 @@
     compiler_cmd = ''
     compiler = None
     _cflags_no_deprecation_warnings = ''
+    _linker_preargs = []
 
     def __init__(self,
                  environ=os.environ,
@@ -132,7 +133,7 @@
 
                 # Ensure libraries are always linked as we are going to use ldd to work
                 # out their names later
-                args.append('-Wl,--no-as-needed')
+                self._linker_preargs.append('-Wl,--no-as-needed')
 
             for library in libraries:
                 self.compiler.add_library(library)
@@ -240,7 +241,6 @@
 
     def link(self, output, objects, lib_args):
         # Note: This is used for non-libtool builds only!
-        extra_preargs = []
         extra_postargs = []
         library_dirs = []
         libraries = []
@@ -251,7 +251,7 @@
         self.compiler.link(target_desc=self.compiler.EXECUTABLE,
                            objects=objects,
                            output_filename=output,
-                           extra_preargs=extra_preargs,
+                           extra_preargs=self._linker_preargs,
                            extra_postargs=extra_postargs)
 
     def resolve_windows_libs(self, libraries, options):
