Re: [cc65] cl65 bugs

From: Greg King <gngking1erols.com>
Date: 2006-06-28 08:38:01
From: Groepaz; on Sunday, June 25, 2006; at 10:37 PM -0400
>
> While working with the Contiki 2.x port, I noticed some bugs in the cl65
> program:
>
> 1) Create a directory structure like this:
>
> /root
>   /1
>   /2
>     /obj
>
> Place a source file in /root/1, and change workdir to /root/2.  Now,
> compile the source file using a command like
>
> root/2> cl65 -c ../1/foo.c -o obj/out.o
>
> The object will not end up in /root/2/obj as expected, but it will be
> created in /root/1 instead.  If you compile by invoking cc65 directly,
> it works as expected, so the bug is obviously in cl65.
>
> 2) cl65 doesn't honour the argument to the -o option as expected.
> If you compile something like this:
>
> cl65 -c foo.c -o out.co
>
> it will not create "out.co" as expected, but "out.o" instead.  Again,
> when using cc65 directly, this works as expected.

"It's not a bug -- it's a feature!"  ;-)

cl65 isn't as smart as gcc.  It doesn't look "over the hedge" to see what
else will be coming on the command line.  Instead, it obeys each object as
soon as it reaches that object.  cl65 compiles/assembles each source file
when it reaches that file's name on the line -- cl65 uses only the options
that it already has seen.

Those "-o" options are in the wrong place.  You must change the
command-rules in the makefiles.  Actually, it generally is a good idea to
put all option objects on the left side of command lines, and to put all
non-option objects on the right side of those lines (that advice is true
for most commands).

root/2> cl65 -I .. -c -o obj/out.o ../1/foo.c

root/2> cl65 -o out.co --add-source -c foo.c
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Jun 28 08:38:16 2006

This archive was generated by hypermail 2.1.8 : 2006-06-28 08:38:19 CEST