Author Topic: [68k] TIGCC under Linux?  (Read 14859 times)

0 Members and 3 Guests are viewing this topic.

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
[68k] TIGCC under Linux?
« on: January 29, 2012, 06:32:47 pm »
I've been trying to get tigcc/ktigcc and tiemu installed all day, but can't get anything to work. I found some precompiled binaries on the tigcc website and they seem to work (spits out a .89y file), but i can't actually test as i can't get TiEmu running (it complains about some kde libs, i think my version is too new?) and the same with ktigcc. Does anyone currently have either running on their Linux distro? Thanks :)

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: [68k] TIGCC under Linux?
« Reply #1 on: January 30, 2012, 01:44:50 am »
You should take a look at https://github.com/debrouxl/gcc4ti.
Its the most up to date toolchain available (and maintained), but you will need to compile it manually.
If you are in Ubuntu, don't ever use any TI* stuff from the repo, its hopelessly outdated ;)

Also, compiling it isn't the most easy thing to. :D
But if you know your way around Linux, I'm sure you will figure it out.

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [68k] TIGCC under Linux?
« Reply #2 on: January 30, 2012, 02:16:01 am »
* TILP and TIEmu can be compiled with http://lpg.ticalc.org/prj_tilp/download/install_tilp.sh and http://lpg.ticalc.org/prj_tiemu/downloads/install_tiemu.sh . The KDE 3 integration is disabled by default (it hardly brings anything), but the D-BUS integration is enabled. Be sure to look inside the files (especially install_tilp.sh) for lists of packages that you need to install before compilation can succeed :)

* the procedure to compile GCC4TI (feature superset, and bug subset, of TIGCC) from Git has been linked to by Jim. I'm aware that the two-phase build procedure, inherited from the unmaintained TIGCC, sucks - even if in GCC4TI, it has been made more streamlined, and more portable...

* the main reason to use KTIGCC is the easy to use (?), but highly peculiar and quite limited (not very powerful, I mean), build system that TIGCC Projects (TPRs) are. KTIGCC is a 1:1 port of the Delphi IDE, which doesn't fix its architectural flaws (e.g. wrt. building of TPRs, precisely). KTIGCC 1 depends on KDE 3.x, which modern distros don't package anymore, and KTIGCC 2 (based on KDE 4.x) is unfinished.
If you want to use KTIGCC (instead of, say, Makefiles calling into the base "tigcc" tool, like most toolchains - I can show you how to do that), you'll have to use KTIGCC 2.


Don't hesitate to ask for more questions ;)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: [68k] TIGCC under Linux?
« Reply #3 on: January 30, 2012, 03:20:56 am »
(its ease of use ;))
In the readme for the Git version (i assume you're the one maintaining it? Thanks!) it mentioned having to run the updatesrc/doc/package_src scripts first, but updatesrc always fails on me, saying a few files are missing:
Quote
cp: no se puede efectuar `stat' sobre «../../tigcc/archive/tigcc.a»: No existe el archivo o el directorio
cp: no se puede efectuar `stat' sobre «../../tigcc/archive/flashos.a»: No existe el archivo o el directorio
cp: no se puede efectuar `stat' sobre «../../tigcc/starters/build/pstarter.o»: No existe el archivo o el directorio
I have another version of tigcc.a from another tigcc source that i found to get the commandline assembler/linker running, the other files i've yet to look for. I also get an error saying some files in a gcc directory are missing, but it went through that step successfully after again copying the files from the source from the site hosted on ticalc, but it still gives me kde errors (something about kde-config?). I'll try again later today (maybe i'm downloading it incorrectly? I just download the .tar.gz file on the Downloads page). Thanks a lot for responding so quickly, both of you! I think a lot of the TI libs are already installed from when i got tilemu running, i'll look into the two links you posted. I thought about posting over at yAronet, but i don't know how frequently people still stop by there (nor did i want to ask such a basic question :P). Thanks again!

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [68k] TIGCC under Linux?
« Reply #4 on: January 30, 2012, 04:01:04 am »
I think the offending cp in updatesrc is superfluous, I forgot to remove it when updating Install_step_3. In any case, it shouldn't be an error preventing from going forward :)

Quote
I have another version of tigcc.a from another tigcc source that i found to get the commandline assembler/linker running
It's OK in the short term, but older versions of tigcc.a contains more bugs (multiple crashers) and fewer optimizations, so you should use the files produced by step 3 (triggered internally by the build scripts) :)

Quote
the other files i've yet to look for
flashos.a is not important; pstarter.o is. But then again, the version of GCC4TI (which is going to be built by the scripts) is better than any version you can find on other sites.

Quote
I also get an error saying some files in a gcc directory are missing, but it went through that step successfully after again copying the files from the source from the site hosted on ticalc
The GCC and binutils tarballs are in the GCC4TI repository, no need to download them from anywhere else ;)

Quote
but it still gives me kde errors (something about kde-config?).
When you do what exactly ?

Quote
I'll try again later today (maybe i'm downloading it incorrectly? I just download the .tar.gz file on the Downloads page).
Again, which downloads page (GCC4TI, TILP, TIEmu ?) ;)

Quote
I think a lot of the TI libs are already installed from when i got tilemu running, i'll look into the two links you posted.
For both TILP and TIEmu, you really should replace your installs with fresh ones created by these scripts. These download from the most recent version possible.

Quote
I thought about posting over at yAronet, but i don't know how frequently people still stop by there
Activity has fallen in 2010 due to too much pollution in topics. Active TI-68k programmers, and ground-breaking Nspire development, have moved from yAronet and UTI to Omnimaga.

Quote
(nor did i want to ask such a basic question :p).
It's not such a basic question, actually :)

Quote
Thanks again!
You're welcome :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: [68k] TIGCC under Linux?
« Reply #5 on: January 30, 2012, 12:56:07 pm »
Alright, great! I've got TiLP and TiEmu running and tested out the Phoenix binary i compiled from source with tigcc. Now i'm trying to get GCC4TI working. I built the source file with package_src and it seemed like everything was going fine up until this:
"GCC4TI script: Installing TIGCCLIB...
GCC4TI script: Installing include files...
GCC4TI script: building tigcc.a, flashos.a and fargo.a...
Error executing /usr/local/share/gcc4ti/bin/gcc
Installation failed"

Also, the arrow keys don't seem to work with the emulator (i have to press on the skin), the .map file seems to show that they are correctly defined though.  Anyway, i'm happy to finally have a nice assembly developing environment on Linux, thank you so much!

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [68k] TIGCC under Linux?
« Reply #6 on: January 30, 2012, 01:12:00 pm »
I guess I'm going to retest the installation procedure by myself :)

EDIT: well, this particular step worked for me. And I should have checked your error message more carefully: GCC4TI doesn't reference $TIGCC/bin/gcc any longer, so the "tigcc" executable which gets invoked by Install_step_3 is not the appropriate one. I think that you left the existing TIGCC install in your PATH, and since Install_step_3 fails to protect itself from this situation (my fault), the build fails...
Please try the following procedure before restarting the compilation: in your temporary install directory (/tmp/gcc4ti-src, if you used the path indicated in INSTALL), edit scripts/Install_step_3 to replace (it should be line 46)
Code: [Select]
PATH="$PATH:$PREFIX_GCC4TI/bin"by
Code: [Select]
PATH="$PREFIX_GCC4TI/bin:$PATH"
And tell me if it fixes your problem. If it does, I'll commit the fix, crediting you for the report ;)

Quote
Also, the arrow keys don't seem to work with the emulator (i have to press on the skin)
Indeed, they stopped working again on recent versions of GTK+ / X server / whatever.
« Last Edit: January 30, 2012, 01:49:37 pm by Lionel Debroux »
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: [68k] TIGCC under Linux?
« Reply #7 on: January 30, 2012, 01:41:47 pm »
Alright, thanks. Sorry for causing so much trouble.

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [68k] TIGCC under Linux?
« Reply #8 on: January 30, 2012, 01:47:36 pm »
I have edited my previous post about a minute after you posted, and then edited it further.
Before you erase the existing install of TIGCC, could you test the workaround I mention, which I hope will make the script more robust ? Thanks in advance :)

And don't worry, running the installation procedure didn't take me much time ;)
« Last Edit: January 30, 2012, 01:49:09 pm by Lionel Debroux »
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: [68k] TIGCC under Linux?
« Reply #9 on: January 30, 2012, 02:33:15 pm »
Ok, this time here's where it stopped:
Quote
GCC4TI script: Installing TIGCCLIB...
GCC4TI script: Installing include files...
GCC4TI script: building tigcc.a, flashos.a and fargo.a...
Error executing /usr/local/share/gcc4ti/bin/patcher

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [68k] TIGCC under Linux?
« Reply #10 on: January 30, 2012, 03:00:55 pm »
Now this one is weird. The invocation of m68k-coff-tigcc-gcc must have succeeded, otherwise patcher wouldn't be called - but nowadays, GCC4TI's tigcc calls "tigcc-patcher".
What if you add
Code: [Select]
TIGCC="$PREFIX_GCC4TI" (with a space) in front of the three ${tigcc} invocations, several lines below the line you've just changed, in scripts/Install_step_3, and then restart scripts/Install again ?

If it does not fix the problem, remove your existing TIGCC install from the $PATH and unset the TIGCC environment variable, before launching scripts/Install. That's the situation which has worked for me earlier today - installing GCC4TI Git HEAD on a new computer which hadn't received GCC4TI before :)

Sorry for the trouble ;)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: [68k] TIGCC under Linux?
« Reply #11 on: January 31, 2012, 08:43:12 am »
It works! Thank you so much! I just compiled Phoenix again and it works like a charm :) Does the IDE also run under Linux?

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [68k] TIGCC under Linux?
« Reply #12 on: January 31, 2012, 08:53:10 am »
Well, what worked ? :)
Did you just have to edit Install_step_3, or did you have to cleanup the existing TIGCC install ?

Under Linux, the IDE is called KTIGCC, and is just as bad, from an architectural POV, as the Delphi IDE. See post #2 :)
If I had learnt earlier of the drawbacks of the TPR system (more precisely - if I had listened earlier to those who lamented about the drawbacks of that system), and its low scriptability, I wouldn't have converted several TICT programs from batch files to TPRs, and then had to work around the limitations when they struck me, one after another...
For trivial setups, TPRs does the job; however, for use cases as simple as compiling different files with different compilation options (e.g. time-consuming game logic with -O3 and UI with -Os), it falls apart.
« Last Edit: January 31, 2012, 09:10:27 am by Lionel Debroux »
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: [68k] TIGCC under Linux?
« Reply #13 on: January 31, 2012, 09:09:35 am »
I reran the entire Install script after adding in that last line and it said something along the lines of "Installation Done" and asked to configure the environment files. Now i just type "tigcc XXX.asm" and it compiles it into a .89z file, which runs nicely on the emulator (though it's a little difficult to play Phoenix clicking on the arrow buttons with the mouse ;)). I'm not too concerned about an ide, it's just as easy to make a little script to compile/send to the emulator for testing :) I'm not so good at computers so i don't really understand the whole TPR issue, but i think i'm now ready to start writing some simple programs :D

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [68k] TIGCC under Linux?
« Reply #14 on: January 31, 2012, 09:15:03 am »
Quote
I'm not too concerned about an ide, it's just as easy to make a little script to compile/send to the emulator for testing :)
There are multiple compile scripts in TICT programs, which could use a little bit of factorization to reduce copy&paste abuse on e.g. compiler and linker flags :D
There's a utility script for transferring a file to the emulator, I'll post it later.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.