Unable to complete build of 0.9.4.b with GCC 4.7

58 views
Skip to first unread message

ali...@mandriva.com

unread,
Mar 25, 2012, 10:40:31 AM3/25/12
to gcc-...@googlegroups.com
Hello,

I'm working on updating the MELT plugin package that is living in
mandriva cooker. Turns out that it does not work. First stage melt.so is
built successfully but is unable to be loaded to continue:

***** doing melt-stage1/warmelt-first.c from melt-build.tpl line 343
doing warmelt-first+melt-stage1 from melt-build.tpl line 344
gcc -c @warmelt-first+melt-stage1.args
cc1: error: cannot load plugin
/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt.so
/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt.so:
undefined symbol: warning_at

Content of the .args file:
-fplugin=/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt.so
-I
/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7
-o /dev/null -Wno-shadow -fplugin-arg-melt-mode=translateinit
-fplugin-arg-melt-module-makefile=melt-module.mk
-fplugin-arg-melt-module-make-command=/usr/bin/make
-fplugin-arg-melt-module-cflags='-I
/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7
-I
/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt/generated
-DIN_GCC -DMELT_IS_PLUGIN -I
/usr/lib64/gcc/x86_64-mandriva-linux-gnu/4.7.0/plugin/include -I
/usr/lib64/gcc/x86_64-mandriva-linux-gnu/4.7.0/plugin/include/c-family '
-fplugin-arg-melt-tempdir=. -fplugin-arg-melt-bootstrapping
-fplugin-arg-melt-init=melt-stage0-quicklybuilt/warmelt-first.quicklybuilt:melt-stage0-quicklybuilt/warmelt-base.quicklybuilt:melt-stage0-quicklybuilt/warmelt-debug.quicklybuilt:melt-stage0-quicklybuilt/warmelt-macro.quicklybuilt:melt-stage0-quicklybuilt/warmelt-normal.quicklybuilt:melt-stage0-quicklybuilt/warmelt-normatch.quicklybuilt:melt-stage0-quicklybuilt/warmelt-genobj.quicklybuilt:melt-stage0-quicklybuilt/warmelt-outobj.quicklybuilt:melt-stage0-quicklybuilt/warmelt-modes.quicklybuilt
-fplugin-arg-melt-arg=/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt/warmelt-first.melt
-frandom-seed=fbea5398ead97adbafb3e083
-fplugin-arg-melt-module-path=/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7:/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt-stage1:/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt-stage0-quicklybuilt:
-fplugin-arg-melt-source-path=/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7:/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt-stage1:/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt-stage0-quicklybuilt:/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt:/home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt/generated:
-fplugin-arg-melt-output=melt-stage1/warmelt-first
-fplugin-arg-melt-workdir=melt-workdir empty-file-for-melt.c

Basile Starynkevitch

unread,
Mar 25, 2012, 1:03:49 PM3/25/12
to gcc-...@googlegroups.com, ali...@mandriva.com
On Sun, 25 Mar 2012 16:40:31 +0200
ali...@mandriva.com wrote:

> Hello,
>
> I'm working on updating the MELT plugin package that is living in
> mandriva cooker. Turns out that it does not work. First stage melt.so is
> built successfully but is unable to be loaded to continue:
>
> ***** doing melt-stage1/warmelt-first.c from melt-build.tpl line 343
> doing warmelt-first+melt-stage1 from melt-build.tpl line 344
> gcc -c @warmelt-first+melt-stage1.args
> cc1: error: cannot load plugin
> /home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt.so
> /home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt.so:
> undefined symbol: warning_at

Are you building it for GCC 4.7? Some versions of GCC 4.7 (in particular Debian/Sid) are
built with the g++ compiler (ie the entire GCC is compiled in C++ mode, not in C99 mode).
% nm -D /usr/lib/gcc/x86_64-linux-gnu/4.6/cc1 | grep warning_at
000000000057d9f0 T warning_at
% nm -D /usr/lib/gcc/x86_64-linux-gnu/4.7/cc1 | grep warning_at
0000000000c27ef0 T _Z10warning_atjiPKcz
% nm -C -D /usr/lib/gcc/x86_64-linux-gnu/4.7/cc1 | grep warning_at
0000000000c27ef0 T warning_at(unsigned int, int, char const*, ...)

I suspect that by compiling both melt.so and all MELT modules with g++ it should be ok.

You'll need to edit the MELT-Plugin-Makefile and the melt-module.mk for that.

BTW, this is not a MELT specific issue. All GCC plugins have it too!
It was discussed on gcc@ or gcc-patches@

Cheers.

--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***

Alexandre Lissy

unread,
Mar 25, 2012, 2:12:09 PM3/25/12
to gcc-...@googlegroups.com
Le 25/03/2012 19:03, Basile Starynkevitch a �crit :

> On Sun, 25 Mar 2012 16:40:31 +0200
> ali...@mandriva.com wrote:
>
>> Hello,
>>
>> I'm working on updating the MELT plugin package that is living in
>> mandriva cooker. Turns out that it does not work. First stage melt.so is
>> built successfully but is unable to be loaded to continue:
>>
>> ***** doing melt-stage1/warmelt-first.c from melt-build.tpl line 343
>> doing warmelt-first+melt-stage1 from melt-build.tpl line 344
>> gcc -c @warmelt-first+melt-stage1.args
>> cc1: error: cannot load plugin
>> /home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt.so
>> /home/alex/BuildSystem/gcc-plugin-melt/BUILD/melt-0.9.4.b-plugin-for-gcc-4.6-or-4.7/melt.so:
>> undefined symbol: warning_at
>
> Are you building it for GCC 4.7? Some versions of GCC 4.7 (in particular Debian/Sid) are
> built with the g++ compiler (ie the entire GCC is compiled in C++ mode, not in C99 mode).

Yep, I mentionned it in the subject :)

> % nm -D /usr/lib/gcc/x86_64-linux-gnu/4.6/cc1 | grep warning_at
> 000000000057d9f0 T warning_at
> % nm -D /usr/lib/gcc/x86_64-linux-gnu/4.7/cc1 | grep warning_at
> 0000000000c27ef0 T _Z10warning_atjiPKcz
> % nm -C -D /usr/lib/gcc/x86_64-linux-gnu/4.7/cc1 | grep warning_at
> 0000000000c27ef0 T warning_at(unsigned int, int, char const*, ...)
>
> I suspect that by compiling both melt.so and all MELT modules with g++ it should be ok.
>
> You'll need to edit the MELT-Plugin-Makefile and the melt-module.mk for that.

Just adding a dummy warning_at entry point in melt is okay ?

Basile Starynkevitch

unread,
Mar 25, 2012, 2:43:11 PM3/25/12
to gcc-...@googlegroups.com, Alexandre Lissy
On Sun, 25 Mar 2012 20:12:09 +0200
Alexandre Lissy <ali...@mandriva.com> wrote:


I don't think that would help or be enough. We need to be sure that

melt.so

warmelt*.so

are built with g++, not gcc. Maybe we need to use ie check ENABLE_BUILD_WITH_CXX
from /usr/lib/gcc/x86_64-linux-gnu/4.7/plugin/include/auto-host.h


and we surely need to change the CC in MELT-Plugin-Makefile (actually, the occurrences of
CC) to something else. We also need to change the GCCMELT_CC in melt-module.mk (but that
is easy).

However, this issue is not MELT specific. Every GCC plugin (for 4.7, which can be
compiled both with C++ or with C) has it. Do you know how other packaged plugins solved
that issue? See e.g. http://gcc.gnu.org/ml/gcc/2012-03/msg00379.html

My feeling is that we have to do something specific to 4.7, which is the (only) release
of GCC which can be entirely (I'm talking of the C & Fortran & C++ front-ends, not Go or
Ada front-ends) compiled with either C or C++ compiler.

Do you have any suggestions? How do you solve that issue for other GCC plugins in cooker?

Alexandre Lissy

unread,
Mar 25, 2012, 3:18:49 PM3/25/12
to gcc-...@googlegroups.com
Le 25/03/2012 20:43, Basile Starynkevitch a �crit :

> On Sun, 25 Mar 2012 20:12:09 +0200
> Alexandre Lissy <ali...@mandriva.com> wrote:
>
>> Le 25/03/2012 19:03, Basile Starynkevitch a �crit :

I don't know.

But at least we can force those variables at make time, since they are
declared as "?=", but it seems there are things to fix in the code for
it to be buildable :(

>
> Cheers.
>
>
>
>
>


Basile Starynkevitch

unread,
Mar 25, 2012, 3:51:51 PM3/25/12
to gcc-...@googlegroups.com, Alexandre Lissy

I'll look inside next week (ie tomorrow, or tuesday). My main issue is to find a reliable
(and if possible "documented") way to know if GCC (actually cc1) has been compiled with a
C++03 or a C89 standard conforming compiler.

I was thinking about using ENABLE_BUILD_WITH_CXX (from 4.7/plugin/include/auto-host.h)
but perhaps there is a better way.

And I guess that distributions know better how GCC was built. It is a pity that no good
symbol appears in GCC about that.

Basile Starynkevitch

unread,
Mar 26, 2012, 10:33:10 AM3/26/12
to gcc-...@googlegroups.com
On Sun, Mar 25, 2012 at 09:51:51PM +0200, Basile Starynkevitch wrote:
> On Sun, 25 Mar 2012 21:18:49 +0200
> Alexandre Lissy <ali...@mandriva.com> wrote:
>
> > >
> > > However, this issue is not MELT specific.


I committed several changes (on the MELT branch, svn rev 185803) which make
the MELT plugin more friendly with C++ compiled gcc 4.7, but I am not done
yet.

I'll probably make a MELT plugin release as soon as I have a plugin
buildable with a C++ compiled GCC 4.7 & with a C compiled GCC 4.6

Regards.

--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France

*** opinions {are only mines, sont seulement les miennes} ***

Basile Starynkevitch

unread,
Mar 27, 2012, 1:34:14 PM3/27/12
to gcc-...@googlegroups.com, ali...@mandriva.com
On Mon, 26 Mar 2012 16:33:10 +0200
Basile Starynkevitch <bas...@starynkevitch.net> wrote:

> On Sun, Mar 25, 2012 at 09:51:51PM +0200, Basile Starynkevitch wrote:
> > On Sun, 25 Mar 2012 21:18:49 +0200
> > Alexandre Lissy <ali...@mandriva.com> wrote:
> >
> > > >
> > > > However, this issue is not MELT specific.
>
>
> I committed several changes (on the MELT branch, svn rev 185803) which make
> the MELT plugin more friendly with C++ compiled gcc 4.7, but I am not done
> yet.
>
> I'll probably make a MELT plugin release as soon as I have a plugin
> buildable with a C++ compiled GCC 4.7 & with a C compiled GCC 4.6


Hello Alexandre & the list


I just uploaded to http://gcc-melt.org/melt-0.9.5rc0-plugin-for-gcc-4.6-or-4.7.tar.gz
a gzipped tar archive of 4476533 bytes, of md5sum a66365f5bae0068a4f23d203180f5a74
a tentative tarball for the next melt 0.9.5 release which should be compilable for a C++
compiled gcc-4.7 (extracted from MELT branch svn rev 185881)

at the moment, you need to build it with make MELTGCC=gcc-4.7 GCCMELT_CC=g++-4.7

so it is not release ready yet, since I need to find out how to do tricks to detect if
gcc-4.7 has been compiled in C++ or in C.

See e.g. http://gcc.gnu.org/ml/gcc/2012-03/msg00375.html
http://gcc.gnu.org/ml/gcc/2012-03/msg00380.html
http://gcc.gnu.org/ml/gcc/2012-03/msg00411.html


Alexandre, could you check that you can compile it? Please report bugs here.

(I won't be able to read email tomorrow probably)

Cheers.

--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France

*** opinions {are only mine, sont seulement les miennes} ***

ali...@mandriva.com

unread,
Mar 28, 2012, 8:09:17 AM3/28/12
to gcc-...@googlegroups.com

It fails, see attached build log.

log.gcc-plugin-melt

Basile Starynkevitch

unread,
Mar 28, 2012, 2:12:54 PM3/28/12
to gcc-...@googlegroups.com, ali...@mandriva.com
On Wed, 28 Mar 2012 14:09:17 +0200
ali...@mandriva.com wrote:
> >
> >
> > I just uploaded to
> > http://gcc-melt.org/melt-0.9.5rc0-plugin-for-gcc-4.6-or-4.7.tar.gz
> > a gzipped tar archive of 4476533 bytes, of md5sum
> > a66365f5bae0068a4f23d203180f5a74
> > a tentative tarball for the next melt 0.9.5 release which should be
> > compilable for a C++
> > compiled gcc-4.7 (extracted from MELT branch svn rev 185881)
> >
> > at the moment, you need to build it with make MELTGCC=gcc-4.7
> > GCCMELT_CC=g++-4.7
> >
> > so it is not release ready yet, since I need to find out how to do
> > tricks to detect if
> > gcc-4.7 has been compiled in C++ or in C.
> >
> > See e.g. http://gcc.gnu.org/ml/gcc/2012-03/msg00375.html
> > http://gcc.gnu.org/ml/gcc/2012-03/msg00380.html
> > http://gcc.gnu.org/ml/gcc/2012-03/msg00411.html
> >
> >
> > Alexandre, could you check that you can compile it? Please report
> > bugs here.

> It fails, see attached build log.


Ok, try replacing the file melt/xtramelt-ana-base.melt by the one inside the MELT branch
svn rev 185922.

Tell me if it works. If it does not work, please send also me the failing generated C
code.

Thanks & cheers.

Reply all
Reply to author
Forward
0 new messages