Problem with GCC in-tree plugin build (autoconf, libtool).
U.Mutlu
um@mutluit.com
Thu Jul 12 19:38:00 GMT 2018
I think you have put -DHAVE_CONFIG_H into LDFLAGS.
Try it with LDFLAGS="" in your build script.
U.Mutlu wrote on 07/12/2018 08:22 PM:
> 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).
>
>
>
More information about the Gcc-help
mailing list