about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-07-20 10:55:25 +0200
committerFlorian Weimer <fweimer@redhat.com>2019-07-21 22:31:33 +0200
commit719d81f129206d51bf168076ed1578e7414c2506 (patch)
tree353bd0183da81e5469c26716fec0d38586d7c4c1
parentc7e4b684e77323d1ef85dcdde8a41411ebe3b581 (diff)
downloadglibc-719d81f129206d51bf168076ed1578e7414c2506.tar.gz
glibc-719d81f129206d51bf168076ed1578e7414c2506.tar.xz
glibc-719d81f129206d51bf168076ed1578e7414c2506.zip
scripts/glibcextract.py: Print source code on compiler failure
-rw-r--r--ChangeLog5
-rw-r--r--scripts/glibcextract.py7
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a1fdef9cff..fb14c32c43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-07-20  Florian Weimer  <fweimer@redhat.com>
+
+	* scripts/glibcextract.py (compute_c_consts): Print source code on
+	compiler failure.
+
 2019-07-20  Egor Kobylkin  <egor@kobylkin.com>
 
 	[BZ #2872]
diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py
index 0ae1371a48..5e26cf53c3 100644
--- a/scripts/glibcextract.py
+++ b/scripts/glibcextract.py
@@ -59,7 +59,12 @@ def compute_c_consts(sym_data, cc):
         # Compilation has to be from stdin to avoid the temporary file
         # name being written into the generated dependencies.
         cmd = ('%s -S -o %s -x c - < %s' % (cc, s_file_name, c_file_name))
-        subprocess.check_call(cmd, shell=True)
+        try:
+            subprocess.check_call(cmd, shell=True)
+        except:
+            print("Source code failed to compile:")
+            print(out_text)
+            raise
         consts = {}
         with open(s_file_name, 'r') as s_file:
             for line in s_file: