bug-coreutils
[Top][All Lists]
Advanced

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

Re: Cros-Compiled binaries used by host when Cross-Compiling Coreutils.


From: Ulf Samuelsson
Subject: Re: Cros-Compiled binaries used by host when Cross-Compiling Coreutils.
Date: Tue, 17 Jul 2007 20:07:32 +0200

----- Original Message ----- 
From: "Bob Proulx" <address@hidden>
To: "Ulf Samuelsson" <address@hidden>
Cc: <address@hidden>
Sent: Tuesday, July 17, 2007 6:35 PM
Subject: Re: Cros-Compiled binaries used by host when Cross-Compiling Coreutils.


> Ulf Samuelsson wrote:
>> When cross-compiling coreutils-6.9 for ARM from buildroot
>> I noticed that the Makefile.am and Makefile.in are using 
>> rm, mv, chmod, chown.
> 
> Yes, that is correct.
> 
>> Since these commands are also built in the coreutils-6.9/src,
>> the "make" in this directory will use the recently built ARM binaries
>> after they have been built instead of the coreutils on the host machine.
> 
> This indicates to me that you have "." in your PATH too early.  What
> is the value of your PATH?
> 
>  echo $PATH
> 
> Try adjusting your PATH to either remove "." from it entirely (many
> believe it to be a security risk there) or to place it at the end of
> your PATH.
> 
>> It would be better to use 
>> /bin/rm, /bin/mv, /bin/chmod, /bin/chown
>> when building in this directory.
> 
> No, that would be incorrect.  Using full hard coded paths is almost
> always an additional source of problems.
> 
> Bob
>

I realized that the path was a problem, and I removed the "." from the PATH
in ".bashrc" but the problems remained.
The makefile seems to call "./rm" at some stage, and I am screwed
Further checking now shows that the "." remains in the PATH,
so maybe I have to logout-login. .

I think the best approach is that the configure script
figures out what the path is to these tools and uses the path.

Something like this is used in the buildroot system for other things:
ifndef HOST_RM
HOST_RM:=rm
endif
HOST_RM:=$(shell $(CONFIG_SHELL) -c "which $(HOST_RM)" || type -p $(HOST_RM) || 
echo rm)

and could be used for the rm/mv/chmod/chown.
Seems like "make" has the same problem, if you build it, then
it starts to use the recent copy of make, which is not so nice for cross 
compilation.

Best Regards
Ulf Samuelsson





reply via email to

[Prev in Thread] Current Thread [Next in Thread]