This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with GCC in-tree plugin build (autoconf, libtool).
- From: "U.Mutlu" <um at mutluit dot com>
- To: Oleg Ogurtsov <o dot ogurtsov at samsung dot com>, gcc-help at gcc dot gnu dot org
- Cc: Vyacheslav Barinov <v dot barinov at samsung dot com>
- Date: Thu, 12 Jul 2018 20:22:40 +0200
- Subject: Re: Problem with GCC in-tree plugin build (autoconf, libtool).
- References: <CGME20180712134801eucas1p1839ddb06805abb7a23b843b5a199fd84@eucas1p1.samsung.com> <20180712134801eucas1p1839ddb06805abb7a23b843b5a199fd84~Aoyu0a3Kd2370023700eucas1p1g@eucas1p1.samsung.com>
Oleg Ogurtsov wrote on 07/12/2018 03:47 PM:
Hello.
I try to build a plug-in written in C++ inside GCC tree, but the build is
interrupted with an error:
'libtool: error: unrecognised option: '-DHAVE_CONFIG_H''.
The launch string begins with
'/bin/sh ../libtool --tag=CXX --mode=compile -DHAVE_CONFIG_H -I.'.
Apparently libtool doesn't add compiler name to line (xg++).
The libtool file has a line with language specific compiler for CXX has xgcc,
instead of xg++:
'CC="/home/abuild/rpmbuild/BUILD/gcc-6.2.1/obj/./gcc/xgcc -shared-libgcc -B/home/abuild/rpmbuild/BUILD/gcc-6.2.1/obj/./gcc -nostdinc++
-L/home/abuild/rpmbuild/BUILD/gcc-6.2.1/obj/x86_64-tizen-linux-gnu/libstdc++-v3/src
-L/home/abuild/rpmbuild/BUILD/gcc-6.2.1/obj/x86_64-tizen-linux-gnu/libstdc++-v3/src/.libs -L/home/abuild/rpmbuild/BUILD/gcc-6.2.1/obj/x86_64-tizen-linux-gnu/libstdc++-v3/libsupc++/.libs -B/usr/x86_64-tizen-linux-gnu/bin/ -B/usr/x86_64-tizen-linux-gnu/lib/ -isystem /usr/x86_64-tizen-linux-gnu/include -isystem /usr/x86_64-tizen-linux-gnu/sys-include "'
The configure.ac has AC_PROG_CXX, and building the plugin separately is successful.
Can anybody tell what am I missing?
Is your plugin placed under the gcc source tree?
See ../gcc_src/lto-plugin for inspirations.
Yours is written in C++, the lto-plugin is written in C.
So, there could be a bug in the configure script of your plugin
as your observation (xgcc vs. xg++) indicates.
Ie. check your autoconf/automake scripts (configure.ac, Makefile.am)
that creates the configure script.
Try also this in the plugin src dir:
aclocal
autoheader
automake
automake --add-missing
autoconf
Check also the errors ($ grep "error: " config.log) generated by the plugin
configure script.
The main configure and make should be fired from inside the same build script
(otherwise differences in the evironment can happen).