From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106750 invoked by alias); 6 Jul 2017 17:12:30 -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 106722 invoked by uid 89); 6 Jul 2017 17:12:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=H*M:151, ctxt X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Jul 2017 17:12:27 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D6C0461D10; Thu, 6 Jul 2017 17:12:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D6C0461D10 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dmalcolm@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D6C0461D10 Received: from ovpn-117-117.phx2.redhat.com (ovpn-117-117.phx2.redhat.com [10.3.117.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80F5E17154; Thu, 6 Jul 2017 17:12:24 +0000 (UTC) Message-ID: <1499361143.7656.151.camel@redhat.com> Subject: Re: Some basic questions From: David Malcolm To: Mahdi Mohammadinasab , jit@gcc.gnu.org Date: Sun, 01 Jan 2017 00:00:00 -0000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 06 Jul 2017 17:12:26 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00001.txt.bz2 On Thu, 2017-07-06 at 17:51 +0100, Mahdi Mohammadinasab wrote: > I have some basic questions regarding libgccjit. I could not find the > answer in the documentation. > > 1. Does libgccjit do optimizations when generating the machine code? By default, no, but you can enable optimizations using GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL: e.g. gcc_jit_context_set_int_option(ctxt, GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL, 2); for the equivalent of -O2. https://gcc.gnu.org/onlinedocs/jit/topics/contexts.html#GCC_JIT_INT_OPT ION_OPTIMIZATION_LEVEL You can also enable specific optimizations using: gcc_jit_context_add_command_line_option e.g.: gcc_jit_context_add_command_line_option (ctxt, "-ffast-math"); > 2. Does it support other OSs like Windows? In theory, yes, but I don't know of anyone who's used it on Windows, and so in practice there are likely to be bugs that need solving. I know people have used it on OS X (using an out-of-tree patch, which is in the OS X Homebrew packages: see https://github.com/Homebrew/homebrew-core/blob/master/Formula/gcc.rb#L4 6 which is an OS X-specific patch for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64089 ) > 3. If the output application depends on a static library (.a) I will > need to generate object file using libgccjit (call > gcc_jit_context_compile_to_file with GCC_JIT_OUTPUT_KIND_OBJECT_FILE > option) and use system linker to link it with the library. Is that > the > correct approach? https://gcc.gnu.org/onlinedocs/jit/topics/compilation.html#GCC_JIT_OUTP UT_KIND_EXECUTABLE says "There is currently no support for specifying libraries to link against.". Given that limitation, the approach you suggest sounds correct. Alternatively we could add support for passing linker options for use with GCC_JIT_OUTPUT_KIND_EXECUTABLE (one might think that gcc_jit_context_add_command_line_option could be used, but options added this way are used in a different place). > 4. Is there any planned feature missing from current codebase which > prevents it moving out of alpha stage? Not AFAIK. Hope this is helpful Dave