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

2007-07-17 Thread Ulf Samuelsson
- Original Message - 
From: "Bob Proulx" <[EMAIL PROTECTED]>
To: "Ulf Samuelsson" <[EMAIL PROTECTED]>
Cc: 
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



___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


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

2007-07-17 Thread Ulf Samuelsson
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.

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.

It would be better to use 
/bin/rm, /bin/mv, /bin/chmod, /bin/chown
when building in this directory.


Best Regards
Ulf Samuelsson



___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils