This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [build, lto] Only accept -fuse-linker-plugin if linker supports -plugin (PR lto/46944)


Richard Guenther <rguenther@suse.de> writes:

>> > Can we to fix 46944 change the dejagnu require-linker-plugin
>> > to check if a linker plugin is used by default and not add
>> > -fuse-linker-plugin?
>> 
>> That might be involved since it requires parsing gcc -Wl,-debug output.
>> I suppose the solution outlined above is simpler and thus more robust.
>
> It might be as simple as
>
> int res;
> int main() { int x; asm ("mov res, %0" : x(g)); return x; }
>
> which should fail to link with the plugin only (but yes, requies
> target dependent assembly ...).

... which I'd consider far too complicated/hard to maintain to consider.

> Or, use -save-temps and check for the existence of the resolution
> file for int main() {}.  It should be named t.res for gcc -o t t.c -flto.

Only with -save-temps, otherwise it's some random file in /var/tmp.  But
even so the file is removed immediately.

And even if we decide to fix PR lto/46944 like this, we're still left
with the problem of users invoking gcc with -fuse-linker-plugin and
getting either strange errors or no effect instead of a clear
diagnostic.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]