Jump to content

Photo

GCC for the TI


408 replies to this topic

#351 TheBF OFFLINE  

TheBF

    Dragonstomper

  • 646 posts
  • Location:The Great White North

Posted Mon Feb 26, 2018 2:57 PM

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

It seems like a nice environment to work in.



#352 chue OFFLINE  

chue

    Moonsweeper

  • 254 posts

Posted Tue Feb 27, 2018 8:35 AM

I don't have experience with CodeBlocks, but may give it a try now that you mention it. 

 

I have TI-GCC installed on a headless Linux server, and I've been looking for a way to do remote development from Windows.  It looks like CodeBlocks supports this using a plugin called Uniwin: https://softwarerecs...om/a/14178/3427



#353 unhuman OFFLINE  

unhuman

    Stargunner

  • 1,207 posts
  • Location:Vienna, VA

Posted Wed Feb 28, 2018 10:00 AM

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



#354 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,745 posts
  • Location:Beaverton, OR

Posted Sun Mar 11, 2018 10:48 AM

 

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. 



#355 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,745 posts
  • Location:Beaverton, OR

Posted Sun Mar 11, 2018 10:52 AM

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

 

-M@



#356 Alekin OFFLINE  

Alekin

    Combat Commando

  • 7 posts

Posted Sat Mar 31, 2018 4:16 AM

 
Can someone create a gcc (for ti99 cross compiler) windows installer?

Edited by Alekin, Sun Apr 8, 2018 7:31 AM.


#357 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,745 posts
  • Location:Beaverton, OR

Posted Sun May 27, 2018 11:50 PM

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. 

 

-M@



#358 insomnia OFFLINE  

insomnia

    Star Raider

  • Topic Starter
  • 81 posts
  • Location:Pittsburgh, PA

Posted Tue May 29, 2018 4:44 PM

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.



#359 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,745 posts
  • Location:Beaverton, OR

Posted Tue May 29, 2018 10:17 PM

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

 

-M@



#360 tschak909 ONLINE  

tschak909

    River Patroller

  • 2,497 posts
  • Location:USA

Posted Wed Aug 8, 2018 10:50 PM

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



#361 tschak909 ONLINE  

tschak909

    River Patroller

  • 2,497 posts
  • Location:USA

Posted Wed Aug 8, 2018 11:04 PM

$ 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


#362 tschak909 ONLINE  

tschak909

    River Patroller

  • 2,497 posts
  • Location:USA

Posted Wed Aug 8, 2018 11:28 PM

Just did a bulk upgrade of all of cygwin, let's see if that helps... gcc is now 7.3.0



#363 tschak909 ONLINE  

tschak909

    River Patroller

  • 2,497 posts
  • Location:USA

Posted Thu Aug 9, 2018 12:40 AM

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



#364 tschak909 ONLINE  

tschak909

    River Patroller

  • 2,497 posts
  • Location:USA

Posted Thu Aug 9, 2018 12:43 AM

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



#365 Willsy OFFLINE  

Willsy

    River Patroller

  • 3,075 posts
  • Location:Uzbekistan (no, really!)

Posted Thu Aug 9, 2018 5:15 AM

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:



#366 BeeryMiller OFFLINE  

BeeryMiller

    Moonsweeper

  • 478 posts
  • Location:Campbellsburg, KY

Posted Thu Aug 9, 2018 5:31 AM

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



#367 TheMole ONLINE  

TheMole

    Dragonstomper

  • 779 posts
  • Location:Belgium

Posted Thu Aug 9, 2018 7:19 AM

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



#368 TheMole ONLINE  

TheMole

    Dragonstomper

  • 779 posts
  • Location:Belgium

Posted Thu Aug 9, 2018 7:20 AM

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.



#369 TheMole ONLINE  

TheMole

    Dragonstomper

  • 779 posts
  • Location:Belgium

Posted Thu Aug 9, 2018 7:23 AM

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, Thu Aug 9, 2018 7:23 AM.


#370 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,745 posts
  • Location:Beaverton, OR

Posted Thu Aug 9, 2018 7:46 AM

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.

#371 Willsy OFFLINE  

Willsy

    River Patroller

  • 3,075 posts
  • Location:Uzbekistan (no, really!)

Posted Thu Aug 9, 2018 8:43 AM

 

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?



#372 tschak909 ONLINE  

tschak909

    River Patroller

  • 2,497 posts
  • Location:USA

Posted Thu Aug 9, 2018 8:55 AM

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



#373 ElectricLab OFFLINE  

ElectricLab

    Chopper Commander

  • 242 posts
  • Location:Hillsboro, Oregon

Posted Thu Aug 9, 2018 10:19 AM

 

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



#374 ElectricLab OFFLINE  

ElectricLab

    Chopper Commander

  • 242 posts
  • Location:Hillsboro, Oregon

Posted Thu Aug 9, 2018 10:23 AM

 

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.



#375 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,745 posts
  • Location:Beaverton, OR

Posted Thu Aug 9, 2018 10:39 AM

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?)




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users