Hi guys,

Has anyone successfully set up the Prizm SDK on a MAC?

After I learning the Prizm SDK using the windows v0.3 SDK, I started working on putting together instructions to set up a Prizm build environment on the mac, based on Jonimoose/libfxcg. Almost there.

I am following the linux setup instructions on the wiki.

So I cloned Jonimoose/libfxcg from github on my mac. went thru the instructions and compiled the binutils, gcc, mkg3a packages (bringing other required packages using brew). Then I compiled the libfxcg and libc. all went thru ok.

now I can compile the "example" project from the V0.3 SDK, but when I add libc, I get the following errors. Compiling the library itself didn't give me any errors.

I'm going to continue to look into it, but if anybody has any suggestions, ideas I will appreciate.

thanks,

Currently I am using binutils-2.2.6, gcc-5.3.0 (latest as of today).
I tried other binutils (2.22) or gcc (4.6.2, 4.6.3) as mentioned on the wiki, but no luck.


Code:

prizm-gcc  main.o -mb -m4a-nofpu -mhitachi -nostdlib -T/Users/atilla457/Documents/3_Projects/calculators/libfxcg/common/prizm.ld -Wl,-static -Wl,-gc-sections  -L/Users/atilla457/Documents/3_Projects/calculators/libfxcg/lib -lfxcg -lgcc -lc  -o /Users/atilla457/Documents/3_Projects/calculators/libfxcg/projects/hello/hello.bin
/Users/atilla457/Documents/3_Projects/calculators/libfxcg/lib/libc.a(stdlib.o): In function `strtod':
/Users/atilla457/Documents/3_Projects/calculators/libfxcg/libc/stdlib.c:160: undefined reference to `___muldf3'
/Users/atilla457/Documents/3_Projects/calculators/libfxcg/libc/stdlib.c:160: undefined reference to `___floatsidf'
/Users/atilla457/Documents/3_Projects/calculators/libfxcg/libc/stdlib.c:160: undefined reference to `___adddf3'
/Users/atilla457/Documents/3_Projects/calculators/libfxcg/libc/stdlib.c:160: undefined reference to `___floatsisf'
/Users/atilla457/Documents/3_Projects/calculators/libfxcg/libc/stdlib.c:160: undefined reference to `___divsf3'
/Users/atilla457/Documents/3_Projects/calculators/libfxcg/libc/stdlib.c:160: undefined reference to `___extendsfdf2'
/Users/atilla457/Documents/3_Projects/calculators/libfxcg/libc/stdlib.c:160: undefined reference to `___mulsf3'
/Users/atilla457/Documents/3_Projects/calculators/libfxcg/lib/libc.a(printf.o): In function `_v_printf':
/Users/atilla457/Documents/3_Projects/calculators/libfxcg/libc/printf.c:291: undefined reference to `___movmemSI12_i4'
collect2: error: ld returned 1 exit status
make[1]: *** [/Users/atilla457/Documents/3_Projects/calculators/libfxcg/projects/hello/hello.bin] Error 1
make: *** [build] Error 2
The referenced functions are provided by libgcc, so that would seem to be missing or not where the compiler expects it.
Thank you very much. This is good and new information for me.

I see similar functions in ./libfxcg/lib/gcc/sh3eb-elf/5.3.0/plugin/include folder. (I setup gcc to install into the libfxcg folder.)

I will dig into libgcc in detail. hopefully it is just gcc not finding it.
Ok, finally figured it out... by luck but it makes sense.

The order of libraries for gcc is important. the libraries that needs symbols resolved must come earlier (ie on the left). the libraries that resolve symbols come afterwards. In other words, the linker(?) discards symbols if they have not been used, hence if I put libgcc earlier, it would get discarded instead of being used. (hope this is technically true).

So I rearranged it this way and worked. (earlier, gcc was the 2nd library listed)

LIBS := -lfxcg -lm -lc -lgcc

Let me verify my scripts again today from scratch and I will post it for review & maybe put it on the wiki.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
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 vote in polls in this forum

 

Advertisement