cubanismo / jaguar-sdk

A Complete SDK Environment for the Atari Jaguar
32 stars 3 forks source link

Compiling samples #12

Open PJM-NCC-70511 opened 1 year ago

PJM-NCC-70511 commented 1 year ago

I set up jaguar-sdk with msys2. Got everything copied into the Jaguar-sdk folder. gcc already was installed. When I type makefile, this is what I get: ./make: line 1: JAGSDK: command not found ./make: line 1: include: command not found ./make: line 5: OBJS: command not found ./make: line 9: PROGS: command not found ./make: line 11: OBJS: command not found ./make: line 11: jaghello.cof:: command not found LINK: missing operand Try 'LINK --help' for more information. ./make: line 12: LINKFLAGS: command not found ./make: line 12: OBJS: command not found ./make: line 12: -o: command not found ./make: line 15: PROGS: command not found ./make: line 15: go:: command not found ./make: line 16: JCP: command not found ./make: line 16: PROGS: command not found ./make: line 18: JAGSDK: command not found ./make: line 18: include: command not found

cubanismo commented 1 year ago

Cool to see people trying to get this to work on msys!

Can you list more precisely the steps you took? E.g., I don't know what you mean by "when I type makefile," and the errors aren't making it much clearer.

42Bastian commented 1 year ago

When I type makefile, this is what I get:

What do you mean "type makefile"?

In order to use a makefile you need make, it is not shell script or batch file.

PJM-NCC-70511 commented 1 year ago

I used pacman -S mingw-w64-ucrt-x86_64-gcc pacman -S mingw-w64-cross-gcc pacman -S mingw-w64-cross-toolchain pacman -S git pacman -S mingw-w64-x86_64-python pacman -S make

Looks like it may not be installing all the packages it needs for cross compiling. Also, I am trying Docker, but not sure where it is saving files inside its containers, so I can copy files to and from Windows. I am also going to try VirtualBox and a Kubuntu environment later. I have used Linux before, and I know how to interface it with the external Windows environment better.

PJM-NCC-70511 commented 1 year ago

I tried to get more packages installed. May still be missing a few things. New error I am getting.

/jaguar-sdk/jaguar/examples/jaghello

make

rmac -fb -g -rd +o0 +o1 +o2 startup.s make: rmac: No such file or directory make: *** [/home/peter_j_meyer/jaguar-sdk/tools/build/jagrules.mk:10: startup.o] Error 127

cubanismo commented 1 year ago

Yeah, the way the SDK works is:

  1. Get local tools installed. On Linux, that's accomplished by installing a few packages most people will already have, per the README.md. This is roughly what you've done so far on Windows.
  2. Clone the SDK itself from git.
  3. Run a script to build the cross-compiler, gdb-for-m68k-a.out, rmac, rln, and various other tools using your native tools
  4. Build stuff for Jaguar using those tools.

There's currently no script to accomplish (3) yet, and you appear to be skipping that step. The first step to getting this working on windows would be to write a .bat file that does the same things on Windows using mingw that maketools.sh does on Linux, I.e., a maketools.bat (Or install msys bash and do it with that. I don't know whether or not that would be easier or harder). Regardless, without that step, it's not going to work.

42Bastian commented 1 year ago

I tried to get more packages installed. May still be missing a few things. New error I am getting.

/jaguar-sdk/jaguar/examples/jaghello

make

rmac -fb -g -rd +o0 +o1 +o2 startup.s make: rmac: No such file or directory make: *** [/home/peter_j_meyer/jaguar-sdk/tools/build/jagrules.mk:10: startup.o] Error 127

=> http://rmac.is-slick.com/

PJM-NCC-70511 commented 1 year ago

Getting this message when trying to build tools. I know something is still missing, and tried to build each tool in src directly. Which folder does rmac need to be in?

Building tools, Installing in: "/home/peter_j_meyer/jaguar-sdk/tools" Building rmac... Submodule path 'tools/src/rmac': checked out '64dd9e00ec4aebc63fbddaf9dcc54b04fc9d5859' Applying: Revert "Fix for #209 - forbid exporting expressions with unresolved symbols" gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c 6502.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c amode.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c debug.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c direct.c direct.c: In function 'd_incbin': direct.c:638:25: warning: comparison between pointer and integer 638 if (tok != EOL) ^~ gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c dsp56k.c
gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c macro.c In file included from macro.h:12, from macro.c:9: macro.c: In function 'ExitMacro': rmac.h:52:30: note: '#pragma message: !!! Bad macro exiting !!!' 52 #define DO_PRAGMA(x) _Pragma (#x) ^~~ rmac.h:53:31: note: in expansion of macro 'DO_PRAGMA' 53 #define WARNING(desc) DO_PRAGMA(message (#desc)) ^~~~~ macro.c:56:1: note: in expansion of macro 'WARNING' 56 WARNING(!!! Bad macro exiting !!!) ^~~ gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c mark.c

gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -o rmac 6502.o amode.o debug.o direct.o dsp56k.o dsp56k_amode.o dsp56k_mach.o eagen.o error.o expr.o fltpoint.o listing.o mach.o macro.o mark.o object.o op.o procln.o riscasm.o rmac.o sect.o symbol.o token.o -lm

Don't forget to bump the version number before commiting!

D:\msys64\mingw64\bin\strip.exe: 'rmac': No such file

I get this when I try to build rmac directly: "Don't forget to bump the version number before commiting!"

cubanismo commented 1 year ago

Everything gets installed into tools/bin/ in the Jaguar SDK root.

It looks like the only issue in that build is strip can't find rmac. Is it mingw being smart and converting "-o rmac" to rmac.exe perhaps?

42Bastian commented 1 year ago

Yes, MinGW (like cygwin) outputs .exe.

42Bastian commented 1 year ago

Getting this message when trying to build tools. I know something is still missing, and tried to build each tool in src directly. Which folder does rmac need to be in?

Building tools, Installing in: "/home/peter_j_meyer/jaguar-sdk/tools" Building rmac... Submodule path 'tools/src/rmac': checked out '64dd9e00ec4aebc63fbddaf9dcc54b04fc9d5859' Applying: Revert "Fix for #209 - forbid exporting expressions with unresolved symbols" gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c 6502.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c amode.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c debug.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c direct.c direct.c: In function 'd_incbin': direct.c:638:25: warning: comparison between pointer and integer 638 | if (tok != EOL) | ^~ gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c dsp56k.c | | | gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c macro.c In file included from macro.h:12, from macro.c:9: macro.c: In function 'ExitMacro': rmac.h:52:30: note: '#pragma message: !!! Bad macro exiting !!!' 52 | #define DO_PRAGMA(x) _Pragma (#x) | ^~~ rmac.h:53:31: note: in expansion of macro 'DO_PRAGMA' 53 | #define WARNING(desc) DO_PRAGMA(message (#desc)) | ^~~ macro.c:56:1: note: in expansion of macro 'WARNING' 56 | WARNING(!!! Bad macro exiting !!!) | ^~~~~ gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c mark.c | | | gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -o rmac 6502.o amode.o debug.o direct.o dsp56k.o dsp56k_amode.o dsp56k_mach.o eagen.o error.o expr.o fltpoint.o listing.o mach.o macro.o mark.o object.o op.o procln.o riscasm.o rmac.o sect.o symbol.o token.o -lm

Don't forget to bump the version number before commiting!

D:\msys64\mingw64\bin\strip.exe: 'rmac': No such file

I get this when I try to build rmac directly: "Don't forget to bump the version number before commiting!"

By any chance, did you check if there is "rmac.exe" in the folder?

PJM-NCC-70511 commented 1 year ago

I did, the tools/bin folder was completely empty. I copied a downloaded version to the folder.

When executing maketoos.sh, final statement reads:
D:\msys64\mingw64\bin\strip.exe: 'rmac': No such file

I copied rmac.exe (with extension) and when I ran make in 'jaghello' got a different errors now,

startup.s 2: Error: cannot open: "jaguar.inc" startup.s 81: Warning: RISC code generated with no origin defined startup.s 41: Error: undefined expression [ many undefined expressions] startup.s 302: Error: undefined expression make: *** [/home/peter_j_meyer/jaguar-sdk/tools/build/jagrules.mk:10: startup.o] Error 39

I might just need to make sure everything is in the folders.

42Bastian commented 1 year ago

Check the Makefile, I assume you need to set some environment variable.

cubanismo commented 1 year ago

No, the Makefile assumes some Linux->win32 cross compile env when building for win32 via gcc. Perhaps it behaves differently regarding file extensions. You could tweak the Makefile by hardcoding rmac.exe in place of rmac though for a test. I suspect that's just going to get you to rln failing in the exact same way.

PJM-NCC-70511 commented 1 year ago

This is what I get when running maketools.sh batch file. (./maketools.sh) I suspect something it needs did not get installed correctly. I am going through the perquisites again. That sudo install command does not work in MSYS2, and I am not sure what would be it's equivalent.

Building tools, Installing in: "/home/peter_j_meyer/jaguar-sdk/tools" Building rmac... Submodule path 'tools/src/rmac': checked out '64dd9e00ec4aebc63fbddaf9dcc54b04fc9d5859' Applying: Revert "Fix for #209 - forbid exporting expressions with unresolved symbols" gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c 6502.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c amode.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c debug.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c direct.c direct.c: In function 'd_incbin': direct.c:638:25: warning: comparison between pointer and integer 638 | if (tok != EOL) | ^~ gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c dsp56k.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c dsp56k_amode.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c dsp56k_mach.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c eagen.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c error.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c expr.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c listing.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c mach.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c macro.c In file included from macro.h:12, from macro.c:9: macro.c: In function 'ExitMacro': rmac.h:52:30: note: '#pragma message: !!! Bad macro exiting !!!' 52 | #define DO_PRAGMA(x) _Pragma (#x) | ^~~ rmac.h:53:31: note: in expansion of macro 'DO_PRAGMA' 53 | #define WARNING(desc) DO_PRAGMA(message (#desc)) | ^~~~~ macro.c:56:1: note: in expansion of macro 'WARNING' 56 | WARNING(!!! Bad macro exiting !!!) | ^~~ gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c mark.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c object.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c op.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c procln.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c riscasm.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c rmac.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c sect.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c symbol.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -c token.c gcc -std=gnu99 -D_DEFAULT_SOURCE -g -DGCCUNIX -I. -O2 -o rmac 6502.o amode.o debug.o direct.o dsp56k.o dsp56k_amode.o dsp56k_mach.o eagen.o error.o expr.o fltpoint.o listing.o mach.o macro.o mark.o object.o op.o procln.o riscasm.o rmac.o sect.o symbol.o token.o -lm

Don't forget to bump the version number before commiting!

D:\msys64\mingw64\bin\strip.exe: 'rmac': No such file

42Bastian commented 1 year ago

Only warnings, no error. So rmac.exe should be there. Same warnings if compiling under cygwin. Try "echo $?" after build

PJM-NCC-70511 commented 1 year ago

I get 1

42Bastian commented 1 year ago

Ok, this is the error because of the strip. There is really no .eye?

PJM-NCC-70511 commented 1 year ago

no .eye. Got it back to producing the "Error: cannot open: "jaguar.inc" with all the undefined errors that follow. [edit] I looked at the .env.sh. the two lines that point to the folder where jaguar.inc is included read. export RMACPATH="${JAGSDK}/jaguar/include;${JAGSDK}/jaguar/skunk/include" export MACPATH="${JAGSDK}/jaguar/include;${JAGSDK}/jaguar/skunk/include" should PATH itself include folder also? [edit] I am looking at this startup.s file. It is not C, but it is Assembly language. Do I have the correct Assembly language package also set up inside my environment? Does it also need paths correctly set up. [edit] I did one of my old tricks from 6502 assembly, I copied the jaguar.inc into the project folder, and it generated startup.o. I am getting somewhere.

PJM-NCC-70511 commented 1 year ago

This is what I am getting now, using MSYS2-MINGW64. I looked at the folder and the folder/files are not there. It is possible it is missing the 68000 libraries it needs from cross compiling.

/usr/local/m68k-aout/m68k-aout/bin/gcc -MM example1.c > .depend /bin/sh: line 1: /usr/local/m68k-aout/m68k-aout/bin/gcc: No such file or directory make: *** No rule to make target '.depend', needed by 'all'. Stop.

PJM-NCC-70511 commented 1 year ago

Found this information: https://wiki.osdev.org/GCC_Cross-Compiler#Windows_Users For Cygwin. It needs GCC, G++, Make, Flex, Bison, Diffutils, libintl-devel, libgmp-devel, libmpfr-devel, libmpc-devel, Texinfo I get this result with Gygwin: m68k-aout-gcc -DJAGUAR -I/home/peter_j_meyer/jaguar-sdk/jaguar/include -O2 -c -o jag.o jag.c make: m68k-aout-gcc: No such file or directory make: *** [/home/peter_j_meyer/jaguar-sdk/tools/build/jagrules.mk:13: jag.o] Error 127

42Bastian commented 1 year ago

Obvious or not? There is no m68k-aout-gcc installed/in the path. Why don't you just use Linux?!

42Bastian commented 1 year ago

I just tried it on WSL2, and despite the last "strip" after GDB build it works and all the tools were built.

PJM-NCC-70511 commented 1 year ago

I am trying WSL now. This Cygwin and MSYS2 doesn't seem to have all the packages available to make Jaguar,SDK to function properly.

42Bastian commented 1 year ago

Not WSL, WSL2 !

PJM-NCC-70511 commented 1 year ago

Thankyou very much. Maybe someday, we can go back and figure out how to get Cygwin and MSYS2 to work with Jaguar development. I got it to work with this WSL. Is there a difference between WSL and WSL2? Anyway, it looks like I have Ubuntu set to Version 2. Thankyou very much. I am also going to be needing Removers Jaguar Libraries installed. I would need emulation to also function on my PC, so I can do tests with the compiled code.

PJM-NCC-70511 commented 1 month ago

image

Havig this issue with "dhrystone-gpu" trying to compile it, and error with dhry.cof. It has been long time since I used Jaguar SDK. I wonder if something is missing that needs to be installed or updated.

42Bastian commented 1 month ago

'skunkc.o' is missing in the rln command line!

cubanismo commented 4 weeks ago

Did you edit the Makefile and change the SKUNKLIB := 1 line to SKUNKLIB := 0 perhaps? If I do that here, I can't even get it to build the object files, strangely, but it works out of the box with an unedited Makefile. The non-skunk symbol errors make me think something is just really going wrong besides that though. I don't know what would cause those. Did you checkout without updating all the submodules of the SDK by chance? That might cause some code that's supposed to be built for the GPU to be built for the 68k instead.