This is the mail archive of the
mailing list for the GCC project.
Re: [Patch] Fix the testcases that use bind_pic_locally
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Vidya Praveen <vidyapraveen at arm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, marcus dot shawcroft at arm dot com, janisjo at codesourcery dot com, mikestump at comcast dot net
- Date: Tue, 8 Oct 2013 11:30:22 +0200
- Subject: Re: [Patch] Fix the testcases that use bind_pic_locally
- Authentication-results: sourceware.org; auth=none
- References: <20131008091458 dot GA2667 at e103625-lin dot cambridge dot arm dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Oct 08, 2013 at 10:14:59AM +0100, Vidya Praveen wrote:
> There are several tests that use "dg-add-options bind_pic_locally" in order to
> add -fPIE or -fpie when -fPIC or -fpic are used respectively with the expecta-
> tion that -fPIE/-fpie will override -fPIC/-fpic. But this doesn't happen since
> since -fPIE/-fpie will be added before the -fPIC/-fpic (whether -fPIC/-fpic is
> added as a multilib option or through cflags). This is essentially due to the
> fact that cflags and multilib flags are added after the options are added
> through dg-options, dg-add-options, et al. in default_target_compile function.
> Assuming dg-options or dg-add-options should always win, we can fix this by
> modifying the order in which they are concatenated at default_target_compile in
> target.exp. But this is not recommended since it depends on everyone who tests
> upgrading their dejagnu (refer ).
This looks like a big step backwards and I'm afraid it can break targets
where -fpic/-fPIC is the default. If dg-add-options bind_pic_locally must
add options to the end of command line, then can't you just push the options
that must go last to some variable other than dg-extra-tool-flags and as we
override dejagnu's dg-test, put it in our override last (or in whatever
other method that already added the multilib options)?