From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112829 invoked by alias); 8 Jan 2019 21:46:02 -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 112732 invoked by uid 89); 8 Jan 2019 21:46:01 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=european, European X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,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: relay5-d.mail.gandi.net Received: from relay5-d.mail.gandi.net (HELO relay5-d.mail.gandi.net) (217.70.183.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Jan 2019 21:45:59 +0000 X-Originating-IP: 193.248.54.187 Received: from [192.168.1.2] (lstlambert-656-1-266-187.w193-248.abo.wanadoo.fr [193.248.54.187]) (Authenticated sender: basile@starynkevitch.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id E67CC1C000D for ; Tue, 8 Jan 2019 21:45:56 +0000 (UTC) Subject: about header file parsing References: To: jit@gcc.gnu.org From: Basile Starynkevitch X-Forwarded-Message-Id: Message-ID: <267b26cd-3ea3-8de7-0717-fc4400d7c8a7@starynkevitch.net> 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.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-IsSubscribed: yes X-SW-Source: 2019-q1/txt/msg00014.txt.bz2 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. 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). 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. 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. -- Basile STARYNKEVITCH == http://starynkevitch.net/Basile opinions are mine only - les opinions sont seulement miennes Bourg La Reine, France