Bug 1265627 - Check that using the compiler flags we add does what they are intended to do. r?ted draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 19 Apr 2016 14:48:19 +0900
changeset 353128 02ca7546a76ee2aa48d56b90887c0b67dff43521
parent 353127 a1a03c58109d5bfc8e86d8ce49c883409817d791
child 353129 4b00776c2c54a66078966e2070c923043f77d98e
push id15875
push userbmo:mh+mozilla@glandium.org
push dateTue, 19 Apr 2016 07:07:13 +0000
reviewersted
bugs1265627
milestone48.0a1
Bug 1265627 - Check that using the compiler flags we add does what they are intended to do. r?ted While this is not immediately useful, it will be with the next changes.
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -455,20 +455,32 @@ def compiler(language, host_or_target, c
                     full_path):
                 die('Found `%s` before `%s` in your $PATH. '
                     'Please reorder your $PATH.',
                     quote(os.path.dirname(found_compiler)),
                     quote(os.path.dirname(full_path)))
 
         type, version, more_flags = check_compiler(
             wrapper + [compiler] + flags, language)
+
+        # Check that the additional flags we got are enough to not require any
+        # more flags.
+        if more_flags:
+            flags += more_flags
+            type, version, more_flags = check_compiler(
+                wrapper + [compiler] + flags, language)
+
+        if more_flags:
+            raise FatalCheckError(
+                'Unknown compiler or compiler not supported.')
+
         return namespace(
             wrapper=wrapper,
             compiler=compiler,
-            flags=flags + more_flags,
+            flags=flags,
             type=type,
             version=version,
         )
 
     @depends(valid_compiler)
     @checking('%s version' % what)
     def compiler_version(compiler):
         return compiler.version