From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127431 invoked by alias); 8 Jan 2019 21:50:41 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 127352 invoked by uid 89); 8 Jan 2019 21:50:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail-wm1-f53.google.com Received: from mail-wm1-f53.google.com (HELO mail-wm1-f53.google.com) (209.85.128.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Jan 2019 21:50:38 +0000 Received: by mail-wm1-f53.google.com with SMTP id a62so5607255wmh.4 for ; Tue, 08 Jan 2019 13:50:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=9kmCoaSdfabdD7QS4GS4hh4R5nwEsAfHH39/Q8CFYA4=; b=PI7W9LV0vs30Jg0m+kEJ8B62RXJ9l4Dsedu+6VN3WV1BPS1Y3YqV4Ga59+MnOS2iNy /4R4F5do47sgd1sR13YEJnLqRNj+ZjEKXeBj32S13gkwR4M4mdS93q0lxsmrrZKFdqSz ryLtYAvvY0mG2nkE+fEp+h6ic8mFfRJZXDMZyoKAfPQRSaFbZzHplL2660qj6O16Tcrl d0YZIuin563Gr14y+aLq/E3nHa0lTrHTgh3v031sPkDj5YTGYtdoPbFmUFB5CyfQezzI NvhZIB1IZoJARFlFUdPngFwuRSfXou535H6N5rxzhJSLBIzKGAIaDUhtAImYa71DYzG+ avZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9kmCoaSdfabdD7QS4GS4hh4R5nwEsAfHH39/Q8CFYA4=; b=EIaVM7kuzYSVNoaF+3ZrwUsOd4olPgvhgHb/q+OW5PGBp6dz0GB958P+mWAKsT+hls rb2MA5dw7WQBIkSnaxaF0zl/osSi+1OknQaT4BLSNeGVYslYtMKJRFriz+Tu7IUJda1F Ol8m8RSu7FGMwu5KFBmdGWlS+DXH6Z5rnczSlr4jBa9ikdz549qKAXux/lzHP9tsreGs WDka4xCazNwqKXXIe1ig4iXNRd0Trqjpw0bUeNaHa6HJ0/uwX8nYvhxAnegrpUlHDf18 U+iSmHfCho8YQ6/7z1yRFpQIngTmJFhDUTBWjnOQt82ZDmFPdeKZ+to33wL56Dry8mYN PNmg== X-Gm-Message-State: AJcUukfbX2xOmWWC1b04RFOtgFzGcrHG8f7eBzGqLKxKDZZbUCxThbaa pFKhGpiluA2fMZTZvp7n4eGgp90Ci2o= X-Google-Smtp-Source: ALg8bN6FTxS2dNa7Q85v4BVMRl2dvI5MotpfuI2Ydw6lU41j36V16CeXNkeJEpMz5ZYWLB/tCPG4Fg== X-Received: by 2002:a1c:8c13:: with SMTP id o19mr2925931wmd.56.1546984235490; Tue, 08 Jan 2019 13:50:35 -0800 (PST) Received: from ?IPv6:2a02:810d:340:25f8:46d:f2b2:3936:4d0a? ([2a02:810d:340:25f8:46d:f2b2:3936:4d0a]) by smtp.gmail.com with ESMTPSA id g198sm16628068wmd.23.2019.01.08.13.50.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jan 2019 13:50:34 -0800 (PST) Subject: Re: about header file parsing To: Basile Starynkevitch , jit@gcc.gnu.org References: <267b26cd-3ea3-8de7-0717-fc4400d7c8a7@starynkevitch.net> From: =?UTF-8?Q?Marc_Nieper-Wi=c3=9fkirchen?= Message-ID: <3806bd4a-b35e-4db0-e368-86e332635196@gmail.com> Date: Tue, 01 Jan 2019 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <267b26cd-3ea3-8de7-0717-fc4400d7c8a7@starynkevitch.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-q1/txt/msg00015.txt.bz2 Am 08.01.19 um 22:45 schrieb Basile Starynkevitch: > Hello all > > Sorry, I have sent a private message to Marc which was meant to be on > this jit@gcc.gnu.org list. Here is it for all > > > > On 1/8/19 10:30 PM, Marc Nieper-Wißkirchen wrote: >> What would you do with macros defined in the header file that form >> part of the API? They won't be visible after compiling (already after >> preprocessing). > > That is one of the problems. Notice that libgccjit don't know about > macros, and there is no way to use a macro from libgccjit. > For example, libgccjit does not know that EOF is -1 on my system. This seems to be less of a problem if you are able to include the header file defining, say, EOF, in your C program that calls the libgccjit functions. > Another problem is inlined functions appearing in headers. They won't be > inlined from LIBGCCJIT generated code, unless you use LTO. > > LIBGCCJIT code can only call C-like functions - without inlining them > (even when GCC would). > > Perhaps you are only interested in using nice C headers that don't > define any inlined functions and have only very few macro constants. > For the macro constants (like EOF) you would handle them by hand (e.g. > expanding the EOF of your Scheme dialect into -1 before using libgccjit). Ah, yes, this is what I meant above. :) > > BTW, CLASP (see https://github.com/clasp-developers/clasp ...) might be > inspirational for you, but doing the equivalent in your case is a lot of > work > because what DrMeister did in CLASP is a lot of work; see also > https://drmeister.wordpress.com/ and > @Inproceedings{Schafmeister:2015:CLASP, > author = {Schafmeister, Christian E.}, > booktitle = {Proceedings of the 8\textsuperscript{th} European > Lisp Symposium on European Lisp Symposium}, > series = {ELS2015}, > year = 2015, > title = {{CLASP} - A {Common Lisp} that Interoperates with > {C++} and Uses the {LLVM} Backend} > } > > > I don't understand if you want to handle a specific set of a few header > files in your Scheme using libgccjit, or if you want a generic solution. I am not the original author of the question. I just wanted to remark that parsing header files is even more involved. > If you only want to interace a specific library to your Scheme above > LibGccJit, you could use the GCC plugin technique (then hand-tune the few > problematic areas). If you want a generic solution, it probably won't be > enough. > > Cheers. >