11 January 2019, 01:22 | #1021 | |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,437
|
Quote:
Thanks |
|
11 January 2019, 10:36 | #1022 |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
|
11 January 2019, 11:00 | #1023 |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,437
|
Cool, thanks
|
13 January 2019, 23:39 | #1024 |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
Code:
m68k-amigaos-gcc version 6.5.0b 20190113225614 (GCC) PS: Does this thread need a rename? |
14 January 2019, 00:07 | #1025 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 882
|
|
14 January 2019, 06:58 | #1026 |
Registered User
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
|
|
15 January 2019, 00:05 | #1027 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
@bebbo Any chance of getting libatomic included?
EDIT: Managed to compile it from your gcc repo. Last edited by Marlon_; 15 January 2019 at 00:35. |
15 January 2019, 08:07 | #1028 |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
|
15 January 2019, 10:23 | #1029 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
Huh? It was saying it was missing when I tried to compile something that required it. So I compiled it by myself... I recompiled the toolchain about a month ago.
EDIT: Code:
$ find /opt/m68k-amigaos/m68k-amigaos/ |grep atomic /opt/m68k-amigaos/m68k-amigaos/sys-include/stdatomic.h |
15 January 2019, 10:43 | #1030 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
Quote:
Code:
find /opt/m68k-amigaos/ |grep atomic |
|
15 January 2019, 11:45 | #1031 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
|
21 January 2019, 08:12 | #1032 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 681
|
I got LTO working with ScummVM.
After a bit of digging I found a change that was surprisingly simple. LTO with the gcc toolchain on Amiga currently does not deal with .a files. As Bebbo suggested, we need to prevent ScummVM from building .a's and linking them into the executable. Instead link all individual .o files: https://github.com/mheyer32/scummvm-...31ae49df5b1c1e Maybe this helps others with their ScummVM ports as well. The executable shrunk by almost 500kb. Not as much as I hoped for, but nevertheless a really good gain for 'just flicking a switch' :-) It seems like it may even run faster, but that could be just placebo - I did not do measurements. Thanks for all the good work, Bebbo!! |
21 January 2019, 21:49 | #1033 |
Registered User
Join Date: Aug 2009
Location: UK
Posts: 30
|
Hi,
I'm trying to get started with this cross compile toolchain and I'm struggling to find various bits and pieces that I'm used to on other platforms where GCC is available with a vaguely posix-like libc. I'm developing primarily on Linux using GCC 7.3.0 and am already testing on TOS using the GCC 8.2.1 m68k-atari-mint toolchain from http://tho-otto.de/crossmint.php and have some code up and running using libSDL on a basic emulated ST class machine using Hatari (still to test using my actual 520 STE, but hey ho)... and I wanted to try and get the same codebase running on Amiga OS (and later, Risc OS). I've got the latest pre-compiled Linux release unpacked to /opt/amiga, but I'm struggling to work out which c libraries and include files I need to point at in order to get some basic directory/file operation type stuff working. I'm looking for what I need to set my include path to in order to get <dirent.h> and associated directory routines such as readdir() and opendir(). The includes for standard unix-type platforms for the code which breaks looks like: Code:
#include <stdio.h> #include <string.h> #include <stdbool.h> #include <dirent.h> #include <sys/types.h> Code:
#ifdef TOS #include <unistd.h> #include <sys/stat.h> #endif Code:
#ifdef POSIX if (ep->d_type == DT_REG){ #endif #ifdef TOS stat(filename, &stat_buf); if (S_ISREG(stat_buf.st_mode) != 0){ #endif The standard include and library paths for what I assume would be the standard c library with this toolchain don't appear to have a <dirent.h> header: Code:
/opt/amiga/bin/m68k-amigaos-gcc -Wall -Wno-unused-function -Os -I/opt/amiga/m68k-amigaos/include -DAMIGAOS -DDIR_SEP=\"/\" -DGAMEDIR=\"./GAMES\" -DCSV_FILE=\"MENU.CSV\" -DLOGGING= -c -o src/gamedata.o src/gamedata.c In file included from /opt/amiga/m68k-amigaos/sys-include/dirent.h:7:0, from src/gamedata.c:4: /opt/amiga/m68k-amigaos/sys-include/sys/dirent.h:10:2: error: #error "<dirent.h> not supported" #error "<dirent.h> not supported" ^~~~~ Some of these symbols and defines are present in the 'clib' and 'libnix' sub-directories, but I don't know how they relate to building something with the vanilla libc and I assume that it will end badly trying to use part of one c libary and bits of another! Where should I be looking at in the various c libraries to get more or less the same functionality as I'm using above for unix/linux/posix and TOS? |
22 January 2019, 08:22 | #1034 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 681
|
You don't need to supply any include paths to the compiler, it has a built-in list of include paths.
The gcc toolchain actually comes with 3 libc like implementations 1) 'newlib' which is the default, no additional commandline parameter needed 2) 'noixemul' which is enabled supplying '-noixemul' during compiling and linking 3) 'clib2' which is enabled by supplying '-mcrt=clib2' during compiling and linking More info here: https://github.com/bebbo/amiga-gcc/wiki/Libraries |
22 January 2019, 10:11 | #1035 |
Registered User
Join Date: Aug 2009
Location: UK
Posts: 30
|
Wow! Thank you for that pointer. I'm not used to that type of operation with GCC, several decades of setting include and library locations via CFLAGS and LDFLAGS are hardcoded in my brain
My code does now compile without error - I have lots of warnings compared to GCC 7.x and 8.x, but I can work on that later. My full makefile now looks like: Code:
# Names of the compiler and friends CC = /opt/amiga/bin/m68k-amigaos-gcc STRIP = /opt/amiga/bin/m68k-amigaos-strip # libraries and paths APP_LIB = -L/opt/amiga/m68k-amigaos/lib -lSDL -ldebug APP_INCLUDE = # Compiler flags CFLAGS = -Wall -Wno-unused-function -mcrt=nix13 -noixemul -Os $(APP_INCLUDE) -DAMIGAOS -DDIR_SEP=$(DIR_SEP) -DGAMEDIR=$(GAMEDIR) -DCSV_FILE=$(CSV_FILE) -DLOGGING=$(LOGGING) LINK_CFLAGS = -Wall -Wno-unused-function -mcrt=nix13 -Os APP_LDFLAGS = $(APP_LIB) # What our application is named EXE = menu.amiga include Makefile.common OBJFILES = src/bmp2text.o src/csvlib.o src/gamedata.o src/menu.o all: $(EXE) $(EXE): $(OBJFILES) $(CC) $(LINK_CFLAGS) -o $(EXE) $(OBJFILES) $(APP_LDFLAGS) $(STRIP) --strip-all $(EXE) $(STACKMOD) menu.o: src/menu.c $(CC) -c $(CFLAGS) $< -o src/$@ bmp2text.o: src/bmp2text.c $(CC) -c $(CFLAGS) $< -o src/$@ gamedata.o: src/gamedata.c $(CC) -c $(CFLAGS) $< -o src/$@ csvlib.o: src/csvlib.c $(CC) -c $(CFLAGS) $< -o src/$@ clean: rm -f src/*.o src/*.a $(EXE) core Interestingly the resultant binary is a good 120kbytes smaller than the TOS version which is still using a.out format, and, I guess, the size of the libc implementation using libnix. Next to see how far it runs before blowing up - I'm sure it won't run first time |
22 January 2019, 10:30 | #1036 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
Don't mix -mcrt=nix13 and -noixemul, nix13 is only useful for development for Kickstart 1.3, and I believe one or the other overrides eachother. It's better to just choose one. I'd suggest to just go with -noixemul
|
22 January 2019, 11:09 | #1037 |
Registered User
Join Date: Aug 2009
Location: UK
Posts: 30
|
Will a binary compiled with -noixemul still run on ks1.3? I'd like to target the 500 as well.
|
22 January 2019, 11:10 | #1038 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
|
22 January 2019, 12:26 | #1039 |
Registered User
Join Date: Aug 2009
Location: UK
Posts: 30
|
Thanks, that's great.
|
22 January 2019, 17:06 | #1040 |
Registered User
|
Just a question:
Is it enough to recompile bgdbserver 0.5 with -mcrt=nix13 in order to get it working with OS1.3? I tried running the standard download, but it immediately returns to CLI without even printing the help info. |
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 |
|
|