public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Marc Nieper-Wißkirchen" <marc.nieper@gmail.com>
To: Basile Starynkevitch <basile@starynkevitch.net>, jit@gcc.gnu.org
Subject: Re: about header file parsing
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <3806bd4a-b35e-4db0-e368-86e332635196@gmail.com> (raw)
In-Reply-To: <267b26cd-3ea3-8de7-0717-fc4400d7c8a7@starynkevitch.net>

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.
> 

  reply	other threads:[~2019-01-08 21:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <df8944b7-1fbe-b56f-cc48-ab926d0cb5ad@starynkevitch.net>
2019-01-01  0:00 ` Basile Starynkevitch
2019-01-01  0:00   ` Marc Nieper-Wißkirchen [this message]
2019-01-01  0:00 akrl
2019-01-01  0:00 ` David Malcolm
2019-01-01  0:00   ` akrl
2019-01-01  0:00     ` Basile Starynkevitch
2019-01-01  0:00       ` akrl
2019-01-01  0:00         ` Basile Starynkevitch
2019-01-01  0:00           ` David Malcolm
2019-01-01  0:00             ` Marc Nieper-Wißkirchen
2019-01-01  0:00               ` Basile Starynkevitch
2019-01-01  0:00               ` akrl
2019-01-01  0:00                 ` Marc Nieper-Wißkirchen
2019-01-01  0:00       ` David Malcolm
2019-01-01  0:00     ` David Malcolm
2019-01-01  0:00       ` akrl
2019-01-01  0:00         ` David Malcolm
2019-01-01  0:00 ` Basile Starynkevitch
2019-01-01  0:00   ` Marc Nieper-Wißkirchen
2019-01-01  0:00   ` Marc Nieper-Wißkirchen
2019-01-01  0:00     ` Marc Nieper-Wißkirchen
2019-01-01  0:00       ` David Malcolm
2019-01-01  0:00         ` Marc Nieper-Wißkirchen
2019-01-01  0:00           ` David Malcolm
2019-01-01  0:00           ` akrl
2019-01-01  0:00             ` David Malcolm
2019-01-01  0:00               ` akrl
2019-01-01  0:00                 ` Marc Nieper-Wißkirchen
2019-01-01  0:00                   ` akrl
2019-01-01  0:00                     ` Marc Nieper-Wißkirchen
2019-01-01  0:00                       ` akrl
2019-01-01  0:00                         ` Marc Nieper-Wißkirchen
2019-01-01  0:00                           ` akrl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3806bd4a-b35e-4db0-e368-86e332635196@gmail.com \
    --to=marc.nieper@gmail.com \
    --cc=basile@starynkevitch.net \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).