6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 9:37 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Aug 27, 2024 2:02 pm 
Offline

Joined: Thu Dec 26, 2002 12:29 pm
Posts: 81
Location: Occitanie, France
Hi all,
The PLASMA evaluation got put to the side for the moment - I have another (what was supposed to be little) project on the go at the moment...
I need to use the cc65 suite to compile & run a short program that was provided by one of my sons. The program works a treat compiled on linux (with gcc) and I wanted to show him what it looked like in 6502 lingo... His coding is OK, and the cc65 compiler doesn't complain about anything.
So far, so good...
I thought that this would be a good time to put my new 65C02 Picocomputer through some hoops. So my cc65 now has the rp6502 target in place, I have the .cfg file, etc.
When I try linking the whole thing together, the linker complains about tons of unresolved externals, like "tosaddax", "tosgeax"... These are helper shims that are in the runtime library. Normally the <target>.lib library file is actually a merge of the runtime library AND the <target>'s specific routines. And, if I look at the rp6502.lib file with a hex editor, I can see the different exports of all of the "missing" externals.
So, what am I missing, or doing wrong ?
Please help, my "Dad always wins" score is dwindling fast.
P.S. This is the sequence of compiling
Code:
cc65 -t none --cpu 65c02 greg.c
ca65 --cpu 65c02 greg.s
ca65 --cpu 65c02 crt0.s
ca65 --cpu 65c02 ria.s
ca65 --cpu 65c02 oserror.s
ld65 -v --allow-multiple-definition --target rp6502 --lib rp6502.lib -m greg.map crt0.o ria.o oserror.o greg.o

_________________
Glenn-in-France


Last edited by GlennSmith on Tue Aug 27, 2024 5:21 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 27, 2024 3:46 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
Hi Glenn,

I'm am not an expert on CC65, but I did manage to build new targets supporting some of my projects.

After compiling the new library, I would use the cl65 command line to build an application. here's a copy of my DOS batch file:

Code:
set CC65LIB=c:\cc65\lib
cl65 -t none -C avrr.cfg -o enet -m enet.map -l %CC65LIB%\avrr.o main.c uip.c uip_arch.c appcall.c httpd.c fs.c cgi.c uip_arp.c enceth.s adc.c %CC65LIB%\avrr.lib


I used "-t none" because I was using a direct reference to my cfg file "-C avrr.cfg" You cannot use both.

The "-o enet" defines the output file

The "avrr.o" file is the same as "crt0.o" ( I just rename to match the library file as I build it when I build the library)

Notice you can mix .c and .s files in the source list.

This would work for me. If you want to post a zip of all your source and library files, I can try to compile them and figure out what might be wrong or missing.

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 27, 2024 4:03 pm 
Offline

Joined: Sat Dec 12, 2015 7:48 pm
Posts: 145
Location: Lake Tahoe
Try reordering your .o and library files in the command line. Put the the .o files you compiled first, then the pre-built .o and library files last. You want the references to search from left to right. Something like:

Code:
ld65 -v --allow-multiple-definition --target rp6502 -m greg.map  greg.o ria.o oserror.o  crt0.o --lib rp6502.lib


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 27, 2024 5:20 pm 
Offline

Joined: Thu Dec 26, 2002 12:29 pm
Posts: 81
Location: Occitanie, France
resman wrote:
Put the the .o files you compiled first, then the pre-built .o and library files last. You want the references to search from left to right.

Just plain magic !
Thanks man!

_________________
Glenn-in-France


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 28, 2024 4:57 am 
Offline

Joined: Sat Dec 12, 2015 7:48 pm
Posts: 145
Location: Lake Tahoe
I just want you to get back to PLASMA ;-)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: xlar54 and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: