English Amiga Board


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

 
 
Thread Tools
Old 28 April 2018, 10:57   #821
plasmab
Banned
 
plasmab's Avatar
 
Join Date: Sep 2016
Location: UK
Posts: 2,917
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  
Old 28 April 2018, 12:12   #822
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
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
Banned
 
plasmab's Avatar
 
Join Date: Sep 2016
Location: UK
Posts: 2,917
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
Banned
 
plasmab's Avatar
 
Join Date: Sep 2016
Location: UK
Posts: 2,917
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:29   #825
plasmab
Banned
 
plasmab's Avatar
 
Join Date: Sep 2016
Location: UK
Posts: 2,917
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   #826
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
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   #827
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
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   #828
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
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   #829
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
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   #830
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
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   #831
Hedeon
Semi-Retired
 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,008
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   #832
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
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   #833
Hedeon
Semi-Retired
 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,008
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   #834
matjam
 
Posts: n/a
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.
 
Old 04 May 2018, 08:39   #835
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
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   #836
matjam
 
Posts: n/a
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.
 
Old 04 May 2018, 22:17   #837
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
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   #838
arcanist
Registered User
 
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 409
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 offline  
Old 12 May 2018, 23:45   #839
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
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  
Old 29 May 2018, 18:08   #840
lantus360
Registered User
 
Join Date: Feb 2013
Location: Olathe, Kansas
Posts: 214
just updated to the latest from git

im getting these link errors

Code:
./bin/organ.o(.text+0x96):./bin/organ.o: undefined reference to `__memset64'
./bin/RSPiX/Src/CYAN/Unix/uDialog.o(.text+0x2be):./bin/RSPiX/Src/CYAN/Unix/uDialog.o: undefined reference to `__sF'
my link statement looks like this

Code:
m68k-amigaos-g++ -o <all my .o files>
-L"C:\cygwin\opt\amiga\m68k-amigaos\clib2\lib" -L"C:\cygwin\opt\amiga\m68k-amigaos\libnix\lib" -lc -lamiga -lm

i tried a define memset64 as memset in a header file but it didnt resolve it. any ideas? Im building with g++ with -O2 -noixemul

thanks
lantus360 is offline  
 


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 15:38.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.17004 seconds with 14 queries