This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[glibc/fw/linux-5.2] scripts/glibcextract.py: Print source code on compiler failure


https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=332b70b090f5c6d16fecb8e049b9ade0f4895c54

commit 332b70b090f5c6d16fecb8e049b9ade0f4895c54
Author: Florian Weimer <fweimer@redhat.com>
Date:   Sat Jul 20 10:55:25 2019 +0200

    scripts/glibcextract.py: Print source code on compiler failure

Diff:
---
 ChangeLog               | 5 +++++
 scripts/glibcextract.py | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index a606c5f..688f4d6 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-19  Florian Weimer  <fweimer@redhat.com>
 
 	* sysdeps/unix/sysv/linux/syscall-names.list: Add system calls
diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py
index 0ae1371..5e26cf5 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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]