From patchwork Sat Mar 3 02:13:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 10255941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E159E6037D for ; Sat, 3 Mar 2018 02:13:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C24052875F for ; Sat, 3 Mar 2018 02:13:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3F4A28759; Sat, 3 Mar 2018 02:13:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D0C628759 for ; Sat, 3 Mar 2018 02:13:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965182AbeCCCN3 (ORCPT ); Fri, 2 Mar 2018 21:13:29 -0500 Received: from avasout04.plus.net ([212.159.14.19]:46896 "EHLO avasout04.plus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965153AbeCCCN3 (ORCPT ); Fri, 2 Mar 2018 21:13:29 -0500 Received: from [10.0.2.15] ([80.189.70.162]) by smtp with ESMTPA id rwfue2zzkTRZxrwfveKqU3; Sat, 03 Mar 2018 02:13:27 +0000 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.3 cv=R6ot5+ZX c=1 sm=1 tr=0 a=zzlqjQC3YyNvDZl/Gy+4mg==:117 a=zzlqjQC3YyNvDZl/Gy+4mg==:17 a=IkcTkHD0fZMA:10 a=81im-AGrqglWWdMK-DsA:9 a=QEXdDO2ut3YA:10 X-AUTH: ramsayjones@:2500 Subject: Re: Merging Luc's master branch. To: Luc Van Oostenryck Cc: Christopher Li , Linux-Sparse References: <8127ea37-aa1e-cdff-a9eb-43e6f5bbf0f1@ramsayjones.plus.com> <20180302215728.uoo3o4e6tq55dehe@ltop.local> <949485c0-608e-1fd5-5263-fd9fc4f46f60@ramsayjones.plus.com> <20180303003138.penrbxrpjjiiq3t2@ltop.local> From: Ramsay Jones Message-ID: Date: Sat, 3 Mar 2018 02:13:25 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180303003138.penrbxrpjjiiq3t2@ltop.local> Content-Language: en-GB X-CMAE-Envelope: MS4wfO3kizinBwz4liR0y4d6Rjja+kRNM5zY6U0BFUFcjDIsxTiVLxs/Cgm2GFs3X+uQ9lFusTRSFs6Zb6haT6f4a04CoJmwxmFmgaLDqilPxcmEnIqKSDsP lIDsUhHxnX3FzevFY1B2XRpHfsNzI+yxfct1lob5UG3DhCnivGb7AUjcfFKWkE2FqNuyZBBrcP1Pag== Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 03/03/18 00:31, Luc Van Oostenryck wrote: > On Fri, Mar 02, 2018 at 11:33:52PM +0000, Ramsay Jones wrote: [snip] >> >> I think the exception-model is specific to the cygwin (Windows) >> platform. I chanced upon that solution by noting the errors > > I understood that 'sjlj' was ok for linux too while 'seh' was > only for Windows but I may be wrong. Yes, I didn't express myself very well there! :( The SEH is 'native windows' exception handling (not explicitly related to any specific language e.g. c++), which the llc tool seems to be set up to generate by default. However, cygwin attempts to be as close to Linux as it can, given that it actually runs on the windows platform. So, the GNU binutils on cygwin, uses the Linux like sjlj exception handling, which is what the call to 'as' in sparsec is expecting. (or rather, it is _not_ expecting seh!) If we were talking about a MinGW port - it would probably be different again! ;-) BTW, I quickly tried using an intermediate file in sparsei: $ git diff -- sparsei $ ./sparsei validation/backend/sum.c LLVM ERROR: Program used external function 'printf' which could not be resolved! $ ... and it didn't work. :-D Would this work on Linux? ATB, Ramsay Jones --- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/sparsei b/sparsei index 3431a9f..bc28ae2 100755 --- a/sparsei +++ b/sparsei @@ -10,4 +10,12 @@ if [ $# -eq 0 ]; then exit 1 fi -$DIRNAME/sparse-llvm $@ | $LLI +TMPFILE=`mktemp -t tmp.XXXXXX.bc` + +$DIRNAME/sparse-llvm $@ >$TMPFILE + +$LLI $TMPFILE + +exit_code=$? +rm -f $TMPFILE +exit $exit_code