English Amiga Board


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

 
 
Thread Tools
Old 04 May 2017, 23:58   #221
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
Quote:
Just pushed an update with plenty fixes and some improvements.
i have had earlier an issue with running binaries linked with stdio (exclusively) on aros68k, it was some memory deallation afair, could be caught with mungwall. still i didnt knew if this was your gcc or aros, but does it sound any familiar? would that be worth to retest if its gone?

im not trying to be lazy, just have so much (amiga coding) stuff here in parallel
wawa is offline  
Old 05 May 2017, 09:55   #222
arti
Registered User
 
Join Date: Jul 2008
Location: Poland
Posts: 662
My report about this version.
I've compiled zlib with gcc 6.3 but it isn't faster, grr.

NetSurf compiled but libc wasn't linked.
What is default libc here ? clib2 ?

I couldn't compile asl code with clib/asl_protos.h
struct FileRequester *AllocFileRequest( VOID );
error: AllocFileRequest takes 0 arguments but 1 used


Thanks bebbo for working on this !

Last edited by arti; 06 May 2017 at 13:02.
arti is offline  
Old 05 May 2017, 11:06   #223
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
@arti
Did you try setting --std=c90 so old syntax will work?
Samurai_Crow is offline  
Old 05 May 2017, 11:34   #224
arti
Registered User
 
Join Date: Jul 2008
Location: Poland
Posts: 662
Thx, will try.
arti is offline  
Old 05 May 2017, 20:14   #225
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
Is this compiler version ready to be used with Amiga as the old ggc 2? Where can It be downloaded?
Looks exciting!
tolkien is offline  
Old 06 May 2017, 04:55   #226
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Quote:
Originally Posted by tolkien View Post
Is this compiler version ready to be used with Amiga as the old ggc 2? Where can It be downloaded?
Looks exciting!
It is a cross compiler toolchain.
Samurai_Crow is offline  
Old 06 May 2017, 09:06   #227
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
Perhaps it is even better. Will look where to download and give a try. Thanks
tolkien is offline  
Old 06 May 2017, 10:55   #228
arti
Registered User
 
Join Date: Jul 2008
Location: Poland
Posts: 662
Quote:
Originally Posted by Samurai_Crow View Post
@arti
Did you try setting --std=c90 so old syntax will work?
Now it's:
sys-include/clib/asl_protos.h:32:23: error: expected identifier or ‘(’ before ‘{’ token
struct FileRequester *AllocFileRequest( );
^~~~~


Code:
struct FileRequester
{
    UBYTE	  fr_Reserved0[4];
    STRPTR	  fr_File;	      /* Contents of File gadget on exit    */
    STRPTR	  fr_Drawer;	      /* Contents of Drawer gadget on exit  */
    UBYTE	  fr_Reserved1[10];
    WORD	  fr_LeftEdge;	      /* Coordinates of requester on exit   */
    WORD	  fr_TopEdge;
    WORD	  fr_Width;
    WORD	  fr_Height;
    UBYTE	  fr_Reserved2[2];
    LONG	  fr_NumArgs;	      /* Number of files selected	    */
    struct WBArg *fr_ArgList;	      /* List of files selected	    */
    APTR	  fr_UserData;	      /* You can store your own data here   */
    UBYTE	  fr_Reserved3[8];
    STRPTR	  fr_Pattern;	      /* Contents of Pattern gadget on exit */
};
arti is offline  
Old 06 May 2017, 12:10   #229
Fook42
Registered User
 
Join Date: Aug 2016
Location: germany
Posts: 67
Hello,

first i want to say thank you, Bebbo, for this gcc 6.x !!

i gave it a try and have to say; it was really easy and smooth to install the toolchain.
but now i'm facing a problem with a project which used to compile without any flaws on gcc 2.95.3 - maybe someone can tell me more about this error and how to fix it?

Code:
/opt/m68k6x-amigaos/lib/gcc/m68k-amigaos/6.3.1d/libgcc.a(fpgnulib.o)(.text+0x144): In function `__floatsidf':
/home/renef/AMIGA/new/amigaos-cross-toolchain/submodules/gcc-6/libgcc/config/m68k/fpgnulib.c:174: multiple definition of `__floatsidf'
/opt/m68k6x-amigaos/m68k-amigaos/libnix/lib/libm020/libnix/libnix.a(__floatsidf.o)(.text+0x0):__floatsidf.o: first defined here

/opt/m68k6x-amigaos/lib/gcc/m68k-amigaos/6.3.1d/libgcc.a(fpgnulib.o)(.text+0x564): In function `__fixdfsi':
/home/renef/AMIGA/new/amigaos-cross-toolchain/submodules/gcc-6/libgcc/config/m68k/fpgnulib.c:343: multiple definition of `__fixdfsi'
/opt/m68k6x-amigaos/m68k-amigaos/libnix/lib/libm020/libnix/libnix.a(__fixdfsi.o)(.text+0x0):__fixdfsi.o: first defined here
collect2: error: ld returned 1 exit status
Makefile:16: recipe for target 'IT2C' failed
make: *** [IT2C] Error 1
and this is my Makefile:
Code:
C = /opt/m68k6x-amigaos/bin/m68k-amigaos-gcc
STRIP = /opt/m68k6x-amigaos/bin/m68k-amigaos-strip
CFLAGS = -noixemul -m68020 -Wall
TARGET = IT2C
LDFLAGS = -lm

OBJDIR = objdir
SRC = $(wildcard *.c)
# OBJS = $(addprefix $(OBJDIR)/,$(dir $(SOURCE)), $(notdir $(SOURCE:.c=.o)))

$(TARGET): $(SRC)
                @echo "============="
                @echo "Linking the target $@"
                @echo "============="
                @$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
                @$(STRIP) $@
                @echo -- Link finished --


%.o : %.c
                @echo "============="
                @echo "Compiling $<"
                $(CC) $(CFLAGS) -c $<

Last edited by Fook42; 06 May 2017 at 13:16.
Fook42 is offline  
Old 06 May 2017, 13:01   #230
arti
Registered User
 
Join Date: Jul 2008
Location: Poland
Posts: 662
You can solve this by adding this to LDFLAGS -Wl,--allow-multiple-definition
arti is offline  
Old 06 May 2017, 13:24   #231
Fook42
Registered User
 
Join Date: Aug 2016
Location: germany
Posts: 67
thanks, arti... that solves at least the problem to compile/link.

but within my code i now face the problem that a statement like this:
SPRINTF(string, "%3.2f", floatvariable);
leads to string with this value
"%3.2f" .. instead of "982.32" (as it used to be with gcc 2.95.3)
.. so no floatingpoint-number is converted or handled correctly in this case.

Last edited by Fook42; 06 May 2017 at 13:33.
Fook42 is offline  
Old 06 May 2017, 14:14   #232
arti
Registered User
 
Join Date: Jul 2008
Location: Poland
Posts: 662
Put -lm befiore -lc in LDFLAGS.
This works in case of clib2, compile with -mcrt=clib2 or remove -noixemul. (I think)
arti is offline  
Old 06 May 2017, 19:33   #233
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Hi Bebbo, compiled your toolchain in cygwin 32bit environment in 64 bit Windows (with a current gcc 6.3.1 compiled branch, not the default 5.4).
Worked like a charm.

Tested some simple progs, no problems at all.
My compliments for your "time waste"

Bye,
ross
ross is offline  
Old 06 May 2017, 20:14   #234
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Hi Bebbo, I'm reading through the thread (near message #82) wawa requesting compiler support for AROS.
I second that..

I realize it's a huge job (with real support for A4, A5, A6, better register passing and resident stuff..) but I think that AROS for 68k have a future.
I don't know how to help (little time..) but, if you want, count on me.

Bye!
ross

PS: with very small changes I managed to compilie AROS in cygwin.
ross is offline  
Old 07 May 2017, 02:00   #235
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
Quote:
Originally Posted by ross View Post
wawa requesting compiler support for AROS.
I second that..
please.. im not requesting anything. i honour bebbos work as it is, i have only encountered some problems with binares linked against stdcio on aros which i still dont know whose problem that is, aros being eventually more restrictive on memory allocation fails.

other than that, i hope when mature enough, someone may implement/port bebbos patches to aros toolchain/build tree in order to make aros more compatible/interchangeable with aos modules, when it comes to 68k.
wawa is offline  
Old 07 May 2017, 02:06   #236
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
Quote:
Originally Posted by ross View Post

PS: with very small changes I managed to compilie AROS in cygwin.
rally? wow! i dont remember if i have even attempted that. but aros build system is being moved towards being compiler agnostic, eventually beyond gcc. it is also being moved towards be self contained. can you be more specific on changes necessary? even if they might not be the right thing to commit as such, they might be helpful to improve the build system. if you are experienced enough aou might yoin the aros ml to discuss it with the developers.
wawa is offline  
Old 07 May 2017, 11:10   #237
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by wawa View Post
please.. im not requesting anything. i honour bebbos work as it is, i have only encountered some problems with binares linked against stdcio on aros which i still dont know whose problem that is, aros being eventually more restrictive on memory allocation fails.
Sorry wawa, be patient .. my english is very primitive and self-taught.
The right word was to "suggest" or "a possible improvement" and not "request"..
Bebbo's work is absolutely what's needed for the Amiga scene.
(I realize that having lost 20 years does not make me the right person to talk about it...)

Quote:
other than that, i hope when mature enough, someone may implement/port bebbos patches to aros toolchain/build tree in order to make aros more compatible/interchangeable with aos modules, when it comes to 68k.
Yes, this is what I meant

Bye!
ross
ross is offline  
Old 07 May 2017, 11:24   #238
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by wawa View Post
rally? wow! i dont remember if i have even attempted that. but aros build system is being moved towards being compiler agnostic, eventually beyond gcc. it is also being moved towards be self contained. can you be more specific on changes necessary? even if they might not be the right thing to commit as such, they might be helpful to improve the build system. if you are experienced enough aou might yoin the aros ml to discuss it with the developers.
nothing special really
some dependecies about libnetpbm/netpbm, libiconv (and a -liconv in linking flexcat) and some string function in fd2pragma
I was patching in real time when a problem came up during compilation so I could forget something..

cheers,
ross
ross is offline  
Old 07 May 2017, 15:35   #239
ovale
Registered User
 
Join Date: Jun 2014
Location: milan / italy
Posts: 174
Hello,
I'm really looking forward for a modern AmigaOS compatible GCC.

I tried to compile endofexclusive's Astub but it has linker issues, it want's to use libc even if nostdlib is passed as parameter.

Here how to reproduce using dockerized gcc:

git clone https://github.com/endofexclusive/astub.git
cd astub
docker run -v $(pwd):/host -it sebastianbergmann/m68k-amigaos-bebbo bash
cd /host/amiga/build/
apt-get update && apt-get install -y make
sed -i.bak -e 's/vasmm68k_mot/vasm/' -e 's/m68k-elf-/m68k-amigaos-/' -e 's/-Felf/-Fhunk/' Makefile
make


vasm -quiet -phxass -m68000 -Fhunk -o exception_68000.o ../../m68k/exception_68000.s
vasm -quiet -phxass -m68000 -Fhunk -o standalone.o ../../amiga/standalone.s
m68k-amigaos-gcc -MT hex.o -MMD -MP -MF .d/hex.Td -march=68000 -fomit-frame-pointer -mpcrel -mshort -Os -Wall -Wextra -pedantic -ansi -I../../include -I../../m68k/include -I../../amiga/include -c -o hex.o ../../hex.c
mv -f .d/hex.Td .d/hex.d
m68k-amigaos-gcc -MT pkt.o -MMD -MP -MF .d/pkt.Td -march=68000 -fomit-frame-pointer -mpcrel -mshort -Os -Wall -Wextra -pedantic -ansi -I../../include -I../../m68k/include -I../../amiga/include -c -o pkt.o ../../pkt.c
mv -f .d/pkt.Td .d/pkt.d
m68k-amigaos-gcc -MT cmd.o -MMD -MP -MF .d/cmd.Td -march=68000 -fomit-frame-pointer -mpcrel -mshort -Os -Wall -Wextra -pedantic -ansi -I../../include -I../../m68k/include -I../../amiga/include -c -o cmd.o ../../cmd.c
mv -f .d/cmd.Td .d/cmd.d
m68k-amigaos-gcc -MT stub_arch.o -MMD -MP -MF .d/stub_arch.Td -march=68000 -fomit-frame-pointer -mpcrel -mshort -Os -Wall -Wextra -pedantic -ansi -I../../include -I../../m68k/include -I../../amiga/include -c -o stub_arch.o ../../m68k/stub_arch.c
mv -f .d/stub_arch.Td .d/stub_arch.d
m68k-amigaos-gcc -MT a500_init.o -MMD -MP -MF .d/a500_init.Td -march=68000 -fomit-frame-pointer -mpcrel -mshort -Os -Wall -Wextra -pedantic -ansi -I../../include -I../../m68k/include -I../../amiga/include -c -o a500_init.o ../../amiga/a500_init.c
mv -f .d/a500_init.Td .d/a500_init.d
m68k-amigaos-gcc -MT uart.o -MMD -MP -MF .d/uart.Td -march=68000 -fomit-frame-pointer -mpcrel -mshort -Os -Wall -Wextra -pedantic -ansi -I../../include -I../../m68k/include -I../../amiga/include -c -o uart.o ../../amiga/uart.c
mv -f .d/uart.Td .d/uart.d
m68k-amigaos-gcc -nostdlib exception_68000.o standalone.o hex.o pkt.o cmd.o stub_arch.o a500_init.o uart.o -T a500.ld -o main -Wl,-Map=main.map
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/../../../../m68k-amigaos/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Makefile:31: recipe for target 'main' failed
make: *** [main] Error 1
ovale is offline  
Old 07 May 2017, 16:15   #240
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by ovale View Post
Hello,
I'm really looking forward for a modern AmigaOS compatible GCC.

I tried to compile endofexclusive's Astub but it has linker issues, it want's to use libc even if nostdlib is passed as parameter.

Here how to reproduce using dockerized gcc:

git clone https://github.com/endofexclusive/astub.git
...
...
m68k-amigaos-gcc -nostdlib exception_68000.o standalone.o hex.o pkt.o cmd.o stub_arch.o a500_init.o uart.o -T a500.ld -o main -Wl,-Map=main.map
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/../../../../m68k-amigaos/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Makefile:31: recipe for target 'main' failed
make: *** [main] Error 1
Right now I am only focusing on -noixemul.
Some other options should also work:
-mcrt=clib2
-mcrt=nix13

The ixemul.library was not built at the time I forked. And I did not put that many effort into ixemul.library.

Right now I'm looking into the funny linker why there are often unresolved symbols...
... and it seems that you have to specify some libs multiple times in the right order, to get everything resolved... /shrug.

Feel free to open real issues at https://github.com/bebbo/amigaos-cross-toolchain/issues


EDITH:

What's the output with '-v'? When I'm using '-nostdlib' then there is no lib in the parameters for 'collect'.

Last edited by bebbo; 07 May 2017 at 17:12.
bebbo 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 18:07.

Top

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