Package: kernel-package
Version: 8.125
Severity: minor
Tags: patch

From: Horms <[EMAIL PROTECTED]>
Date: Wed, 2 Mar 2005 17:46:33 +0900
> When using --cross-compile XXX, make-kpkg sets the environment
> variable CROSS_COMPILE=XXX. It subsequently also sets
> CROSS_ARG="CROSS_COMPILE=XXX-".

Hmm...  
It seems that make-kpkg script assumes --cross-compile or --cross_compile
is to be set "XXX-".
--- make-kpkg ---
  my $cc = $ENV{'CC'} if $ENV{'CC'};
  $cc =~ s/^\s+//g if $cc;
  $cc =~ s/\s+$//g if $cc;
  $cc .= " ";
  if ($cc eq ' ') { $cc = $cross_compile; $cc .= "gcc "; };
---                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      
                      ...  this code assumes $cross_compile includes "-".
                        

> Most invocations of Make for the kernel tree's toplevel Makefile
> are of the form make ... $CROSS_ARG ... target. And this works fine.
> However, in some cases $CROSS_ARG is missing an this causes warnings
> to be displayed as make picks up the value of CROSS_COMPILE from
> the environment, which is XXX instead of XXX-.
> 
> I think that the warnings are harmless but it is at the very least 
> confusing. The attached patch seems to resolve the problem.
> However, perhaps a better fix would be to have make-kpkg
> set CROSS_COMPILE=XXX- and abandon CROSS_ARG all together.

Actually, it breaks kernel compilation.
ex.)
  For environment variable CROSS_COMPILE=m32r-linux-, 
  "-" is duplicated and it causes errors.

  make: m32r-linux--gcc: Command not found

In case of using a environement variable CROSS_COMPILE, 
I think the variable CROSS_COMPILE should keep "XXX-", because a kernel
must be able to be compiled without a make-kpkg script.


> However, perhaps a better fix would be to have make-kpkg
> set CROSS_COMPILE=XXX- and abandon CROSS_ARG all together.

I agree with you in a point of CROSS_COMPILE must keep "XXX-".

Please let me summarize:
  1) If we use --cross-compile, we have to specify --cross-compile "XXX-".
     --cross-compile "XXX-" sets a make variable CROSS_COMPILE="XXX-", which
     is used to set CROSS_ARG.
  2) If not --cross-compile is specified, an environment variable
     CROSS_COMPILE(=XXX-) is used to set CROSS_ARG.

Anyway, we should always specify --cross-compile or CROSS_COMPILE in
"XXX-" style (with a "-" character at the last).


Therefore, I think an additional patch is required as follows:

--- kernel-package-8.125.org/kernel/rules       2005-03-02 01:52:17.000000000 
+0900
+++ kernel-package-8.125/kernel/rules   2005-03-07 22:38:15.243926272 +0900
@@ -118,7 +118,7 @@ ifndef CROSS_COMPILE
     endif
   endif
 else
-  KERNEL_CROSS:=$(CROSS_COMPILE)-
+  KERNEL_CROSS:=$(CROSS_COMPILE)
 endif
 
 ifneq ($(strip $(KERNEL_CROSS)),)


Please apply this.
Thank you.
--
Hirokazu Takata <[EMAIL PROTECTED]>
Linux/M32R Project:  http://www.linux-m32r.org/



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to