public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Force crosstool-NG to build with a specific compiler?
@ 2015-09-28 13:19 Jean-Marie Lemetayer
  2015-09-28 22:29 ` Jasmin J.
  0 siblings, 1 reply; 3+ messages in thread
From: Jean-Marie Lemetayer @ 2015-09-28 13:19 UTC (permalink / raw)
  To: crossgcc

Hi,

I am currently testing Travis-ci and the needed configurations to do a
proper continuous integration.

Travis-ci allow us to configure which C compiler we want to use (GCC
or CLANG) to build our project. I think it could be good to test if
crosstool-NG (the host part) can be build with both.

The problem is that Travis-ci just export a CC variable at the
beginning of the build to configure the compiler. This is not good
because the CC variable interferes with the configure / Makefile used
in the build process (especially in the target parts) . And it can
replace a `arm-unknown-linux-gnueabi-gcc` into a `gcc` ...

So I am wondering if there is an easy way to choose which base
compiler we want for the host part?

Regards,
JML

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Force crosstool-NG to build with a specific compiler?
  2015-09-28 13:19 Force crosstool-NG to build with a specific compiler? Jean-Marie Lemetayer
@ 2015-09-28 22:29 ` Jasmin J.
  2015-09-29  0:32   ` Bryan Hundven
  0 siblings, 1 reply; 3+ messages in thread
From: Jasmin J. @ 2015-09-28 22:29 UTC (permalink / raw)
  To: crossgcc

Hello JML!

> The problem is that Travis-ci just export a CC variable at the
Using CC= is a very bad idea, which you already described. This is used
by gnu make implicit rules and by some configure scripts, too.
The solution is to use another environment variable.

> So I am wondering if there is an easy way to choose which base
> compiler we want for the host part?
This is currently hard coded (detected my "which") by CT-NG, as far as I have
analysed in the last couple of minutes.

When you look to ".build/<compiler_to_build>/buildtools/bin"
you will see a lot of short shell scripts. This are the tools (including the
compiler) which is used by CT-NG to build all the host tools. This short
scripts are generated by "scripts/crosstool-NG.sh" beginning at line 408.
You will see some lines with "where=...".

You could add the check for an environment variable (e.g.: CT_TOOL_BUILD_gcc,
CT_TOOL_BUILD_as, ...), defining the tool location/name to use.
Then define the environment variables for the tools you would like to override
in the .travis.yml file.

BR
   Jasmin

*******************************************************************

On 09/28/2015 03:18 PM, Jean-Marie Lemetayer wrote:
> Hi,
> 
> I am currently testing Travis-ci and the needed configurations to do a
> proper continuous integration.
> 
> Travis-ci allow us to configure which C compiler we want to use (GCC
> or CLANG) to build our project. I think it could be good to test if
> crosstool-NG (the host part) can be build with both.
> 
> The problem is that Travis-ci just export a CC variable at the
> beginning of the build to configure the compiler. This is not good
> because the CC variable interferes with the configure / Makefile used
> in the build process (especially in the target parts) . And it can
> replace a `arm-unknown-linux-gnueabi-gcc` into a `gcc` ...
> 
> So I am wondering if there is an easy way to choose which base
> compiler we want for the host part?
> 
> Regards,
> JML
> 
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
> 

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Force crosstool-NG to build with a specific compiler?
  2015-09-28 22:29 ` Jasmin J.
@ 2015-09-29  0:32   ` Bryan Hundven
  0 siblings, 0 replies; 3+ messages in thread
From: Bryan Hundven @ 2015-09-29  0:32 UTC (permalink / raw)
  To: Jasmin J.; +Cc: crossgcc maillist

Jasmin, Jean-Marie, et al.,

On Mon, Sep 28, 2015 at 3:29 PM, Jasmin J. <jasmin@anw.at> wrote:
> Hello JML!
>
>> The problem is that Travis-ci just export a CC variable at the
> Using CC= is a very bad idea, which you already described. This is used
> by gnu make implicit rules and by some configure scripts, too.
> The solution is to use another environment variable.

+1

>> So I am wondering if there is an easy way to choose which base
>> compiler we want for the host part?
> This is currently hard coded (detected my "which") by CT-NG, as far as I have
> analysed in the last couple of minutes.
>
> When you look to ".build/<compiler_to_build>/buildtools/bin"
> you will see a lot of short shell scripts. This are the tools (including the
> compiler) which is used by CT-NG to build all the host tools. This short
> scripts are generated by "scripts/crosstool-NG.sh" beginning at line 408.
> You will see some lines with "where=...".

Developer education reminds me that we need some developer documentation.

> You could add the check for an environment variable (e.g.: CT_TOOL_BUILD_gcc,
> CT_TOOL_BUILD_as, ...), defining the tool location/name to use.
> Then define the environment variables for the tools you would like to override
> in the .travis.yml file.

I think this is a bad idea.

One regex option to say the host prefix would do the trick.
I know on debian there is a: 'x86_64-linux-gnu-' prefix... which is
also detected by ccache and the crosstool-ng autoconf script.

The variables already exist. The right thing needs to happen in either
'scripts/crosstool-NG.sh.in' or in 'scripts/functions'. I haven't
looked.

Again, developer documentation would be most appreciative! :)

> BR
>    Jasmin

Cheers,

-Bryan

>
> *******************************************************************
>
> On 09/28/2015 03:18 PM, Jean-Marie Lemetayer wrote:
>> Hi,
>>
>> I am currently testing Travis-ci and the needed configurations to do a
>> proper continuous integration.
>>
>> Travis-ci allow us to configure which C compiler we want to use (GCC
>> or CLANG) to build our project. I think it could be good to test if
>> crosstool-NG (the host part) can be build with both.
>>
>> The problem is that Travis-ci just export a CC variable at the
>> beginning of the build to configure the compiler. This is not good
>> because the CC variable interferes with the configure / Makefile used
>> in the build process (especially in the target parts) . And it can
>> replace a `arm-unknown-linux-gnueabi-gcc` into a `gcc` ...
>>
>> So I am wondering if there is an easy way to choose which base
>> compiler we want for the host part?
>>
>> Regards,
>> JML
>>
>> --
>> For unsubscribe information see http://sourceware.org/lists.html#faq
>>
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-29  0:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-28 13:19 Force crosstool-NG to build with a specific compiler? Jean-Marie Lemetayer
2015-09-28 22:29 ` Jasmin J.
2015-09-29  0:32   ` Bryan Hundven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).