Jump to content
insomnia

GCC for the TI

Recommended Posts

Does anyone use CodeBlocks with the TI-99 GCC compiler?

It seems like a nice environment to work in.

Share this post


Link to post
Share on other sites

I've got things moving along. I decided to start with a port of a friend's game. I almost have the entire base compiling (leaving all the drawing / etc stuff todo). It didn't like bool and declarations of the loop. The assembler complained a ton, but I think I may not be using the correct one, although it did complain about joyst and a few other things. I'm curious to see how big this thing is compiled - but I'll need the assembler output to verify.

 

If this works out fitting... Pretty awesome.

 

-H

  • Like 2

Share this post


Link to post
Share on other sites

 

ubuntu 17.04 needs apt-get install tree for install.sh

 

fails in make

 

Makefile:394: recipe for target 'bfd.info' failed

Makefile:1094: recipe for target 'info-recursive' failed
Makefile:3094: recipe for target 'all-bfd' failed
got it to build fine on my 16.04 machine. ¯\_(ツ)_/¯

 

 

 

The current prerequisites for a freshly installed Ubuntu 17.10.1 system appear to be:

 

build-essential

libgmp-dev

libmpfr-dev

sudo apt install build-essential libgmp-dev libmpfr-dev 

And then for some arcane reason, 'tree' but you can change the install script to not need tree : ls -1 will do nicely instead.

BINUTILS_PATCH=`ls -1 binutils-*.patch | tail -1`
GCC_PATCH=`ls -1 gcc-*.patch | tail -1`

or you can just install tree, it isn't on most, if any, current ubuntu distros by default.

sudo apt install tree

----

 

Then, it will build away... however it will fail in the end with errors about not finding the 9900 version of the c++ while building some libiberty tests, and then report at the end, that it is successfully built.

Share this post


Link to post
Share on other sites

Oh, I'll add, I couldn't get ubuntu 17.04 to install... or rather, once installed off media, there was a hell storm of 'oops-we-f'ed-this-up' and you have to hack the machine to get it to upgrade to 17.10 anyway...

 

[email protected]

Share this post


Link to post
Share on other sites

Is there supposed to be a libgcc with this?

 

The compiler sometimes produces calls to things like __udivi3 and other similar functions that are typically implemented in libgcc for 'special' platforms that don't simply have cpu instruction equivalents.

 

[email protected]

  • Like 1

Share this post


Link to post
Share on other sites

Oh yes, the TMS9900 is definitely "special". And at times really annnoying.

 

Anyway, there is a libgcc included with the gcc patches. To build it run "make all-target-libgcc; make install".

 

This will build the library and install it in a location GCC can find it. It may be necessary to include "-lgcc" in your linker options.

 

It's been a while since I've made a project that needed this, so I might be forgetting something. If you have any problems let me know and I will try to help.

  • Like 4

Share this post


Link to post
Share on other sites

Using the install script in post #1...

 

make install fails before it will install libgcc because of the failure to build libssp.

 

If your 'install.sh' is here: .

then cd to: build/gcc-4.4.0/build

and run: make all-target-libgcc; make install-target-libgcc

 

that seems to skip the libssp failure.

 

--------

 

Insomnia, you say you usually don't need this. It would be nice to understand what exactly causes the need for these functions? If there is a strategy / style of coding that avoids it if desired... We haven't run into it until getting into some multiplication or division operations...

 

[email protected]

Share this post


Link to post
Share on other sites

Under cygwin, the installer patches gcc, but fails during compile with:

...

if [ x"" != x ]; then \
  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic   .././libiberty/sigsetmask.c -o pic/sigsetmask.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I.././libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  .././libiberty/sigsetmask.c -o sigsetmask.o
In file included from /usr/include/sys/signal.h:22:0,
                 from /usr/include/signal.h:6,
                 from .././libiberty/sigsetmask.c:22:
/usr/include/cygwin/signal.h:328:34: error: unknown type name ‘siginfo_t’
     void  (*sa_sigaction) ( int, siginfo_t *, void * );
                                  ^
make[2]: *** [Makefile:962: sigsetmask.o] Error 1
make[2]: Leaving directory '/cygdrive/d/foo/build/binutils-2.19.1/libiberty'
make[1]: *** [Makefile:8676: all-libiberty] Error 2
make[1]: Leaving directory '/cygdrive/d/foo/build/binutils-2.19.1'
make: *** [Makefile:723: all] Error 2
=== Failed to build Binutils ===

-Thom

Share this post


Link to post
Share on other sites
$ gcc -v

Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/lto-wrapper.exe

Target: x86_64-pc-cygwin

Configured with: /cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.x86_64/src/gcc-5.4.0/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.x86_64/src/gcc-5.4.0 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit --with-dwarf2 --with-tune=generic --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --enable-libada --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible

Thread model: posix

gcc version 5.4.0 (GCC)


-Thom

Share this post


Link to post
Share on other sites

Looks like everything built, and with ea5split and elf2ea5 am able to build libti99 and run the test program in E/A. whee. It's off to the races!

 

-Thom

Share this post


Link to post
Share on other sites

And with that, tms9900-gcc built, and was able to build libti99 and the test harness, and I was able to run it inside E/A. Fantastic.

 

-Thom

  • Like 2

Share this post


Link to post
Share on other sites

Where are we with a "everything you wanted to know about installing gcc for the 9900 but were far too afraid to ask, and even more afraid to try it" document?

 

I'd like to try it, but don't know where to start (I'm running Linux Mint). I'll try it in a VM because I reckon the probability of borking ones system is pretty high with this (I'm already using GCC via code::blocks and NetBeans (which is configured for both Java and C++ development).

 

Cheers :thumbsup:

  • Like 1

Share this post


Link to post
Share on other sites

Can GCC be run on a Raspberry PI 3 simultaneously connected to a TIPI? I am assuming the RPI has a monitor, keyboard, and mouse connected to it as well.

 

Beery

  • Like 1

Share this post


Link to post
Share on other sites

Where are we with a "everything you wanted to know about installing gcc for the 9900 but were far too afraid to ask, and even more afraid to try it" document?

 

I'd like to try it, but don't know where to start (I'm running Linux Mint). I'll try it in a VM because I reckon the probability of borking ones system is pretty high with this (I'm already using GCC via code::blocks and NetBeans (which is configured for both Java and C++ development).

 

Cheers :thumbsup:

 

If you're running Linux, it really is pretty straight forward. You only need to follow a few steps to make sure you have the required development environment (gcc or clang, libraries, etc...) installed, download and unzip the gcc-installer.tar.gz file in post #1; and finaly run the included "install.sh" script. Thats's really all there is to it

 

Now, as with most things, the details of your exact situation might vary... but on Mint it should never be more than this in practice:

  1. Install gcc, tree, lib-gmp and lib-mpfr ("sudo apt-get install build-essential gmp-dev mpfr-dev tree")
  2. Download the install script from the first post of this thread, unpack it using your favorite gui tool, or in a terminal: "tar -xvzf gcc-installer.tar.gz" in the directory where you downloaded the file
  3. Run the script, with the directory where you want to install the compiler as the only parameter (e.g. "./install.sh ~/tms9900" to install it in /home/<your_username>/tms9900/)

The entire process is there not more than the following three commands (assuming you downloaded the script in post #1 to your Downloads folder):

sudo apt-get install build-essential gmp-dev mpfr-dev tree
cd Downloads
tar -xvzf gcc-installer.tar.gz
./install.sh ~/tms9900

It'll download all the other stuff you need, then vomit a bunch of garbage on your screen, and the whole process will probably end with something that looks like a fatal error, but that can all be safely ignored. After it has run its course and you're back at a the prompt, you should see a tms9900-gcc binary (among a host of other files) in /home/<your_username>/tms9900/bin/

If that's there, it means everything worked and you have gcc 4.4.0 for the venerable tms9900 processor installed on your machine! Happy hacking!

 

Now, how one would go about integrating all of this in code::blocks or netbeans is beyond my area of expertise, I use a code editor and the command line instead of a full-blown IDE, which is much MUCH easier in my book :).

Share this post


Link to post
Share on other sites

Can GCC be run on a Raspberry PI 3 simultaneously connected to a TIPI? I am assuming the RPI has a monitor, keyboard, and mouse connected to it as well.

 

Beery

 

I'm sure it can be.

  • Like 1

Share this post


Link to post
Share on other sites

I reckon the probability of borking ones system is pretty high with this.

 

Not really, it's a fully self-contained cross-compiler, so it sits in its own directory structure, separate from the rest of your development tools. If for some unfathomable reason it goes horrible wrong, all you need to do is remove the tms9900 directory (if that's where you've chosen to install it) and all traces of it should be gone.

Edited by TheMole
  • Like 2

Share this post


Link to post
Share on other sites

Can GCC be run on a Raspberry PI 3 simultaneously connected to a TIPI? I am assuming the RPI has a monitor, keyboard, and mouse connected to it as well.

 

Beery

I know ElectricLab and Arcadeshopper have tms9900-gcc built and running on their PIs.

 

I've never hooked a monitor and keyboard up to a PI running the TIPI image... It is based on the lite version of raspbian, so there is no desktop. So no benefit above SSH in my opinion.

 

PI's are slow. And use sdcards for storage. So if you are going to use it for this, you should master tmpfs to reduce writes to the SD card.

 

I personally prefer to gcc from my visual studio code environment, and scp the resulting binaries to the TIPI share to test.

Share this post


Link to post
Share on other sites

 

Not really, it's a fully self-contained cross-compiler, so it sits in its own directory structure, separate from the rest of your development tools. If for some unfathomable reason it goes horrible wrong, all you need to do is remove the tms9900 directory (if that's where you've chosen to install it) and all traces of it should be gone.

 

Right. Where's the best place to get started with this bad-boy?

  • Like 1

Share this post


Link to post
Share on other sites

The one problem I am having is that libgcc can't be found. I tried doing the incantations above for building and installing libgcc, but while it builds, it seems to barf on trying to install libstdc++ (which is fine, don't need it), but i'm not sure the libgcc gets installed, because my compiler still can't find it. (I _really_ need libgcc)

 

-Thom

Share this post


Link to post
Share on other sites

 

I'm sure it can be.

 

 

I know ElectricLab and Arcadeshopper have tms9900-gcc built and running on their PIs.

 

I've never hooked a monitor and keyboard up to a PI running the TIPI image... It is based on the lite version of raspbian, so there is no desktop. So no benefit above SSH in my opinion.

 

PI's are slow. And use sdcards for storage. So if you are going to use it for this, you should master tmpfs to reduce writes to the SD card.

 

I personally prefer to gcc from my visual studio code environment, and scp the resulting binaries to the TIPI share to test.

 

Yes, I do this 100% of the time. [email protected] - you could still use visual studio (I use BBEdit on a Mac) and just save your code via a samba share on the Pi. The compile time is plenty fast, and I'm sure would rival the time it takes you to build on your high-horsepower machine and then have to xfer the binaries over.

Share this post


Link to post
Share on other sites

 

Right. Where's the best place to get started with this bad-boy?

 

I'm at work right now, but could put something together on how I set up my Pi.

Share this post


Link to post
Share on other sites

I am just 1000% opposed to promoting multipurposing the TIPI's PI.

 

To each their own. I have lots of counter arguments, but none of that has to do with gcc.

 

(Does anyone really think I waste any time transferring files in my dev workflow when there are 200 ways to automate that for Unix to Unix?)

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.
Note: Your post will require moderator approval before it will be visible.

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...