Jump to content
insomnia

GCC for the TI

Recommended Posts

On 7/22/2019 at 6:07 AM, Mobsie said:

The installer stop with an error, see the picture.

The picture shows that you are compiling with Clang. Try GCC. Even then I don’t know if it will work.  The build process works on Linux but doesn’t work on all flavors of Linux. Mac is *like* Linux, but they are not the same.

  • Like 2

Share this post


Link to post
Share on other sites
On 7/26/2019 at 3:12 AM, Mobsie said:

thank you all.

With help from PeteE i was able to build all on osx.

 

Hi Mobsie,

 

I'm trying to build on OS X El Capitan (last OS build my MacBook supports).  I have installed GMP and MPFR using MacPorts, but the scripts fail to find them and GCC fails to build.  Any idea on how to fix this?  Thought this might have been addressed in your setup.

Share this post


Link to post
Share on other sites
3 hours ago, klrw111-78 said:

I'm trying to build on OS X El Capitan (last OS build my MacBook supports).  I have installed GMP and MPFR using MacPorts, but the scripts fail to find them and GCC fails to build.  Any idea on how to fix this?  Thought this might have been addressed in your setup.

Here is the modified script I sent to Mobsie.  He got it to work, so perhaps you can too.

install-mac.sh

  • Like 3

Share this post


Link to post
Share on other sites
On 10/15/2019 at 1:03 AM, PeteE said:

Here is the modified script I sent to Mobsie.  He got it to work, so perhaps you can too.

install-mac.sh 3.69 kB · 4 downloads

Thanks for the script.  It showed me how to make the changes for my environment.  Everything worked up to the point of calling the linker for the gcc compile.  The errors involved failure to find symbols.  Going to re-install the Xcode setup and try again.

Share this post


Link to post
Share on other sites

I wrote a simple function today that seems to show unreachable instructions being generated: 

 

int hasRam() {
  volatile int* lower_exp = (volatile int*) 0x2000;
  *lower_exp = 0;
  *lower_exp = 0x1234;
  return (*lower_exp == 0x1234);
}

 

that compiled into the following:

 

        def     hasRam
hasRam
        clr  @>2000
        li   r1, >1234
        mov  r1, @>2000
        mov  @>2000, r2
        clr  r1
        ai   r2, >EDCC
        jeq  L13
        b    *r11
        jmp  L14
L13
        li   r1, >1
        b    *r11
L14
        .size   hasRam, .-hasRam

 

The instruction just prior to L13 is unreachable, and unnecessary.  compiled with -O2

 

[email protected]
 

  • Like 2

Share this post


Link to post
Share on other sites
22 hours ago, jedimatt42 said:

I wrote a simple function today that seems to show unreachable instructions being generated: 

 

int hasRam() {
  volatile int* lower_exp = (volatile int*) 0x2000;
  *lower_exp = 0;
  *lower_exp = 0x1234;
  return (*lower_exp == 0x1234);
}

 

that compiled into the following:

 

        def     hasRam
hasRam
        clr  @>2000
        li   r1, >1234
        mov  r1, @>2000
        mov  @>2000, r2
        clr  r1
        ai   r2, >EDCC
        jeq  L13
        b    *r11
        jmp  L14
L13
        li   r1, >1
        b    *r11
L14
        .size   hasRam, .-hasRam

 

The instruction just prior to L13 is unreachable, and unnecessary.  compiled with -O2

 

[email protected]
 

Interesting.

I can see that it has a rigid if-else pattern where 'return' is treated as an ordinary statement in each clause.

 

vs hand-coding, the compiler doesn't seem to make good use of registers. But I don't blame it. Compiler code-generation still  seems like magic to me.

 

I wonder if declaring lower_exp as register would help.

Also a register const int x = 0x1234;

 


Using one more register R0

    clr  r1
    li   r0,>2000
    clr  *r0
    li   r2,>1234
    mov  r2,*r0
    c    *r0,r2
    jne  L13
    inc  r1
L13    
    b    *r11

11 words vs 15

 

 

 

  • Like 2

Share this post


Link to post
Share on other sites

New laptop, new linux, new error building gcc - :)

 

New gcc ( 9.2.1 ) doesn't like some of the code used in the old gcc ( 4.4.0 ) :  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90677

 

I found the solution applied in this issue works well ( coincidentally for a gcc for TI calculators 😞 https://github.com/debrouxl/gcc4ti/issues/11

 

cd into your install.sh destination directory, and then into the gcc-4.4.0 directory.  And apply the patch:  cgraph_node.patch

 

patch -p1 < cgraph_node.patch

 

Then re-run the install to resume the build.  I'm sure this could be rolled into the install.sh if @insomnia was so inclined.

 

[email protected]

  • Like 5

Share this post


Link to post
Share on other sites

With Windows 10 you can use Linux subsystem. Have anybody try gcc with 9900 patch on Windows 10 with Linux subsystem? Have anybody instruction for this?

Edited by Manic1975

Share this post


Link to post
Share on other sites
14 hours ago, Manic1975 said:

With Windows 10 you can use Linux subsystem. Have anybody try gcc with 9900 patch on Windows 10 with Linux subsystem? Have anybody instruction for this?

I've done it and it worked for me. There were some minor issues but it has been a fair bit of time since I did it. Just work the issues one at a time, I want to say they were all documented here for other systems (and that it worked better than cygwin ;) )

 

Share this post


Link to post
Share on other sites

Hello everyone,

 

Trying to compile on a Raspberry Pi 4, latest version of Raspbian.  Getting an error for binutils:

 

make[1]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1'
make[2]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/libiberty'
make[3]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/libiberty/testsuite'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/libiberty/testsuite'
make[2]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/libiberty'
make[2]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/intl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/intl'
make[2]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd'
Making info in doc
make[3]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/doc'
make chew
make[4]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/doc'
make[4]: 'chew' is up to date.
make[4]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/doc'
./chew -f ../.././bfd/doc/doc.str <../.././bfd/doc/../targets.c >targets.tmp
/bin/bash ../.././bfd/doc/../../move-if-change targets.tmp targets.texi
restore=: && backupdir=".am$$" && \
rm -rf $backupdir && mkdir $backupdir && \
if (makeinfo --split-size=5000000 --split-size=5000000 --version) >/dev/null 2>&1; then \
  for f in bfd.info bfd.info-[0-9] bfd.info-[0-9][0-9] bfd.i[0-9] bfd.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
if makeinfo --split-size=5000000 --split-size=5000000   -I ../.././bfd/doc \
 -o bfd.info `test -f 'bfd.texinfo' || echo '../.././bfd/doc/'`bfd.texinfo; \
then \
  rc=0; \
else \
  rc=$?; \
  $restore $backupdir/* `echo "./bfd.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
./elf.texi:11: raising the section level of @subsubsection which is too low
make[3]: *** [Makefile:394: bfd.info] Error 1
make[3]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/doc'
Making info in po
make[3]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/po'
make[3]: Nothing to be done for 'info'.
make[3]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/po'
make[3]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd'
make[3]: Nothing to be done for 'info-am'.
make[3]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd'
make[2]: *** [Makefile:1094: info-recursive] Error 1
make[2]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd'
make[1]: *** [Makefile:3094: all-bfd] Error 2
make[1]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1'
make: *** [Makefile:717: all] Error 2

 

Here's the gcc version I'm using:

 

gcc (Raspbian 8.3.0-6+rpi1) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 

I've compiled all GCC for the TI on older versions of Raspbian, etc., without issue.

 

Any idea on what may up?

 

Thank you

 

 

 

Share this post


Link to post
Share on other sites
5 minutes ago, mr_gw454 said:

Hello everyone,

 

Trying to compile on a Raspberry Pi 4, latest version of Raspbian.  Getting an error for binutils:

 

make[1]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1'
make[2]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/libiberty'
make[3]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/libiberty/testsuite'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/libiberty/testsuite'
make[2]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/libiberty'
make[2]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/intl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/intl'
make[2]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd'
Making info in doc
make[3]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/doc'
make chew
make[4]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/doc'
make[4]: 'chew' is up to date.
make[4]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/doc'
./chew -f ../.././bfd/doc/doc.str <../.././bfd/doc/../targets.c >targets.tmp
/bin/bash ../.././bfd/doc/../../move-if-change targets.tmp targets.texi
restore=: && backupdir=".am$$" && \
rm -rf $backupdir && mkdir $backupdir && \
if (makeinfo --split-size=5000000 --split-size=5000000 --version) >/dev/null 2>&1; then \
  for f in bfd.info bfd.info-[0-9] bfd.info-[0-9][0-9] bfd.i[0-9] bfd.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
if makeinfo --split-size=5000000 --split-size=5000000   -I ../.././bfd/doc \
 -o bfd.info `test -f 'bfd.texinfo' || echo '../.././bfd/doc/'`bfd.texinfo; \
then \
  rc=0; \
else \
  rc=$?; \
  $restore $backupdir/* `echo "./bfd.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
./elf.texi:11: raising the section level of @subsubsection which is too low
make[3]: *** [Makefile:394: bfd.info] Error 1
make[3]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/doc'
Making info in po
make[3]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/po'
make[3]: Nothing to be done for 'info'.
make[3]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd/po'
make[3]: Entering directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd'
make[3]: Nothing to be done for 'info-am'.
make[3]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd'
make[2]: *** [Makefile:1094: info-recursive] Error 1
make[2]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1/bfd'
make[1]: *** [Makefile:3094: all-bfd] Error 2
make[1]: Leaving directory '/home/pi/source/gcc-ti99/build/binutils-2.19.1'
make: *** [Makefile:717: all] Error 2

 

Here's the gcc version I'm using:

 

gcc (Raspbian 8.3.0-6+rpi1) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 

I've compiled all GCC for the TI on older versions of Raspbian, etc., without issue.

 

Any idea on what may up?

 

Thank you

 

 

 

 

I think I forgot this before compiling:

 

export MAKEINFO=missing

 

 

Share this post


Link to post
Share on other sites

Hi to everyone,
Once again, I have to re-install GCC 4 TI. I have tried with the very latest installer hoping to get it installed easily...
I cannot see find the instructions on how to use the installer.
If I run it with "sudo ./install.sh /opt/gcc4ti"
I get these errors
...
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.
./install.sh: 25: [: 1: unexpected operator
make: *** No rule to make target 'all-gcc'.  Stop.
./install.sh: 25: [: 2: unexpected operator
make: *** No rule to make target 'install'.  Stop.
=== Building libgcc.a ===
mkdir: cannot create directory ‘build’: File exists
make: *** No rule to make target 'all-target-libgcc'.  Stop.
./install.sh: 25: [: 2: unexpected operator
make: *** No rule to make target 'install-target-libgcc'.  Stop.
./install.sh: 25: [: 2: unexpected operator
=== Installation complete ===
"

Moreover I do not find the compiler binary in /opt/gcc4ti/bin nor in /opt/gcc4ti/tms9900/bin.

Could someone please write some installation step by step instructions?
 

Share this post


Link to post
Share on other sites
8 hours ago, Fabrizio Caruso said:

Hi to everyone,
Once again, I have to re-install GCC 4 TI. I have tried with the very latest installer hoping to get it installed easily...
I cannot see find the instructions on how to use the installer.
If I run it with "sudo ./install.sh /opt/gcc4ti"
I get these errors
...
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.
./install.sh: 25: [: 1: unexpected operator
make: *** No rule to make target 'all-gcc'.  Stop.
./install.sh: 25: [: 2: unexpected operator
make: *** No rule to make target 'install'.  Stop.
=== Building libgcc.a ===
mkdir: cannot create directory ‘build’: File exists
make: *** No rule to make target 'all-target-libgcc'.  Stop.
./install.sh: 25: [: 2: unexpected operator
make: *** No rule to make target 'install-target-libgcc'.  Stop.
./install.sh: 25: [: 2: unexpected operator
=== Installation complete ===
"

Moreover I do not find the compiler binary in /opt/gcc4ti/bin nor in /opt/gcc4ti/tms9900/bin.

Could someone please write some installation step by step instructions?
 

 

Depends on your operating system...  This one still holds for most ubuntu, probably debians... 

 

 

Then I found with latest, ubuntu, I needed the patch described in this post:

 

 

[email protected]

 

 

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Hi everyone!

I have managed to compile a slimmed-down version of my C game (https://github.com/Fabrizio-Caruso/CROSS-LIB).

I am using this Makefile: https://github.com/Fabrizio-Caruso/CROSS-LIB/blob/master/src/makefiles.chase/targets/Makefile.gcc_tms9900_targets


There is a problem (repeated definitions) for which I am using a workaround to silence the warning/error.
 

I get a .cart and a .elf file (in the attachments here). If I attach the .cart file into classic99, I can start it but I get a repeating high-pitched sound instead of a hello world message as I expect in my code:

#include "system.h"
#include <conio.h>
void INIT_GRAPHICS(void) {
    set_text();
    charsetlc();
    textcolor(COLOR_WHITE);
    bgcolor(COLOR_DKBLUE);
    gotoxy(2,2);
    cprintf("Hello world\n");
    while(1){};
}

Could someone help me please figure out what is wrong?

 

ti99_cross_chase.cart ti99_cross_chase.elf

  • Like 3

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...