This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Telling plugins about build,host,target triplet strings
On Wed, Sep 05, 2012 at 03:14:40PM +0000, Joseph S. Myers wrote:
> On Wed, 5 Sep 2012, Basile Starynkevitch wrote:
>
> > const char* plugin_build_triplet (void);
>
> I think if you want to tell the plugin about the build triplet in this
> sort of way, there is some fundamental confusion involved. A compiler
> built for a given host and target pair should behave the same independent
> of what system it was built on (what the build triplet was) - and
> similarly, such a compiler could use plugins built on different systems
> from the build system on which the compiler itself was built (whereas all
> plugins would need to be configured for the same host and target as the
> compiler).
I agree that the build triplet is not important and could stay secret to plugins.
However, we still need:
const char* plugin_host_triplet (void);
const char* plugin_target_triplet (void);
and I still have no clues of how to get that information
(so I am not yet able to submit a patch).
>
> The target triplet is proper information for a plugin to enquire about.
> The build triplet definitely is not. The host triplet probably isn't
> either (compilers for the same target, and different hosts, should also
> behave the same) although there may be some limited use cases where your
> plugin is explicitly not following the conventions of GCC proper regarding
> host-independence. Your use case for testing sounds like something where
> the build infrastructure for your plugin should be determining what to do
> depending on the triplets, rather than the plugin itself knowing about
> them.
Well, to take a concrete example, I don't understand well how on Debian/Sid can I know that the
gcc-4.6-plugin-dev package is for x86-64-unknown-linux. the files provided by that package don't tell much.
Or are you suggesting I should use the packaging metainformation?
Ian Taylor suggested in http://gcc.gnu.org/ml/gcc/2012-08/msg00339.html
to use CROSS_DIRECTORY_STRUCTURE but I can't find it there.
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} ***