cc65 / cc65

cc65 - a freeware C compiler for 6502 based systems

Home Page:https://cc65.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[C128] Can't target C128 with linux compiler

Divarin opened this issue · comments

Discussed in #2439

Originally posted by Divarin April 5, 2024
Simple hello world program for C128:

#include <stdio.h>
#include <c128.h>

void main()
{
	printf("Hello World!\n");
}

Compile using Linux compiler:
~/git/cc65/bin/cc65 -t c128 hello.c
~/git/cc65/bin/cl65 term.s -o term.prg

Run in VICE (128), garbage on the screen.
Run in VICE (64) works fine.

Compile same source with windows compiler through wine:
wine ~/work/code/cc65/bin/cc65.exe -t c128 term.c
wine ~/work/code/cc65/bin/cl65.exe term.s -o term.prg

Run in VICE (128) works fine.
Run in VICE (64) nothing happens.

It looks like the Linux version of the compiler is not targeting C128 but actually C64.

  1. which version of cc65
  2. if latest git master, maybe you can diff the generated asm or map files of win vs linux version and find out where it goes wrong

adding "-t c128" to cl65.exe works, don't know why this wasn't needed when using the windows linker.

Versions:
Windows - cl65.exe V2.19 - Git a0d986f
Linux - cl65 V2.19 - Git b993d88

No idea what you did there, but if you don't give the target switch to cl65, it will use c64 target - that's expected :)