Welcome, Guest. Please login or register.

Author Topic: GCC 4.x or Clang for 68k  (Read 6287 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
GCC 4.x or Clang for 68k
« on: May 13, 2014, 03:00:56 AM »
What are the major barriers to having a modern version of either of these tools on 68k Amigas? I've seen a 4.5 version of GCC as a cross-compiler for cygwin and windows. Couldn't that be used to build a more modern version of GCC for native 68k?

I guess my questions are more centered around whether or not there is something major preventing it from happening or if it's just simply not been done. Anybody toyed with this? Karlos? Someone else?
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
GCC 4.x or Clang for 68k
« Reply #1 on: May 13, 2014, 03:18:47 AM »
Clang would require a new backend be written for LLVM and a new memory handler since a full Clang executable requires 1gig to run.

As for a newer GCC, the you could cross-develop from AROS and then run ELF2HUNK on the executable.
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Re: GCC 4.x or Clang for 68k
« Reply #2 on: May 13, 2014, 03:21:18 AM »
I was just wondering if there would be any major roadblocks from compiling GCC 4.x for 68k using the cross-compiler to build it? I suspect someone would have already tried that but...
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
GCC 4.x or Clang for 68k
« Reply #3 on: May 13, 2014, 03:59:42 AM »
It works on AROS 68k but uses the ELF loader so it probably won't backport to AmigaOS easily.
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: GCC 4.x or Clang for 68k
« Reply #4 on: May 13, 2014, 06:01:55 AM »
Quote from: nyteschayde;764347
I was just wondering if there would be any major roadblocks from compiling GCC 4.x for 68k using the cross-compiler to build it? I suspect someone would have already tried that but...


Quote from: SamuraiCrow;764348
It works on AROS 68k but uses the ELF loader so it probably won't backport to AmigaOS easily.


Right. It's not 68k that is the problem but the Amiga. There were Amiga specific versions of GCC up to 3.4.0 which most importantly generated Amiga hunk format executables but they were never "official". Anyone adapting and compiling the source for use on a 68k Amiga is going to need very good Linux skills, good understanding of the Amiga and 68k and lots of patience. On the other hand, the vbcc, vasm and vlink sources compile on my 68060 Amiga with minimal effort. There should be a new version of vbcc coming at some point but it is C only (no C++).
 

Offline psxphill

Re: GCC 4.x or Clang for 68k
« Reply #5 on: May 13, 2014, 12:08:47 PM »
Quote from: SamuraiCrow;764348
It works on AROS 68k but uses the ELF loader so it probably won't backport to AmigaOS easily.

As long as the compiler can cope with generating calls to amiga libraries then getting elf converted to hunk should be relatively simple. Either as a stand alone step, or integrated into ld.
 
http://www.evillabs.net/wiki/index.php/AROS_m68k-amiga#Feb_8.2C_2011:_ELF2HUNK_utility
 
if the wiki doesn't work then scroll down the cached page
 
http://webcache.googleusercontent.com/search?q=cache:VHx5YO702BgJ:www.evillabs.net/wiki/index.php/AROS_m68k-amiga&hl=en&gl=uk&strip=1
« Last Edit: May 13, 2014, 12:16:04 PM by psxphill »
 

Offline nicholas

Re: GCC 4.x or Clang for 68k
« Reply #6 on: May 13, 2014, 12:18:45 PM »
Quote from: matthey;764354
Right. It's not 68k that is the problem but the Amiga. There were Amiga specific versions of GCC up to 3.4.0 which most importantly generated Amiga hunk format executables but they were never "official". Anyone adapting and compiling the source for use on a 68k Amiga is going to need very good Linux skills, good understanding of the Amiga and 68k and lots of patience. On the other hand, the vbcc, vasm and vlink sources compile on my 68060 Amiga with minimal effort. There should be a new version of vbcc coming at some point but it is C only (no C++).

Will vbcc support c++ at some point in the future or is it something that holds no interest for Frank and Volker?
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: GCC 4.x or Clang for 68k
« Reply #7 on: May 13, 2014, 01:43:03 PM »
Quote from: SamuraiCrow;764346
Clang would require a new backend be written for LLVM and a new memory handler since a full Clang executable requires 1gig to run.


Are you sure? I run clang on both my 256meg and my 512meg Raspberry Pis

Quote


It works on AROS 68k but uses the ELF loader so it probably won't backport to AmigaOS easily.


Doesn't AROS 68k support  both Amiga Hunks and ELF!?

Offline psxphill

Re: GCC 4.x or Clang for 68k
« Reply #8 on: May 13, 2014, 01:55:15 PM »
Quote from: bloodline;764366
Doesn't AROS 68k support both Amiga Hunks and ELF!?

I believe so, but I got the impression that the m68k gcc 4 port for aros compiler only generates elf.
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: GCC 4.x or Clang for 68k
« Reply #9 on: May 13, 2014, 02:13:34 PM »
Quote from: psxphill;764368
I believe so, but I got the impression that the m68k gcc 4 port for aros compiler only generates elf.


Oh right, yeah. The idea has always to eventually move away from the archaic HUNK format.

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: GCC 4.x or Clang for 68k
« Reply #10 on: May 13, 2014, 05:35:39 PM »
Quote from: nicholas;764363
Will vbcc support c++ at some point in the future or is it something that holds no interest for Frank and Volker?


I have heard nothing of C++ support. Volker is working on supporting OpenCL. The c99 support is also improving (but will probably never be 100%).
 

Offline LiveForIt

Re: GCC 4.x or Clang for 68k
« Reply #11 on: May 13, 2014, 06:14:57 PM »
Quote from: matthey;764381
I have heard nothing of C++ support. Volker is working on supporting OpenCL. The c99 support is also improving (but will probably never be 100%).


Well you can compile for C++ (G++) compiler but Amiga header files are “C” code only no classes or namespaces or references and so, and when you compile for C++ the exe file gets bigger, unless you need classes, name spaces and/or references, it does not make sense.

But anyway C++ is nice monogramming language, one thing that is not always clear whit C++ is if argument is changed or if its not, C# is more clear on that issue, as you most to type “ref” where the argument is a “ref” type, any how “ref” are not so special pointers and address of “&” symbol does more or less the same thing.

Anyway you can more or less do the same thing in C as you can in C++, whit some clever workarounds.
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: GCC 4.x or Clang for 68k
« Reply #12 on: May 13, 2014, 07:56:39 PM »
Quote from: LiveForIt;764386
Well you can compile for C++ (G++) compiler but Amiga header files are “C” code only no classes or namespaces or references and so, and when you compile for C++ the exe file gets bigger, unless you need classes, name spaces and/or references, it does not make sense.

But anyway C++ is nice monogramming language, one thing that is not always clear whit C++ is if argument is changed or if its not, C# is more clear on that issue, as you most to type “ref” where the argument is a “ref” type, any how “ref” are not so special pointers and address of “&” symbol does more or less the same thing.

Anyway you can more or less do the same thing in C as you can in C++, whit some clever workarounds.

I do not have much experience with C++ but I do know it is popular and needed for porting other programs to the Amiga. I know it's less efficient as I have looked at the resulting disassembled executables (I see indirect branches and lots of unused code). Regular C is less complex (simpler syntax), offers most of what I need and can generate more efficient executables. Some programmers need C++ and more GCC compatibility though. A newer version of GCC or Clang would be great but it really needs a persistent effort by a knowledgeable team like the original GeekGadgets team.
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Re: GCC 4.x or Clang for 68k
« Reply #13 on: May 13, 2014, 08:29:26 PM »
Well what got me started on all this was that I wanted to Objective-C on the Amiga. I know it's possible but many of the useful libs are missing and even getting a version of GCC for the Amiga that can compile Objective C is tough.

I've managed to some degree but I just noticed that in order to build something like GNUstep (in order to get the appropriate Foundation frameworks which would make Objective-C useful on the Amiga) you need at least 2.9.5.3. Now we do have that version, but I can't help but then wish for more ObjC features that exist in the newer compilers such as blocks, automatic property synthesis, etc...

I have CubicIDE which has GCC 3.3 for the 68k Amiga, but I cannot find those "alpha" versions anywhere on the web anymore. The GCC-lite packages on Aminet are very good and easy to get started with but they're only 2.7.0.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: GCC 4.x or Clang for 68k
« Reply #14 on: May 13, 2014, 10:42:58 PM »
Quote from: nyteschayde;764395

I have CubicIDE which has GCC 3.3 for the 68k Amiga, but I cannot find those "alpha" versions anywhere on the web anymore. The GCC-lite packages on Aminet are very good and easy to get started with but they're only 2.7.0.


Maybe you couldn't find it because Back2Roots.org has been down. It's supposed to be coming back:

http://eab.abime.net/showthread.php?t=73684