From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5290 invoked by alias); 22 Jun 2013 07:31:39 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 5279 invoked by uid 89); 22 Jun 2013 07:31:38 -0000 X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-we0-f170.google.com (HELO mail-we0-f170.google.com) (74.125.82.170) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 22 Jun 2013 07:31:37 +0000 Received: by mail-we0-f170.google.com with SMTP id w57so7086335wes.15 for ; Sat, 22 Jun 2013 00:31:35 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.187.209 with SMTP id fu17mr976550wic.52.1371886295727; Sat, 22 Jun 2013 00:31:35 -0700 (PDT) Received: by 10.194.238.130 with HTTP; Sat, 22 Jun 2013 00:31:35 -0700 (PDT) Date: Sat, 22 Jun 2013 07:31:00 -0000 Message-ID: Subject: Help needed with loading a gcc plugin From: Sandeep K Chaudhary To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-06/txt/msg00182.txt.bz2 Hi guys, I am trying to run a gcc plugin that I created. I have followed the steps mentioned in the followiing tutorial to create the plugin http://lwn.net/Articles/457543/ I am able to successfully build the plugin shared object. However, I can not run the plugin. It gives errors related to undefined symbols. Below is the terminal snippet. sandeep@ubuntu:~/myplugin$ /usr/bin/gcc -fplugin=/home/sandeep/myplugin/speller.so -c test.c cc1: error: cannot load plugin /home/sandeep/myplugin/speller.so /home/sandeep/myplugin/speller.so: undefined symbol: warning_at I can see that the mentioned symbol is indeed undefined using following sandeep@ubuntu:~/myplugin$ nm -D -C speller.so | grep warning_at U warning_at And I see that sandeep@ubuntu:/usr/lib/gcc/x86_64-linux-gnu/4.7.2$ pwd /usr/lib/gcc/x86_64-linux-gnu/4.7.2 sandeep@ubuntu:/usr/lib/gcc/x86_64-linux-gnu/4.7.2$ nm -D -C $(gcc -print-file-name=cc1) | grep "warning_" 0000000000c1e5a0 T warning_at(unsigned int, int, char const*, ...) What am I missing? How should I link the libraries correctly? Please help. Thanks, Sandeep.