From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7668 invoked by alias); 14 Mar 2018 16:34:11 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 7192 invoked by uid 89); 14 Mar 2018 16:34:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KAM_SHORT,SPF_PASS autolearn=ham version=3.3.2 spammy=H*UA:https, UD:wordpress.com, sir, our X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Mar 2018 16:34:09 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EBC9CAB3C; Wed, 14 Mar 2018 16:34:06 +0000 (UTC) From: Martin Jambor To: prashant kumar Cc: gcc@gcc.gnu.org Subject: Re: GSOC In-Reply-To: References: User-Agent: Notmuch/0.25.1 (https://notmuchmail.org) Emacs/25.3.1 (x86_64-suse-linux-gnu) Date: Wed, 14 Mar 2018 16:34:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00157.txt.bz2 Hello Prashant, On Thu, Mar 08 2018, prashant kumar wrote: > Hello sir my self *Prashant kumar *second year B.TECH student and i am > interesting in *"GCC plugin Api" *project .i have a good hand in c,c++ > languages .Can u tell me what the further process i have to do and what > kind of thing i have to do first and foremost, please discuss any GSoC idea or topic, use the gcc@gcc.gnu.org mailing list (CCed), this way other people may also participate in the discussion which will eventually help you as well. Moreover, in your particular case, you sent me your message while I was on vacation and so it took quite some time before I got to replying. Other members of the GCC community might have done that meanwhile. The aim of the gcc API project would be to start building a real GCC API for plugins, so that simple but already useful plugins (operating on GIMPLE level) could be written that use only this API (as opposed to the current state where they can - actually they have to - use any normal public symbol there is in GCC. I do not think it is reasonable to attempt make the API really entirely compiler agnostic but whenever practical, the interface should be built on top of generic compiler constructs (e.g. statements and operands as opposed to gimple and trees), for many reasons. In the first half of the project one would aim to build various dumping plugins... that would simply dump CFG, statements and perhaps also some information about types queried through the new interface. In the second half, you should try to rewrite some existing simple plugins using this API (such as https://pagure.io/funcp-encrypt that is described at https://developers.redhat.com/blog/2017/03/17/diagnosing-function-pointer-security-flaws-with-a-gcc-plugin/ or perhaps the structleak_plugin.c kernel GCC plugin or https://rwmj.wordpress.com/2016/02/24/playing-with-gcc-plugins/ though I have not had a very close look any of those). If you are interested, make sure you can check out the GCC trunk source code, can build GCC from it. The following links should help you: - How to check out our sources using svn and git is described at https://gcc.gnu.org/svn.html and https://gcc.gnu.org/wiki/GitMirror respectively. - Steps linked from https://gcc.gnu.org/install/ show you how to configure, build and test GCC is described in (look for --disable-bootstrap, among other things). - Also make sure you also look at https://gcc.gnu.org/wiki/InstallingGCC and https://gcc.gnu.org/wiki/GettingStarted wiki pages. And while you are at it, try also to look at the source. But you have gone through all of the above and still find a little bit intimidating or difficult to see where to start looking, do not despair. That is something the mentors and the community at large are willing to help you with. Regarding plugins, I'd suggest reading one ore more tutorials on their current implementation (e.g. http://thinkingeek.com/2015/08/16/a-simple-plugin-for-gcc-part-1/) and then look at some real plugins to get the sense of what would need to be APIzied. Good luck, Martin