[Bug c/53529] New: assembler errors while building a cross compiler if . (dot) is in your PATH

2012-05-30 Thread bernard.van.duijnen at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53529

 Bug #: 53529
   Summary: assembler errors while building a cross compiler if .
(dot) is in your PATH
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: bernard.van.duij...@oracle.com


If you have . (current directory) in your PATH in front of the location of
the system assembler (typically /usr/bin/as) then while building the
cross compiler the wrong assembler is called, resulting in errors about an
unrecognized option or bad opcodes. The mixup is with the generated
shell script as in the gcc sub directory of the build tree. This shell
script points to the target-as and at this stage the host-as is needed.

Took me quit a while to diagnose the root cause as this is not so easy to find.


[Bug c/53529] assembler errors while building a cross compiler if . (dot) is in your PATH

2012-05-30 Thread bernard.van.duijnen at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53529

--- Comment #2 from Bernard van Duijnen  
2012-05-30 15:49:43 UTC ---
(In reply to comment #1)
> Don't do it then?  Having . in $PATH is a severe security issue anyway.

Typically it is unsecure yes, but not always. For instance on my ubuntu
laptop where I am the one and only user I do not think that is an issue.

Its easy to fix your PATH to solve it, but only once you know that is
the issue, just a check to catch the situation and give a warning is a
sufficient solution.