From: Florian Weimer Date: Sat, 20 Jul 2019 08:55:25 +0000 (+0200) Subject: scripts/glibcextract.py: Print source code on compiler failure X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=719d81f129206d51bf168076ed1578e7414c2506;p=thirdparty%2Fglibc.git scripts/glibcextract.py: Print source code on compiler failure --- diff --git a/ChangeLog b/ChangeLog index a1fdef9cff1..fb14c32c43c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-07-20 Florian Weimer + + * scripts/glibcextract.py (compute_c_consts): Print source code on + compiler failure. + 2019-07-20 Egor Kobylkin [BZ #2872] diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py index 0ae1371a487..5e26cf53c3c 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: