FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 05-18-2010, 06:41 PM
"Moffett, Kyle D"
 
Default Bug#579779: debian/rules2: Fix REVERSE_CROSS build (host == target,host != build)

On 2010/05/17 09:28, "Matthias Klose" <doko@debian.org> wrote:

> On 30.04.2010 19:51, Kyle Moffett wrote:
>> Package: gcc-4.4
>> Version: 4.4.2-9
>> Severity: normal
>> Tags: patch sid
>>
>> If "CC" is left unset, it defaults to "cc" and causes the compiler to
>> be built to run on the build system instead of on the host.
>>
>> Signed-off-by: Kyle Moffett<Kyle.D.Moffett@boeing.com>
>> ---
>> debian/rules2 | 2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/debian/rules2 b/debian/rules2
>> index 623eefb..252c671 100644
>> --- a/debian/rules2
>> +++ b/debian/rules2
>> @@ -82,6 +82,8 @@ $(foreach v, CPPFLAGS CFLAGS CXXFLAGS FFLAGS LDFLAGS, $(if
>> $(filter environment,
>>
>> ifneq ($(REVERSE_CROSS),yes)
>> CC = $(if $(filter yes,$(with_ada)),gnatgcc,gcc)
>> +else
>> + CC =
>> endif
>>
>> ifneq ($(distribution),Ubuntu)
>
> the patch in this form breaks the native build

As far as I can tell the "else" clause I added would only be executed if
REVERSE_CROSS has a value of "yes", which is by-definition not a native
build. My own test-build of a native compiler on amd64 seemed to work fine.
Do you have a sample build log of a failure with this patch?

I was also able to successfully crossbuild gcc-4.4 to run on my powerpcspe
system with this patch. Without the patch it tried to use "cc" as the
amd64-to-powerpcspe compiler. The crossbuild was executed as follows:
dpkg-buildpackage -us -uc -b -apowerpcspe

The problem right now with a REVERSE_CROSS build is the following flow:

## Make initializes the variable by default:
CC = cc

## The following if statement is not true (REVERSE_CROSS==yes)
ifneq ($(REVERSE_CROSS),yes)
...
endif

## Now we run configure
configure-stamp:
../src/configure --host=... --build=... --target=... CC=$(CC)

If you omit the "CC=" variable entirely (or give it an empty value) then the
configure script makes appropriate guesses based on the --host, --build, and
--target arguments.

Cheers,
Kyle Moffett

--
Kyle Moffett
eXMeritus Software
Integrated Intelligence
The Boeing Company

(703) 764-0925
Kyle.D.Moffett@boeing.com




--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: C818578C.879A%Kyle.D.Moffett@boeing.com">http://lists.debian.org/C818578C.879A%Kyle.D.Moffett@boeing.com
 
Old 05-19-2010, 04:45 AM
"Moffett, Kyle D"
 
Default Bug#579779: debian/rules2: Fix REVERSE_CROSS build (host == target,host != build)

On 2010/05/18 16:49, "Matthias Klose" <doko@debian.org> wrote:
> On 18.05.2010 20:41, Moffett, Kyle D wrote:
>> On 2010/05/17 09:28, "Matthias Klose"<doko@debian.org> wrote:
>>> On 30.04.2010 19:51, Kyle Moffett wrote:
>>>> Package: gcc-4.4
>>>> Version: 4.4.2-9
>>>> Severity: normal
>>>> Tags: patch sid
>>>>
>>>> If "CC" is left unset, it defaults to "cc" and causes the compiler to
>>>> be built to run on the build system instead of on the host.
>>>>
>>>> Signed-off-by: Kyle Moffett<Kyle.D.Moffett@boeing.com>
>>>> ---
>>>> debian/rules2 | 2 ++
>>>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/debian/rules2 b/debian/rules2
>>>> index 623eefb..252c671 100644
>>>> --- a/debian/rules2
>>>> +++ b/debian/rules2
>>>> @@ -82,6 +82,8 @@ $(foreach v, CPPFLAGS CFLAGS CXXFLAGS FFLAGS LDFLAGS,
>>>> $(if
>>>> $(filter environment,
>>>>
>>>> ifneq ($(REVERSE_CROSS),yes)
>>>> CC = $(if $(filter yes,$(with_ada)),gnatgcc,gcc)
>>>> +else
>>>> + CC =
>>>> endif
>>>>
>>>> ifneq ($(distribution),Ubuntu)
>>>
>>> the patch in this form breaks the native build
>>
>> As far as I can tell the "else" clause I added would only be executed if
>> REVERSE_CROSS has a value of "yes", which is by-definition not a native
>> build. My own test-build of a native compiler on amd64 seemed to work fine.
>> Do you have a sample build log of a failure with this patch?
>
> apply it to the gnat-4.4 source. Is the correct gnatgcc selected?

I must confess to ignorance of the reasoning for the separate "gnatgcc" for
building Ada, but even still from what I understand that build still has
REVERSE_CROSS=no. In my (admittedly brief) test, a native gnat build did
indeed correctly use "gnatgcc".

I also haven't had any luck making *any* bits of gnat or Ada work in a
REVERSE_CROSS=yes build anyways, so as far as I can tell that's a moot
point.

So if you are definitely seeing build failures with that patch I can only
suggest maybe rewriting it like this (with the "ifneq" rearranged as an
"ifeq" to make it more obvious what's going on).

ifeq ($(REVERSE_CROSS),yes)
CC = $(DEB_HOST_GNU_TYPE)-$(if $(filter yes,$(with_ada)),gnatgcc,gcc)
else
CC = $(if $(filter yes,$(with_ada)),gnatgcc,gcc)
endif

But even with that change I still can't cross-compile the gnat bits.

Cheers,
Kyle Moffett

--
Kyle Moffett
eXMeritus Software
Integrated Intelligence
The Boeing Company

(703) 764-0925
Kyle.D.Moffett@boeing.com




--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: C818E530.87B5%Kyle.D.Moffett@boeing.com">http://lists.debian.org/C818E530.87B5%Kyle.D.Moffett@boeing.com
 

Thread Tools




All times are GMT. The time now is 10:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org