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

---
 giscanner/ccompiler.py |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -38,6 +38,7 @@ class CCompiler(object):
     compiler_cmd = ''
     compiler = None
     _cflags_no_deprecation_warnings = ''
+    _linker_preargs = []
 
     def __init__(self,
                  environ=os.environ,
@@ -134,7 +135,7 @@ class CCompiler(object):
                 # Ensure libraries are always linked as we are going to use ldd to work
                 # out their names later
                 if sys.platform != 'darwin':
-                    args.append('-Wl,--no-as-needed')
+                    self._linker_preargs.append('-Wl,--no-as-needed')
 
             for library in libraries + extra_libraries:
                 self.compiler.add_library(library)
@@ -242,7 +243,6 @@ class CCompiler(object):
 
     def link(self, output, objects, lib_args):
         # Note: This is used for non-libtool builds only!
-        extra_preargs = []
         extra_postargs = []
         library_dirs = []
         libraries = []
@@ -253,7 +253,7 @@ class CCompiler(object):
         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):
