[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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




Reply to: