Issue #9437: Fix building C extensions with non-default LDFLAGS.
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 48f3fe4..8847e31 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -359,6 +359,11 @@
 
     fp.close()
 
+    # strip spurious spaces
+    for k, v in done.items():
+        if isinstance(v, str):
+            done[k] = v.strip()
+
     # save the results in the global dictionary
     g.update(done)
     return g