JohnMBrooks / snes-sdk

Automatically exported from code.google.com/p/snes-sdk
0 stars 0 forks source link

Toolchain broken on OS X #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

Despite one problem with tcc, the toolchain build on osx with erros.
Just had to change the EIP and EBP access in tcc.c

#elif defined(__APPLE__)
         *paddr = uc->uc_mcontext->__ss.__eip;

I can give you an patch for that.

The snesc demo builds without problems. But the roms doesnt run. Just a
black screen in zsnes and bsnes. Where the linux hosted toolchain produces
a runable .smc file.

As i diff the obj files generated under linux and osx i get differences. 
I guess i can narrow this problem down to wla. Did u patch wla because
it says its version 5.7 but has more commandline switches than my vanilla
5.7 version. Most noticeably that your version doenst need a linkfile with
the object names.

I tried to to use my wla toolchain but by wla-65816 fails building snesc.s

wla-65816 -io snesc.s snesc.obj
snesc.s:3648: DIRECTIVE_ERROR: ROM banks == 8, selected bank 127.
snesc.s:3648: ERROR: Couldn't parse "ram.data".
make: *** [snesc.obj] Error 1

I not sure where to start debugging. Maybe you give an hint what i should
be looking at.

Original issue reported on code.google.com by david.vo...@gmail.com on 28 Apr 2009 at 9:07

GoogleCodeExporter commented 9 years ago
I have no involvement in this project, but I do know how WLA-DX works. I was 
intreged
by the changes that they made, so I had a look.

I have no idea why the snes-sdk varient of WLA-DX is not working on your mac, 
but I
do know of the changes made to WLA-DX

The first one incolves .RAMSECTIONS, which is handled in the first pass, so I 
did a
quick look and found:

pass_1.c:
#if 0 /* bullshit: this is a _RAM_ section */
      if (rombanks <= d && output_format != OUTPUT_LIBRARY) {
                                sprintf(emsg, "ROM banks == %d, selected bank %d.\n",
rombanks, d);
                                print_error(emsg, ERROR_DIR);
                                return FAILED;
      }
#endif

      sec_tmp->bank = d;
    }

I've commented out the offending section in WLA-DX 9.5a, compiled it and 
managed to
compile the snesc example with it.

There have been very little changes to wlalink, the only two being the 
inclusion of
the -o and the -n parameter.

The -o parameter works as advertised.

If the -n parameter is not used (it should be the other way around), wlalink 
appends
crt0_snes.obj,libm.obj, libtcc.obj & libc.obj to the list of objects to load.

---
hope this helps.

Original comment by undisbeliever@gmail.com on 2 May 2009 at 1:08

GoogleCodeExporter commented 9 years ago
Hey, i  dissambled the linux and mac object to track down what the problem with 
wla
on os x. Maybe you can have a look and see whats going wrong.

http://github.com/optixx/snes-sdk/tree/bad62d56343b007cffe59f01bca85c503c303b95/
test

Original comment by david.vo...@gmail.com on 6 May 2009 at 9:32

GoogleCodeExporter commented 9 years ago
This issue was closed by r16.

Original comment by ulrich.h...@gmail.com on 30 Jul 2009 at 7:14

GoogleCodeExporter commented 9 years ago
Fixed in r15/r17. The section sorting code in wlalink was broken. It sorted 
sections
by name, but not by file ID, which is necessary to ensure that the TCC
pseudo-registers start at zero (I don't currently remember what precisely 
relies on
that, but there is something somewhere...). It just so happens that on Linux, 
the
sections are already in the right order, but not on OSX.

Original comment by ulrich.h...@gmail.com on 30 Jul 2009 at 7:15

GoogleCodeExporter commented 9 years ago
That was supposed to say r16/r17, of course.

Original comment by ulrich.h...@gmail.com on 30 Jul 2009 at 7:17