From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103424 invoked by alias); 21 Jul 2019 20:31:57 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 103407 invoked by uid 9299); 21 Jul 2019 20:31:57 -0000 Date: Sun, 21 Jul 2019 20:31:00 -0000 Message-ID: <20190721203157.103406.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/fw/linux-5.2] scripts/glibcextract.py: Print source code on compiler failure X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/fw/linux-5.2 X-Git-Oldrev: c7e4b684e77323d1ef85dcdde8a41411ebe3b581 X-Git-Newrev: 719d81f129206d51bf168076ed1578e7414c2506 X-SW-Source: 2019-q3/txt/msg00105.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=719d81f129206d51bf168076ed1578e7414c2506 commit 719d81f129206d51bf168076ed1578e7414c2506 Author: Florian Weimer 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 a1fdef9..fb14c32 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 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: