English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 28 April 2018, 10:57   #821
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 2,121
Quote:
Originally Posted by alkis View Post
is building of toolchain halted by ira erroring or is it just me?


I saw that .. use the Amiga-Gcc repo instead
plasmab is offline  
AdSense AdSense  
Old 28 April 2018, 12:12   #822
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 403
Quote:
Originally Posted by plasmab View Post
I saw that .. use the Amiga-Gcc repo instead
but I am using that *shrug*
alkis is offline  
Old 28 April 2018, 12:23   #823
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 2,121
Quote:
Originally Posted by alkis View Post
but I am using that *shrug*


Ah now I remember... ira has been changed.. I had to patch it manually.
plasmab is offline  
Old 28 April 2018, 12:29   #824
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 2,121
actually no. I had to edit ..

https://github.com/bebbo/amigaos-cross-toolchain

but not

https://github.com/bebbo/amiga-gcc

it worked ok .
plasmab is offline  
Old 28 April 2018, 12:51   #825
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 403
It tries to do that:
cd projects/ira && cc -o /home/alex/t/amiga-gcc/build/ira/ira -Os ira.c ira_2.c supp.c

and gets linker errors, which sounds reasonable cause there a lot more *.c files in there than the three that tries to make an executable out of.
alkis is offline  
Old 28 April 2018, 12:57   #826
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 403
If I cd in projects/ira and type make it builds.
So, make -n from amiga-gcc folder:
Code:
mkdir -p build/ira
cd projects/ira && cc -o /home/alex/t/amiga-gcc/build/ira/ira -Os ira.c ira_2.c supp.c
mkdir -p /opt/amiga/gcc6/bin/
install build/ira/ira /opt/amiga/gcc6/bin/
echo "built /opt/amiga/gcc6/bin/ira"
echo "done" >build/ira/_done
and make -n from ira folder:
Code:
gcc -c -O2 -std=c99 -o obj/amiga_hunks.o  amiga_hunks.c
gcc -c -O2 -std=c99 -o obj/atari.o  atari.c
gcc -c -O2 -std=c99 -o obj/binary.o  binary.c
gcc -c -O2 -std=c99 -o obj/config.o  config.c
gcc -c -O2 -std=c99 -o obj/constants.o  constants.c
gcc -c -O2 -std=c99 -o obj/elf.o  elf.c
gcc -c -O2 -std=c99 -o obj/init.o  init.c
gcc -c -O2 -std=c99 -o obj/ira.o  ira.c
gcc -c -O2 -std=c99 -o obj/ira_2.o  ira_2.c
gcc -c -O2 -std=c99 -o obj/megadrive.o  megadrive.c
gcc -c -O2 -std=c99 -o obj/opcode.o  opcode.c
gcc -c -O2 -std=c99 -o obj/supp.o  supp.c
gcc -o ira obj/amiga_hunks.o obj/atari.o obj/binary.o obj/config.o obj/constants.o obj/elf.o obj/init.o obj/ira.o obj/ira_2.o obj/megadrive.o obj/opcode.o obj/supp.o
alkis is offline  
Old 01 May 2018, 18:41   #827
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 265
Exclamation

DANGER * ACHTUNG * ATTENTION * ATTENZIONE * ATENCIÓN * ????????*

I'll soon release an update to amiga-gcc which also affects some include/lib folders in the prefix.

Changes:
  • The toplevel folders include and lib are searched (/opt/amiga/include, /opt/amiga/lib), and clean-prefix won't touch these two folders.
  • the ndk headers plus roadshow headers will reside in m68k-amigaos/ndk-include
  • ndk 1.3 alike headers will reside in m68k-amigaos/ndk13-include. These are used if -mcrt=nix13 is specified. Those headers are not real 1.3 headers, they get constructed from the ndk headers and may contain stuff not available in 1.3 but at least only 1.3 functions are visible
  • the m68k-amigaos/sys-include folder will contain new headers drafted from newlib 3.0
  • a libc.a from newlib is then the default lib - also some libnix libs will be used as default.
  • libnix got some wchar_t functions - not all yet and some are dummies...
Most programs do compile and run again, but e.g. hello-iostream with libnix does not print anything yet, instead it hit the 1MB size :-)


Using libnix will still yield small programs, newlib (default) programs are fat due to some overhead (e.g. reentrant errno, functions etc.). clib2 seems to work too.


You have been warned
bebbo is offline  
Old 03 May 2018, 05:23   #828
NovaCoder
Registered User
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 3,450
Quote:
Originally Posted by sbergmann View Post
I started to work on a Dockerfile for building a Docker image with this toolchain: https://github.com/sebastianbergmann...ter/Dockerfile

This is very cool, thanks for that

https://hub.docker.com/r/sebastianbe...amigaos-bebbo/
NovaCoder is offline  
Old 03 May 2018, 07:35   #829
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 265
Quote:
Originally Posted by NovaCoder View Post
his new repo is: https://github.com/sebastianbergmann/docker-amiga-gcc
bebbo is offline  
Old 03 May 2018, 10:35   #830
Hedeon
Sonnet Hacker

 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 557
Quote:
Originally Posted by bebbo View Post
  • a libc.a from newlib is then the default lib - also some libnix libs will be used as default.

Is the source also on git? Could not find it.
Hedeon is offline  
Old 03 May 2018, 13:07   #831
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 265
Quote:
Originally Posted by Hedeon View Post
Is the source also on git? Could not find it.
"I'll soon release an update"
bebbo is offline  
Old 03 May 2018, 13:29   #832
Hedeon
Sonnet Hacker

 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 557
If you do that, is there a possiblity that I could add my WarpOS only sources? Not that it is high standard code, but at least it is working somewhat.
Hedeon is offline  
Old 04 May 2018, 03:22   #833
matjam
Registered User
 
Join Date: May 2018
Location: Concord CA, USA
Posts: 2
Hi Bebbo, this work is awesome. I'm very thankful you've taken the time.

I'm trying to link against the socket library, and I am obviously missing something:-

Code:
m68k-amigaos-gcc -c -noixemul -m68020 -O3 -Wall -fomit-frame-pointer hello.c
m68k-amigaos-gcc -noixemul -m68020 -O3 -Wall -fomit-frame-pointer -lnix hello.o -o hello
hello.o(.text+0x1a4): undefined reference to `socket'
hello.o(.text+0x1c2): undefined reference to `inet_addr'
hello.o(.text+0x1dc): undefined reference to `connect'
hello.o(.text+0x26c): undefined reference to `recv'
hello.o(.text+0x214): undefined reference to `send'
collect2: error: ld returned 1 exit status
Makefile:11: recipe for target 'hello' failed
make: *** [hello] Error 1
How do I link against the socket library properly? I'm not familiar with how this is done - I'm used to linking against native libraries so this cross compiler shenanigans is new to me. I'm assuming I'm missing some flags here.
matjam is offline  
Old 04 May 2018, 08:39   #834
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 265
Quote:
Originally Posted by matjam View Post
Hi Bebbo, this work is awesome. I'm very thankful you've taken the time.

I'm trying to link against the socket library, and I am obviously missing something:-

Code:
m68k-amigaos-gcc -c -noixemul -m68020 -O3 -Wall -fomit-frame-pointer hello.c
m68k-amigaos-gcc -noixemul -m68020 -O3 -Wall -fomit-frame-pointer -lnix hello.o -o hello
hello.o(.text+0x1a4): undefined reference to `socket'
hello.o(.text+0x1c2): undefined reference to `inet_addr'
hello.o(.text+0x1dc): undefined reference to `connect'
hello.o(.text+0x26c): undefined reference to `recv'
hello.o(.text+0x214): undefined reference to `send'
collect2: error: ld returned 1 exit status
Makefile:11: recipe for target 'hello' failed
make: *** [hello] Error 1
How do I link against the socket library properly? I'm not familiar with how this is done - I'm used to linking against native libraries so this cross compiler shenanigans is new to me. I'm assuming I'm missing some flags here.
-lsocket
bebbo is offline  
Old 04 May 2018, 19:10   #835
matjam
Registered User
 
Join Date: May 2018
Location: Concord CA, USA
Posts: 2
Quote:
Originally Posted by bebbo View Post
-lsocket
So. I tried that. My issue was the position of -lsocket. It needs to be before the -o ... :-)

I guess because it's passed to the linker then.

Thanks.
matjam is offline  
Old 04 May 2018, 22:17   #836
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 265
Quote:
Originally Posted by matjam View Post
So. I tried that. My issue was the position of -lsocket. It needs to be before the -o ... :-)

I guess because it's passed to the linker then.

Thanks.
The linker processes the objects and libraries from left to right, -lsocket must be behind objects using socket functions:
Code:
m68k-amigaos-gcc -noixemul -Os *.c -o x -lsocket
bebbo is offline  
Old 05 May 2018, 03:53   #837
arcanist
Registered User
 
Join Date: Dec 2017
Location: Austin, TX
Age: 35
Posts: 31
I just ported my mixed C/asm softsynth from VBCC to GCC. The executable size dropped from 50K down to 20K and worked first time. I had to work around three bugs in VBCC for this project.

With GCC it was also trivial to add automatic header dependency tracking to my makefile. Nice!
arcanist is online now  
Old 12 May 2018, 23:45   #838
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 265
Quote:
Originally Posted by bebbo View Post
DANGER * ACHTUNG * ATTENTION * ATTENZIONE * ATENCIÓN * ????????*

I'll soon release an update to amiga-gcc which also affects some include/lib folders in the prefix.

Changes:
  • The toplevel folders include and lib are searched (/opt/amiga/include, /opt/amiga/lib), and clean-prefix won't touch these two folders.
  • the ndk headers plus roadshow headers will reside in m68k-amigaos/ndk-include
  • ndk 1.3 alike headers will reside in m68k-amigaos/ndk13-include. These are used if -mcrt=nix13 is specified. Those headers are not real 1.3 headers, they get constructed from the ndk headers and may contain stuff not available in 1.3 but at least only 1.3 functions are visible
  • the m68k-amigaos/sys-include folder will contain new headers drafted from newlib 3.0
  • a libc.a from newlib is then the default lib - also some libnix libs will be used as default.
  • libnix got some wchar_t functions - not all yet and some are dummies...
Most programs do compile and run again, but e.g. hello-iostream with libnix does not print anything yet, instead it hit the 1MB size :-)


Using libnix will still yield small programs, newlib (default) programs are fat due to some overhead (e.g. reentrant errno, functions etc.). clib2 seems to work too.


You have been warned
Ok, now it's to late - I just pushed a bunch of changes^^
bebbo is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
New GCC based dev toolchain for AmigaOS 3.x cla Coders. Releases 8 24 December 2017 10:18
Issue with photon/xxxx WinUAE Toolchain arpz Coders. Asm / Hardware 2 26 September 2015 22:33
New 68k gcc toolchain arti Coders. C/C++ 17 31 July 2015 03:59
Hannibal's WinUAE Demo Toolchain 5 Bobic Amiga scene 1 23 July 2015 21:04
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 14:45

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.10378 seconds with 15 queries