GithubHelp home page GithubHelp logo

bebbo / amiga-gcc Goto Github PK

View Code? Open in Web Editor NEW
306.0 306.0 64.0 637 KB

The GNU C-Compiler with Binutils and other useful tools for cross development for Amiga

License: GNU General Public License v2.0

Makefile 7.90% C 83.08% Shell 1.25% Inno Setup 0.24% Batchfile 0.08% Dockerfile 0.16% C++ 7.28%

amiga-gcc's People

Contributors

acf avatar bebbo avatar blackborn66 avatar bszili avatar cnvogelg avatar danboid avatar dwhinham avatar erique avatar fautomat avatar githubaf avatar kuroneko avatar mbeijer avatar mheyer32 avatar michalsc avatar perweij avatar prb28 avatar simpsond avatar skeetor avatar stevemoody73 avatar tdolphin-org avatar tehkain avatar thefakemontyontherun avatar windenntw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amiga-gcc's Issues

Emit native Windows directories under Cygwin

My VSCode gets very confused by gcc/g++ emitting warnings/errors with cygpaths. Also, latest WnUAE debugging feature doesn't like them in debugging symbols. Also when logging, having __FILE__ macro emitting native windows paths would be helpful

  • GCC Error/Warning/Note paths
  • G++ Error/Warning/Note paths
  • GCC Debugging symbols paths
  • G++ Debugging symbols paths
  • __FILE__ paths

vasm missing

Could you please include vasm with this toolchain? So far it turned out to be quite a good match with gcc.

SDL

I noticed that you finally added the SDK SDL. I'm curious of how the SDK install works.

The repository https://github.com/AmigaPorts/libSDL12 has SDL 1.2.15, reworked for AmigaOS3.x with a bunch of bug-fixes over 1.2.6, like fullscreen finally works. As well as AMMX extras working for Vampire cards to get some extra speed with the blitter.

The functioning makefile in this repository is Makefile.bax. The prefix is wrong but the rest should be correct.

The Vampire specific functions are defined in an vasm assembler file, that is compiled with VASM and then included in the gcc linker.

The Apollo/Vampire specifics seem to be in here: https://github.com/AmigaPorts/libSDL12/tree/master/video/apollo

The Apollo/Vampire specifics are designed to only be used if the Apollo based CPU is identified. So it will work on 020, 030, 040 and 060 just as well!

I think Makefile.bax is pretty self explanatory! =)

I need to know how I could implement this in the SDK install process, so we can leave the bug-ridden SDL 1.2.6 from Aminet behind, once and for all!

configure: error: C compiler cannot create executables

On a fresh machine, doing "make all" results in:

cd build/libnix && CFLAGS="-Os -g -fomit-frame-pointer" AR=m68k-amigaos-ar AS=m68k-amigaos-as CC=m68k-amigaos-gcc  /home/cygwin/amiga-gcc/projects/libnix/configure --prefix=/opt/amiga/m68k-amigaos/libnix --target=m68k-amigaos --host=m68k-amiga
os                                                                               
checking for m68k-amigaos-CC... m68k-amigaos-gcc                                 
checking whether the C compiler works... no                                      
configure: error: in `/home/cygwin/amiga-gcc/build/libnix':                      
configure: error: C compiler cannot create executables                           
See `config.log' for more details                                                
make: *** [Makefile:580: build/libnix/Makefile] Error 77                         

Looking at build/libnix/config.log I can find:

## ----------- ##                                                                
## Core tests. ##                                                                
## ----------- ##                                                                
                                                                                 
configure:1795: checking for m68k-amigaos-CC                                     
configure:1822: result: m68k-amigaos-gcc                                         
configure:1897: checking for C compiler version                                  
configure:1906: m68k-amigaos-gcc --version >&5                                   
m68k-amigaos-gcc (GCC) 6.4.1b 20180605-075457                                    
Copyright (C) 2017 Free Software Foundation, Inc.                                
This is free software; see the source for copying conditions.  There is NO       
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.      
                                                                                 
configure:1917: $? = 0                                                           
configure:1906: m68k-amigaos-gcc -v >&5                                          
Using built-in specs.                                                            
COLLECT_GCC=m68k-amigaos-gcc                                                     
COLLECT_LTO_WRAPPER=/opt/amiga/libexec/gcc/m68k-amigaos/6.4.1b/lto-wrapper.exe   
Target: m68k-amigaos                                                             
Configured with: /home/cygwin/amiga-gcc/projects/gcc/configure --prefix=/opt/amig
a --target=m68k-amigaos --enable-languages=c,c++,objc --enable-version-specific-r
untime-libs --disable-libssp --disable-nls --with-headers=/home/cygwin/amiga-gcc/
projects/newlib-cygwin/newlib/libc/sys/amigaos/include/                          
Thread model: single                                                             
gcc version 6.4.1b 20180605-075457 (GCC)                                         
configure:1917: $? = 0                                                           
configure:1906: m68k-amigaos-gcc -V >&5                                          
m68k-amigaos-gcc: error: unrecognized command line option '-V'                   
m68k-amigaos-gcc: fatal error: no input files                                    
compilation terminated.                                                          
configure:1917: $? = 1                                                           
configure:1906: m68k-amigaos-gcc -qversion >&5                                   
m68k-amigaos-gcc: error: unrecognized command line option '-qversion'; did you me
an '--version'?                                                                  
m68k-amigaos-gcc: fatal error: no input files                                    
compilation terminated.                                                          
configure:1917: $? = 1                                                           
configure:1937: checking whether the C compiler works                            
configure:1959: m68k-amigaos-gcc -Os -g -fomit-frame-pointer   conftest.c  >&5   
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: cannot find -lamiga                                                                       
collect2: error: ld returned 1 exit status                                       
configure:1963: $? = 1                                                           
configure:2001: result: no                                                       

What should I do ?

Latest toolchain updates fail fresh compilation

Two issues

  1. make update directly after the first checkout fails for the
    _lha_done rule, because $(BUILD) does not exist yet. Inserting "@mkdir -p $(BUILD)" helped me:
$(BUILD)/_lha_done:
	@mkdir -p $(BUILD)
	@if [ ! -e "$$(which lha)" ]; then \
	  cd $(BUILD) && rm -rf lha; \
	  $(L0)"clone lha"$(L1) git clone https://github.com/jca02266/lha; $(L2); \
	  cd lha; \
	  $(L00)"configure lha"$(L1) aclocal; autoheader; automake -a; autoconf; ./configure; $(L2); \
	  $(L00)"make lha"$(L1) make all; $(L2); \
	  $(L00)"install lha"$(L1) mkdir -p $(PREFIX)/bin/; install src/lha$(EXEEXT) $(PREFIX)/bin/lha$(EXEEXT); $(L2); \
	fi
	@echo "done" >$@ 

  1. The build fails:

Clean checkout, clean prefix directory:

..(lots of other stuff here)
sfdc proto getfont.h...done
sfdc proto integer.h...done
extract ndk13...done
macros+protos ndk13...done
make binutils...done
install binutils...done
configure gcc...done
configure gprof...done
make gprof...done
install gprof...done
make gcc...done
install gcc...done
configure newlib...done
make newlib...done
install newlib...done
configure libnix...failed
checking for m68k-amigaos-CC... m68k-amigaos-gcc
checking whether the C compiler works... no
configure: error: in `/home/matze/amigatoolchain/amiga-gcc/build-Linux/libnix':
configure: error: C compiler cannot create executables
See `config.log' for more details
configure libnix...failed
less "log/configure libnix.log"
Makefile:741: recipe for target 'build-Linux/libnix/Makefile' failed
make: *** [build-Linux/libnix/Makefile] Error 77
matze@ubuntu-VirtualBox:~/amigatoolchain/amiga-gcc$ 

config.log
configure libnix.log

Have to run make all multiple times

After doing make clean I have to run make all multiple times until it says "make: Nothing to be done for 'all'."

So there seems to be breakpoints after each sub-makefile.

Also, clean doesn't properly remove previously unpacked archives so it asks to overwrite previously written files. Possibly remove the files automatically on clean or automatically overwrite the files if not or possibly both.

alib issue with new toolchain

ADoom compiled with the new toolchain fails in the very first call to CreateTask, while the same code compiled with the older toolchain does not. CreateTask returns with a failure and thus ADoom exits.

While I cannot pin it down I guess there must be some difference in how alib gets compiled by the toolchain?! Or maybe the return value is somehow broken?

Missing wide char support for C++

I need some basic wide char functions in my C++11 project. The wide char functions that Sebastian has recently added to clib2 are already sufficient for my purposes. But I'm unable to use them with m68k-amigaos-gcc because C++ is only supported for libnix.

Thus, to give us basic wide char support one of the following things should be implemented:

  1. Make it possible to use clib2 with C++ (probably easiest?)

or

  1. Add some basic wide char functions to libnix (on MorphOS libnix has some wide char functions so maybe those could be used?)

Thanks!

Chip DATA section lost with -Os and chip BSS present

chipbug.zip

In this test case there is initialized and zeroed chip data. With -Os the initialized data does not appear in the executable. Attempting to read from it in the program gives zeros. I guess the symbol references the BSS section instead.

Either removing the __chip qualifier, removing -Os, or removing the chip BSS section resolves the problem.

Trashed registers when optimizing register-passed float/double arguments

Consider that piece of code:

#if 0
/opt/amiga/bin/m68k-amigaos-gcc-6.4.1b -Wall -O1 -fomit-frame-pointer -ffast-math -funroll-all-loops -funsafe-math-optimizations -m68030 -m68881 -S $0 -o -
exit
#endif

float f1(float a __asm("fp0"));
float f2(float a __asm("fp0"));

float f3(float a __asm("fp0")) {
	float v1 = f1(a), v2 = f2(a);
	return v1+v2;
}

And compile it (just 'sh' it) and inspect the generated asm:

$ sh bug_gcc6/tst.c
#NO_APP
        .text
        .align  2
        .globl  _f3
_f3:
        move.l d2,-(sp)
        jsr _f1                   ; <===== fp0 transhed!!
        move.l d0,d2
        jsr _f2                   ; <===== bug!!! f2 will use a trashed argument
        fsmove.s d2,fp0
        fsadd.s d0,fp0
        fmove.s fp0,d0
        move.l (sp)+,d2
        rts

The asm code is totally broken. the value of fp0 in f3() isn't preserved and reused to call f2(). Actually f2 is called with garbage in fp0. It looks like the optimizer did remove some important code because when compiling with -O0, one gets a correct asm:

_f3:
        lea (-12,sp),sp
        fmove.s fp0,(sp)
        fmove.s (sp),fp0
        jsr _f1
        move.l d0,8(sp)
        fmove.s (sp),fp0
        jsr _f2
        move.l d0,4(sp)
        fmove.s 8(sp),fp0
        fadd.s 4(sp),fp0
        fmove.s fp0,d0
        lea (12,sp),sp
        rts

Notice that this issue doesn't happen when using doubles, but another trouble occurs: one fp-reg isn't preserved!

_f3:
        fmovem #20,-(sp)               ; <=== pushes fp4 onto stack, but not fp2!!!
        fmove.x fp0,fp4
        jsr _f1
        move.l d1,-(sp)
        move.l d0,-(sp)
        fmove.d (sp)+,fp2              ; <=== fp2 is modified but not preserved in the prologue of the function
        fmove.x fp4,fp0
        jsr _f2
        move.l d1,-(sp)
        move.l d0,-(sp)
        fmove.d (sp)+,fp0
        fadd.x fp2,fp0
        fmove.d fp0,-(sp)
        move.l (sp)+,d0
        move.l (sp)+,d1
        fmovem (sp)+,#40
        rts

BTW:

  1. why does gcc always wants to return floats (and double) in d0(/d1) ? this requires lots of useless stack-moves. It would have been better if gcc returned float/doubles in fp0 when fpu code is generated.

  2. even with double being returned in d0/d1, the above code looks sub-optimal (in addition of being bogus). Once d0/d1 are pushed onto the stack, they don't need to be pop'ed immediately to fp2. If it was differed upto the fadd one woudn't need fp2 at all (fadd.d (sp)+,fp0 doesn't need an fp-reg).

Actually using the stack instead of fp-regs to store the temporary results of fpu computation makes sense since 1) it prevents allocating an extra fp-reg to hold the temporary value (which is no reused) and 2) gcc already uses the stack to converrt data-regs info fp-regs.

cybergraphics.h looking for non-existant header

In file included from amiga_video.c:6:0:
/home/matze/amigatoolchain/amiga-gcc-out/m68k-amigaos/include/proto/cybergraphics.h:6:34: fatal error: clib/cybergfx_protos.h: No such file or directory
 #include <clib/cybergfx_protos.h>

I found it under a different name, though:

matze@ubuntu-VirtualBox:~/amigatoolchain/amiga-gcc-out$ find ./ -name cybergraphics_protos.h
./m68k-amigaos/include/clib/cybergraphics_protos.h

Crashes for a simple program

I have a very minimal program that creates reproducable hard crashes for me in UAE:

#include <stdio.h>

class TestClass {
  public:
    TestClass(): count(0), structs() {
    }

    typedef struct {
        char path[256];
        char name[256];
        int test;
    } TestStruct;

    TestStruct structs[10];
    int count;
};

int main() {
    TestClass c;
    for (int i=0;i<10;i++) {
        printf("%s %s %d\n", c.structs[i].path, c.structs[i].name, c.structs[i].test);
    }
    return 0;
}

Didn't yet go down to assembly level. Will probably do so in the following days but maybe you have an immediate idea.

Compiled like this:

/home/mop/m68k-amigaos-gcc6/bin/m68k-amigaos-g++ -noixemul -m68030 -m68881 /mnt/d/le3d-amiga/testi.cpp -o testi

It seems to be related to the memory allocations of the struct array. The structs() should auto initialize every struct (and all its members recursively) to zero and does so on linux.

Coverage combined with -Wl,-Map=espeak.map,--trace crashes Linker

I am using -Wl,-Map=espeak.map,--trace to get interesting output when linking.

Now I tried coverage and the linker coredumps...
The crash does not happen when either
-Wl,-Map=espeak.map,--trace
or
the coverage options
are removed.

To reproduce use the coverage-example:

m68k-amigaos-gcc -Wall -fprofile-arcs -ftest-coverage cov.c -noixemul -lgcov -o cov -fprofile-generate=. -Wl,-Map=espeak.map,--trace

collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.

-m68020-40 and -m68020-60 don't link libnix libm020

I compile with libnix for different CPUs.
When I start a program compiled for a higher CPU I get usually the message 'Need a 68020 or higher CPU', and that is what I expect.

When I however compile with either -m68020-40 or -m68020-60 this does not happen!

I looked at the linker and it does
-m68020
(/home/osboxes/opt/m68k-amigaos_03Aug18/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/lib/libm020/libstubs.a)__cpucheck.o

-m68020-60
(/home/osboxes/opt/m68k-amigaos_03Aug18/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/lib/libstubs.a)__cpucheck.o

So I seem to get the wrong cpucheck...

I guess there is something missing in the spec-file?

no symbol in libstack/stkrst.o

When I try to compile an exec with -lstack to have auto-stack, I get the following error /opt/amiga/m68k-amigaos/libnix/lib/libnix/libstack.a(longjmp.o)(.text+0xc): r▒f▒rence ind▒finie vers ▒ __stkrst ▒ (undefined reference to __stkrst)

Then if I do: /opt/amiga/bin/m68k-amigaos-nm /opt/amiga/m68k-amigaos/libnix/lib/libnix/libstack.a , I can see that stkrst.o contains no symbol which is odd:

stkovf.o:                                                                      
         U ___stk_limit                                                        
00000000 T ___stkovf                                                           
         U __XCOVF                                                             
                                                                               
stkrst.o:                                                                      
/opt/amiga/bin/m68k-amigaos-nm: stkrst.o: aucun symbole                        
                                                                               
stkrst_f.o:                                                                    
         U ___stk_limit                                                        
00000000 T ___stkrst_f                                                         
         U ___used_stack                                                       
         U _SysBase                                                            

Then I looked at the source:

$ less ./projects/libnix/sources/stack/stkrst.c

        #include "bases.h"

asm(
        "| the stack consists of a single linked linear list like this:"
        "|"
        "| struct stack"
        "| { struct stack *next;                        points to the next underlying structure"
        "|   struct StackSwapStruct sss;                holds previous stackframe when used,"
        "|                                      itself when unused, the current stackborders"
        "|                                      are in the task structure ;-)"
        "|   APTR top_of_stackframe; }          previous variable value"
        "|                                      Note: stack->sss.stk_Lower is not reliable"
        "|"
        "| For better performance stackframes are cached in a 'unused' list when"
        "| not in use. (AllocMem() is really a performance killer)."
        "|"
        "|"
        "| Caution:"
        "| Race condition ahead! exec might preempt our task at any time storing"
        "| the current register set on top of the free stack. NEVER set a sp higher"
        "| than the location of important data."
        "|"
        "       .comm   ___used_stack,8;"               /* pointer to used stackframes */
                                            /* pointer to unused stackframes */
        "       .text;"
        "       .even;"
        "       .globl  ___stkrst;"

        "__stkrst:;"
        "       exg     d0,a3;"                 /* better use an address register*/

Actually there are two errors in this!

As you can see there is a mismatch between the exported ___stkrst and the coded symbol: __stkrst (3 underscores exported, but only 2 defined). We should have "__stkrst:;" (3 '').

Then, the most importent error: do you see the "|" on an line of its own? The line doesn't contains "\n", and therefore the rest of the asm is on the very same line as this comment. As a result the whole asm isn't compiled at all!

After fixing both errors, I get symbols back:

stkovf.o:                               
         U ___stk_limit                 
00000000 T ___stkovf                    
         U __XCOVF                      
                                        
stkrst.o:                               
         U ___stackborders              
         U ___stk_limit                 
00000000 T ___stkrst                    ; <====== HERE!
00000008 C ___used_stack                
00000008 C ___used_stack                
         U _SysBase                     
                                        
stkrst_f.o:                             
         U ___stk_limit                 
00000000 T ___stkrst_f                  
         U ___used_stack                
         U _SysBase                     

make update fails

Looks like support for ixemul is partly removed from Makefile. On a clean update it cannot pull ixemul because rule is missing.

Need version 37 of

I have a program using Cybergraphics. When I compile it with "gcc version 6.4.1b 20180401-215902 (GCC)" and run it on an amiga I got a pop-up appearing telling me that:

Information
Need version 37 of

Nothing more, nothing less. Apparently some library is missing, but the popup didn't tell!

Running snnopdos, I can see this occurs after opening CyberGfx.library failed. Possibly it is that library which is required, but the strange thing is that with a version of the program compiled with an earlier version of gcc doesn't shows this popup.

Notice: Actually I don't have cybergraphics in the system. It is running picasso96 which emulates cybergraphics.library. Notice it isn't the same name as the one SnoopDos indicates, but it is the name provided by the macro CYBERGFXNAME in <cyberbraphics/cybergraphics.h>.

Which part of the compiler library requires CyberGfx.library to be present? (assuming the version 37 refer to that library)

toolchain build is broken as of yesterday

checking how to print strings... printf
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
=== configuring in amigaos (/home/matze/amigatoolchain/amiga-gcc/build-Linux/newlib/libm020/newlib/libc/sys/amigaos)
configure: running /bin/bash /home/matze/amigatoolchain/amiga-gcc/projects/newlib-cygwin/newlib/libc/sys/amigaos/configure --disable-option-checking '--prefix=/home/matze/amigatoolchain/amiga-gcc-out'  '--with-multisubdir=libm020' '--with-multisrctop=' '--enable-multilib' '--host=m68k-amigaos' 'host_alias=m68k-amigaos' 'CC=m68k-amigaos-gcc' 'CFLAGS=-Os -fomit-frame-pointer' 'CC=m68k-amigaos-gcc  -mcpu=68020' 'CXX=m68k-amigaos-g++  -mcpu=68020' 'F77= -mcpu=68020' 'GCJ= -mcpu=68020' 'GFORTRAN= -mcpu=68020' 'GOC= -mcpu=68020' --cache-file=/dev/null --srcdir=/home/matze/amigatoolchain/amiga-gcc/projects/newlib-cygwin/newlib/libc/sys/amigaos
checking whether the C++ compiler works... no
configure: error: in `/home/matze/amigatoolchain/amiga-gcc/build-Linux/newlib/libm020/newlib/libc/sys/amigaos':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
configure: error: /home/matze/amigatoolchain/amiga-gcc/projects/newlib-cygwin/newlib/libc/sys/amigaos/configure failed for amigaos
configure: error: /home/matze/amigatoolchain/amiga-gcc/projects/newlib-cygwin/newlib/libc/sys/configure failed for sys
configure: error: /home/matze/amigatoolchain/amiga-gcc/projects/newlib-cygwin/newlib/libc/configure failed for libc
configure newlib...failed
less "log/configure newlib.log"
Makefile:918: recipe for target 'build-Linux/newlib/newlib/Makefile' failed
make: *** [build-Linux/newlib/newlib/Makefile] Error 1

configure newlib.log
newlib.zip

amiga-gcc doesn't build

I've just tried to do a fresh build of amiga-gcc to test clib2 wide char support but it doesn't build. Here is the log when it breaks:

/home/andreas/amiga-gcc/build/gcc/./gcc/xgcc -B/home/andreas/amiga-gcc/build/gcc/./gcc/ -B/opt/amiga/m68k-amigaos/bin/ -B/opt/amiga/m68k-amigaos/lib/ -isystem /opt/amiga/m68k-amigaos/include -isystem /opt/amiga/m68k-amigaos/sys-include    -g -O2 -mcpu=68020  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -I. -I. -I../../.././gcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc/. -I/home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
/home/andreas/amiga-gcc/build/gcc/./gcc/xgcc -B/home/andreas/amiga-gcc/build/gcc/./gcc/ -B/opt/amiga/m68k-amigaos/bin/ -B/opt/amiga/m68k-amigaos/lib/ -isystem /opt/amiga/m68k-amigaos/include -isystem /opt/amiga/m68k-amigaos/sys-include    -g -O2 -mcpu=68020  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -I. -I. -I../../.././gcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc/. -I/home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o _negdi2.o -MT _negdi2.o -MD -MP -MF _negdi2.dep -DL_negdi2 -c /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
/home/andreas/amiga-gcc/build/gcc/./gcc/xgcc -B/home/andreas/amiga-gcc/build/gcc/./gcc/ -B/opt/amiga/m68k-amigaos/bin/ -B/opt/amiga/m68k-amigaos/lib/ -isystem /opt/amiga/m68k-amigaos/include -isystem /opt/amiga/m68k-amigaos/sys-include    -g -O2 -mcpu=68020  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -I. -I. -I../../.././gcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc/. -I/home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o _lshrdi3.o -MT _lshrdi3.o -MD -MP -MF _lshrdi3.dep -DL_lshrdi3 -c /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
/home/andreas/amiga-gcc/build/gcc/./gcc/xgcc -B/home/andreas/amiga-gcc/build/gcc/./gcc/ -B/opt/amiga/m68k-amigaos/bin/ -B/opt/amiga/m68k-amigaos/lib/ -isystem /opt/amiga/m68k-amigaos/include -isystem /opt/amiga/m68k-amigaos/sys-include    -g -O2 -mcpu=68020  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -I. -I. -I../../.././gcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc/. -I/home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc -I/home/andreas/amiga-gcc/projects/gcc/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o _ashldi3.o -MT _ashldi3.o -MD -MP -MF _ashldi3.dep -DL_ashldi3 -c /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from /home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:56:0,
                 from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/machine/types.h:6:2: error: #error "must be included via <sys/types.h>"
 #error "must be included via <sys/types.h>"
  ^~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:70:9: error: unknown type name 'u_int64_t'
 typedef u_int64_t u_quad_t; /* quads */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:71:9: error: unknown type name 'int64_t'
 typedef int64_t  quad_t;
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:75:9: error: unknown type name 'int32_t'
 typedef int32_t  daddr_t; /* disk address */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:76:9: error: unknown type name 'int16_t'
 typedef int16_t  dev_t;  /* device number */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:77:9: error: unknown type name 'u_int32_t'
 typedef u_int32_t fixpt_t; /* fixed point number */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:78:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t gid_t;  /* group id */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:79:9: error: unknown type name 'u_int32_t'
 typedef u_int32_t ino_t;  /* inode number */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:81:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t mode_t;  /* permissions */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:82:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t nlink_t; /* link count */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:83:9: error: unknown type name 'int32_t'
 typedef int32_t  off_t;  /* file offset */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:84:9: error: unknown type name 'int32_t'
 typedef int32_t  pid_t;  /* process id */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:85:9: error: unknown type name 'int32_t'
 typedef int32_t  rlim_t;  /* resource limit */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:86:9: error: unknown type name 'int32_t'
 typedef int32_t  segsz_t; /* segment size */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:87:9: error: unknown type name 'int32_t'
 typedef int32_t  swblk_t; /* swap offset */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:88:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t uid_t;  /* user id */
         ^~~~~~~~~
In file included from /home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:56:0,
                 from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/machine/types.h:6:2: error: #error "must be included via <sys/types.h>"
 #error "must be included via <sys/types.h>"
  ^~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:70:9: error: unknown type name 'u_int64_t'
 typedef u_int64_t u_quad_t; /* quads */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:71:9: error: unknown type name 'int64_t'
 typedef int64_t  quad_t;
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:75:9: error: unknown type name 'int32_t'
 typedef int32_t  daddr_t; /* disk address */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:76:9: error: unknown type name 'int16_t'
 typedef int16_t  dev_t;  /* device number */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:77:9: error: unknown type name 'u_int32_t'
 typedef u_int32_t fixpt_t; /* fixed point number */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:78:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t gid_t;  /* group id */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:79:9: error: unknown type name 'u_int32_t'
 typedef u_int32_t ino_t;  /* inode number */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:81:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t mode_t;  /* permissions */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:82:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t nlink_t; /* link count */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:83:9: error: unknown type name 'int32_t'
 typedef int32_t  off_t;  /* file offset */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:84:9: error: unknown type name 'int32_t'
 typedef int32_t  pid_t;  /* process id */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:85:9: error: unknown type name 'int32_t'
 typedef int32_t  rlim_t;  /* resource limit */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:86:9: error: unknown type name 'int32_t'
 typedef int32_t  segsz_t; /* segment size */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:87:9: error: unknown type name 'int32_t'
 typedef int32_t  swblk_t; /* swap offset */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:88:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t uid_t;  /* user id */
         ^~~~~~~~~
In file included from /home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:56:0,
                 from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/machine/types.h:6:2: error: #error "must be included via <sys/types.h>"
 #error "must be included via <sys/types.h>"
  ^~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:70:9: error: unknown type name 'u_int64_t'
 typedef u_int64_t u_quad_t; /* quads */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:71:9: error: unknown type name 'int64_t'
 typedef int64_t  quad_t;
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:75:9: error: unknown type name 'int32_t'
 typedef int32_t  daddr_t; /* disk address */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:76:9: error: unknown type name 'int16_t'
 typedef int16_t  dev_t;  /* device number */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:77:9: error: unknown type name 'u_int32_t'
 typedef u_int32_t fixpt_t; /* fixed point number */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:78:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t gid_t;  /* group id */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:79:9: error: unknown type name 'u_int32_t'
 typedef u_int32_t ino_t;  /* inode number */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:81:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t mode_t;  /* permissions */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:82:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t nlink_t; /* link count */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:83:9: error: unknown type name 'int32_t'
 typedef int32_t  off_t;  /* file offset */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:84:9: error: unknown type name 'int32_t'
 typedef int32_t  pid_t;  /* process id */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:85:9: error: unknown type name 'int32_t'
 typedef int32_t  rlim_t;  /* resource limit */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:86:9: error: unknown type name 'int32_t'
 typedef int32_t  segsz_t; /* segment size */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:87:9: error: unknown type name 'int32_t'
 typedef int32_t  swblk_t; /* swap offset */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:88:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t uid_t;  /* user id */
         ^~~~~~~~~
In file included from /home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:56:0,
                 from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/machine/types.h:6:2: error: #error "must be included via <sys/types.h>"
 #error "must be included via <sys/types.h>"
  ^~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:70:9: error: unknown type name 'u_int64_t'
 typedef u_int64_t u_quad_t; /* quads */
         ^~~~~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/unistd.h:4:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:102,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:240:14: error: unknown type name 'useconds_t'
 int  usleep (useconds_t __useconds);
              ^~~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:71:9: error: unknown type name 'int64_t'
 typedef int64_t  quad_t;
         ^~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:1: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
 ^~~~~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:20: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
                    ^~~~~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:43: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
                                           ^~~~~~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/unistd.h:4:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:102,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:240:14: error: unknown type name 'useconds_t'
 int  usleep (useconds_t __useconds);
              ^~~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:75:9: error: unknown type name 'int32_t'
 typedef int32_t  daddr_t; /* disk address */
         ^~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:1: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
 ^~~~~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:20: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
                    ^~~~~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:43: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
                                           ^~~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:76:9: error: unknown type name 'int16_t'
 typedef int16_t  dev_t;  /* device number */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:77:9: error: unknown type name 'u_int32_t'
 typedef u_int32_t fixpt_t; /* fixed point number */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:78:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t gid_t;  /* group id */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:79:9: error: unknown type name 'u_int32_t'
 typedef u_int32_t ino_t;  /* inode number */
         ^~~~~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/sys/timespec.h:38:0,
                 from /opt/amiga/m68k-amigaos/sys-include/time.h:29,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:108,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/sys/_timespec.h:40:18: error: conflicting types for 'time_t'
 typedef _TIME_T_ time_t;
                  ^~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:133:22: note: previous declaration of 'time_t' was here
 typedef _BSD_TIME_T_ time_t;
                      ^~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:81:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t mode_t;  /* permissions */
         ^~~~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:82:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t nlink_t; /* link count */
         ^~~~~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/sys/timespec.h:38:0,
                 from /opt/amiga/m68k-amigaos/sys-include/time.h:29,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:108,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/sys/_timespec.h:40:18: error: conflicting types for 'time_t'
 typedef _TIME_T_ time_t;
                  ^~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:133:22: note: previous declaration of 'time_t' was here
 typedef _BSD_TIME_T_ time_t;
                      ^~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:83:9: error: unknown type name 'int32_t'
 typedef int32_t  off_t;  /* file offset */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:84:9: error: unknown type name 'int32_t'
 typedef int32_t  pid_t;  /* process id */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:85:9: error: unknown type name 'int32_t'
 typedef int32_t  rlim_t;  /* resource limit */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:86:9: error: unknown type name 'int32_t'
 typedef int32_t  segsz_t; /* segment size */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:87:9: error: unknown type name 'int32_t'
 typedef int32_t  swblk_t; /* swap offset */
         ^~~~~~~
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:88:9: error: unknown type name 'u_int16_t'
 typedef u_int16_t uid_t;  /* user id */
         ^~~~~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/unistd.h:4:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:102,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:240:14: error: unknown type name 'useconds_t'
 int  usleep (useconds_t __useconds);
              ^~~~~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:1: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
 ^~~~~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:20: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
                    ^~~~~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:43: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
                                           ^~~~~~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/sys/timespec.h:38:0,
                 from /opt/amiga/m68k-amigaos/sys-include/time.h:29,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:108,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/sys/_timespec.h:40:18: error: conflicting types for 'time_t'
 typedef _TIME_T_ time_t;
                  ^~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:133:22: note: previous declaration of 'time_t' was here
 typedef _BSD_TIME_T_ time_t;
                      ^~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/unistd.h:4:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:102,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:240:14: error: unknown type name 'useconds_t'
 int  usleep (useconds_t __useconds);
              ^~~~~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:1: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
 ^~~~~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:20: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
                    ^~~~~~~~~~
/opt/amiga/m68k-amigaos/sys-include/sys/unistd.h:294:43: error: unknown type name 'useconds_t'
 useconds_t ualarm (useconds_t __useconds, useconds_t __interval);
                                           ^~~~~~~~~~
make[4]: *** [_lshrdi3.o] Fehler 1
make[4]: *** Warte auf noch nicht beendete Prozesse...
make[4]: *** [_muldi3.o] Fehler 1
In file included from /opt/amiga/m68k-amigaos/sys-include/sys/timespec.h:38:0,
                 from /opt/amiga/m68k-amigaos/sys-include/time.h:29,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:108,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/opt/amiga/m68k-amigaos/sys-include/sys/_timespec.h:40:18: error: conflicting types for 'time_t'
 typedef _TIME_T_ time_t;
                  ^~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/stdio.h:61:0,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/../gcc/tsystem.h:87,
                 from /home/andreas/amiga-gcc/projects/gcc/libgcc/libgcc2.c:27:
/home/andreas/amiga-gcc/build/gcc/gcc/include-fixed/sys/types.h:133:22: note: previous declaration of 'time_t' was here
 typedef _BSD_TIME_T_ time_t;
                      ^~~~~~
make[4]: *** [_ashldi3.o] Fehler 1
make[4]: *** [_negdi2.o] Fehler 1
make[4]: Verlasse Verzeichnis '/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libm020/libgcc'
make[3]: *** [multi-do] Fehler 1
make[3]: Verlasse Verzeichnis '/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libgcc'
make[2]: *** [all-multi] Fehler 2
make[2]: Verlasse Verzeichnis '/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libgcc'
make[1]: *** [all-target-libgcc] Fehler 2
make[1]: Verlasse Verzeichnis '/home/andreas/amiga-gcc/build/gcc'
make: *** [build/gcc/_libgcc_done] Fehler 2 

Missing gettext dependency during binutils build

When compiling under Armbian on OrangePi One, I've stumbled across compilation error:

file=./`echo tr | sed 's,.*/,,'`.gmo \
  && rm -f $file && PATH=../src:$PATH no -o $file tr.po
/bin/sh: no: command not found

I've googled a bit and it turned out that I'm missing gettext on my OS - automake swapped one of tools' name with 'no' because of lack of it's presence. So perhaps README should also mention that package in apt step?

_types.h has trouble with wint_t

(this might be more a clib2 issue than amiga-gcc toolchain issue)

Compiling ADoom with clib2 raises:

matze@ubuntu-VirtualBox:~/adoom_git/adoom_src$ make  > /media/sf_Amiga/log.txt
In file included from /home/matze/amigatoolchain/amiga-gcc-out/m68k-amigaos/sys-include/sys/reent.h:15:0,
                 from /home/matze/amigatoolchain/amiga-gcc-out/m68k-amigaos/sys-include/sys/errno.h:11,
                 from /home/matze/amigatoolchain/amiga-gcc-out/m68k-amigaos/ndk-include/netdb.h:84,
                 from /home/matze/amigatoolchain/amiga-gcc-out/m68k-amigaos/ndk-include/proto/bsdsocket.h:40,
                 from amiga_net.c:11:
/home/matze/amigatoolchain/amiga-gcc-out/m68k-amigaos/sys-include/sys/_types.h:168:5: error: unknown type name 'wint_t'
     wint_t __wch;
     ^~~~~~
make: *** [amiga_net.o] Error 1


m68k-amigaos-ar fails: "file format not recognized"

When I do

m68k-amigaos-ar rs libtest.a obj1.o obj2.o

I get the following error:

libtest.a: File format not recognized

And the file libtest.a is 0 bytes then. It's weird. Why does it even look at libtest.a? It should create libtest.a, not archive it.

REQUEST: Discuss what is involved in compiling a GCC6-m68k release?

I know, I know, something to do with elf binaries

Curious what is involved in creating gcc for Amiga using this tool. Most folks are running GCC 2.95.3 on the actual hardware. Any chances we can use this to build a modern set of tools for the 68k? Especially with the Vampires in play.

$(PWD) is not expanded correctly under cygwin

I've got errors like:

D:\prg\_git\amiga-gcc>make all PREFIX=d:/prg/kompilatory/bebbo -j4
cd build/gcc && CFLAGS="-Os" CPPFLAGS="-Os" CXXFLAGS="-Os" LIBCFLAGS_FOR_TARGET="-Os -g -fomit-frame-pointer" /projects/gcc/configure --prefix=d:/prg/kompilatory/bebbo --target=m68k-amigaos --enable-languages=c,c++,objc --enable-version-specific-runtime-libs --disable-libssp --disable-nls
/bin/bash: /projects/gcc/configure: No such file or directory
built d:/prg/kompilatory/bebbo/bin/fd2sfd
built d:/prg/kompilatory/bebbo/bin/fd2pragma
make: *** [Makefile:201: build/gcc/Makefile] Error 127

As you can see in cd build/gcc && $(E) $(PWD)/projects/gcc/configure $(CONFIG_GCC) PWD gets expanded to blank string. After changing all PWD occurences to $(CURDIR) everything built fine.

I'm also building toolchain under Armbian right now and everything works fine with PWD, so I guess it's Cygwin-related.

internal error, aborting at /binutils/bfd/amigaoslink.c line 569 in get_relocated_section_contents

https://github.com/mheyer32/DoomAttack

When linking this project, one of the recent changes to binutils is now causing the issue below.

I wanted to file against the binutils project, but there seems to be no way to report issues(?)

/home/matze/amigatoolchain/amiga-gcc-out/bin/m68k-amigaos-gcc -noixemul -DUSENOIXEMUL -m68030 -m68881 -DNOFBASEREL -Ofast -fstrength-reduce -fomit-frame-pointer -Werror -Wimplicit -Wstrict-prototypes -include "doomdef.h" -DNDEBUG -D__BIG_ENDIAN__ -DNORMALUNIX -DAMIGA am_map.o am_mapamiga.o analogjoy.o clip.o d_items.o d_locale.o d_main.o d_net.o doomdef.o doomstat.o dstrings.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o i_main.o i_net.o i_sound.o i_system.o i_systemmisc.o i_video.o info.o m_argv.o m_bbox.o m_cheat.o m_fixed.o m_fixedamiga.o m_menu.o m_misc.o m_random.o m_swap.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_engine.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o s_sound.o sounds.o st_lib.o st_stuff.o tables.o v_video.o w_wad.o wi_stuff.o z_zone.o \
-lsocket -o /home/matze/doomattack_git/gnudoom/bin/DoomAttack
/home/matze/doomattack_git/gnudoom/bin/DoomAttack: code reloc for _AM_drawFline is out of range: 00000000
/home/matze/amigatoolchain/amiga-gcc-out/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: BFD 2.14b 20180118 (adtools build 20080628) internal error, aborting at /home/matze/amigatoolchain/amiga-gcc/projects/binutils/bfd/amigaoslink.c line 569 in get_relocated_section_contents

/home/matze/amigatoolchain/amiga-gcc-out/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: Please report this bug.

Build errors on cygwin / win10

Everything was done on fresh copy of repo and clean prefix folder. First of all, config.guess aren't working on cygwin 64bit - I've forgot to copy exact message, but it was the same as here. Then, after 32-bit reinstall I've had a problem with lha during make update - it successfully cloned and built, but install didn't have expected result since I've got "lha: command not found" error. After manually doing install NDK extracted painlessly. Unfortunately I've stumbled upon other errors - looks like include path is not working properly.

Dump of console contents

After starting once again with fresh copy of repo on console with admin rights, there was no problem with lha so I guess it's some kind of permissions business.

Also, README is missing cygwin info - I think it could be copied from old repo.

Regarding PATH and PREFIX vars, I'm starting my cmd with shortcut pointing to C:\WINDOWS\system32\cmd.exe /c "SET PATH=c:/prg/kompilatory/bebbo/bin;c:/prg/kompilatory/cygwin/bin;%PATH%&& set PREFIX=/cygdrive/c/prg/kompilatory/bebbo&& START cmd.exe", note that double amptersands don't have space on left side intentionally. Printing prefix is also visible on top of log.

As a side note I'm wondering if it would be possible to build this toolchain in MinGW - it would be easier to integrate with IDEs which don't quite like parsing /cygdrive paths in warning/error messages.

Libnix bugs

Libnix should be used instead of ixemul but it has got some bugs that makes programs not to work.
For example fopen seems broken and in sprintf '%d' parameter aswell, works if %ld is used or snprintf.

Profiling: main() vanishes from tree when using optimization

While playing with function pointers (that work correctly in this example) main() suddenly disappeared from the call tree when using an optimization other than -O0.

In previous examples the tree usually started with_stext calling main.
In the attached example the tree starts either directly with main() (-O0) or with fct_1() (-O2, -O3)

So no s_text nor main any longer. Is that normal?

output

test.tar.gz

Link-time optimizations ain't working

When building with -flto added to gcc flags I get:

Building src/ace/managers/timer.c
AppData/Local/Temp/cc8OKrbX.s: Assembler messages:
AppData/Local/Temp/cc8OKrbX.s:2: Error: unknown pseudo-op: `.gnu.lto_.profile.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:5: Error: unknown pseudo-op: `.gnu.lto_.icf.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:10: Error: unknown pseudo-op: `.gnu.lto_.jmpfuncs.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:17: Error: unknown pseudo-op: `.gnu.lto_.inline.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:27: Error: unknown pseudo-op: `.gnu.lto_.pureconst.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:30: Error: unknown pseudo-op: `.gnu.lto_timercreate.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:37: Error: unknown pseudo-op: `.gnu.lto_g_stimermanager.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:41: Error: unknown pseudo-op: `.gnu.lto_timerdestroy.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:49: Error: unknown pseudo-op: `.gnu.lto_timerget.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:63: Error: unknown pseudo-op: `.gnu.lto_timeroninterrupt.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:73: Error: unknown pseudo-op: `.gnu.lto_timergetprec.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:103: Error: unknown pseudo-op: `.gnu.lto_timergetdelta.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:120: Error: unknown pseudo-op: `.gnu.lto_timerpeek.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:131: Error: unknown pseudo-op: `.gnu.lto_timercheck.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:152: Error: unknown pseudo-op: `.gnu.lto_timerprocess.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:176: Error: unknown pseudo-op: `.gnu.lto_timerformatprec.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:196: Error: unknown pseudo-op: `.gnu.lto_timerwaitus.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:210: Error: unknown pseudo-op: `.gnu.lto_.symbol_nodes.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:216: Error: unknown pseudo-op: `.gnu.lto_.refs.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:221: Error: unknown pseudo-op: `.gnu.lto_.decls.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:302: Error: unknown pseudo-op: `.gnu.lto_.symtab.f22a9330a406fcee'
AppData/Local/Temp/cc8OKrbX.s:388: Error: unknown pseudo-op: `.gnu.lto_.opts'

Setting -fbbb=- doesn't help, so it's not something that you messed up, my guess is it's rather unimplemented. Anything to do about it?

PS. Don't you miss our noobish questions on slack? 'cuz we miss asking them ;)

faild building (newlib) the first time, succeedes only in second attempt

I cannot build any more.
Ubuntu 16.04
This is what I do: (today, 23.Oct)

Everything is clean/none existing at the beginning.

git clone https://github.com/bebbo/amiga-gcc.git
cd amiga-gcc
make update
make all PREFIX=/home/developer/opt/m68k-amigaos_aaaaa

It fails in here:
make[7]: Entering directory '/home/developer/amiga-gcc/build-Linux/newlib/libm020/newlib/libc'
rm -f libc.a
rm -rf tmp
mkdir tmp
cd tmp;
for i in argz/lib.a stdlib/lib.a ctype/lib.a search/lib.a stdio/lib.a string/lib.a signal/lib.a time/lib.a locale/lib.a reent/lib.a errno/lib.a misc/lib.a ssp/lib.a machine/lib.a sys/lib.a; do
m68k-amigaos-ar x ../$i;
done;
m68k-amigaos-ar rc ../libc.a *.o
m68k-amigaos-ar: ../stdlib/lib.a: No such file or directory
m68k-amigaos-ar: ../sys/lib.a: No such file or directory
m68k-amigaos-ranlib libc.a
rm -rf tmp
rm -f crt0.o
ln sys/crt0.o crt0.o >/dev/null 2>/dev/null || cp sys/crt0.o crt0.o
cp: cannot stat 'sys/crt0.o': No such file or directory
Makefile:1045: recipe for target 'crt0.o' failed
make[7]: *** [crt0.o] Error 1

If I do
make all PREFIX=/home/developer/opt/m68k-amigaos_aaaaa
again a second time, then everything is fine.

Coverage does no work an more (undefined references to _impure_ptr)

Your latest commits from yesterday.

osboxes@osboxes:~/espeak-source/src$ make -f Makefile.amiga cov
/home/osboxes/opt/m68k-amigaos_02Jun18/bin/m68k-amigaos-gcc  -noixemul -fprofile-arcs -ftest-coverage -fprofile-generate=Sienna:home/developer/espeak_src/espeak-source/src/coverage_test -Wall -pedantic -I. -c coverage_test/cov.c
/home/osboxes/opt/m68k-amigaos_02Jun18/bin/m68k-amigaos-gcc  -noixemul -o cov cov.o -lgcov
/home/osboxes/opt/m68k-amigaos_02Jun18/lib/gcc/m68k-amigaos/6.4.1b/libgcov.a(_gcov.o)(.text+0x8f2): In function `gcov_error':
/home/osboxes/amiga-gcc_02Jun18/projects/gcc/libgcc/libgcov-driver-system.c:34: undefined reference to `_impure_ptr'
/home/osboxes/opt/m68k-amigaos_02Jun18/lib/gcc/m68k-amigaos/6.4.1b/libgcov.a(_gcov.o)(.text+0x10e6): In function `gcov_do_dump':
/home/osboxes/amiga-gcc_02Jun18/projects/gcc/libgcc/libgcov-driver-system.c:182: undefined reference to `_impure_ptr'
collect2: error: ld returned 1 exit status
Makefile.amiga:177: recipe for target 'cov' failed
make: *** [cov] Error 1

ndk13 has incomplete GfxBase

While compiling using #include <graphics/gfxbase.h>:

68k-amigaos/ndk13-include/graphics/gfxbase.h:119:30: error: field 'MonitorVBlank' has incomplete type
  struct AnalogSignalInterval MonitorVBlank;

from what I've gathered monitor.h is empty on nix13. Filling it with with content from e.g. here solves this problem.

undefined reference to cexpf, while cexpf not used anywhere in source

Why would the compiler turn this expression into cexpf?

projectilelib.o(.text+0x50e8): In function `projectile::move()':
projectilelib.cpp:772: undefined reference to `cexpf'

Row 772 in projectilelib.cpp:
float rad_angle = (angle * M_PI)/180.00;

Angle is a float, so is M_PI.

compiled code misbehaves again

Since I use amiga-gcc instead of toolchain the compiler produces erroneous code again. I cannot say when the issue first appeared in amiga-gcc. Older versions fail to compile my code because of missing includes (ahi for instance) ) (I could try to copy the missing includes manually if you want)

Newer versions of the compiler lead to stuttering espeak. (I let espeak create wav-files, so this is not a speed issue)

I compile with -O2, but the problem is the same with -O0.

Then I checked the toolchain repository and found there where updates, too.

In the toochain-repository the problems where introduced on April 8th,
"update to a reasonable version from amiga-gcc"
268fed6bcfca3f34cb22c89f100507cfe87f03cd

Commits before work correctly.

undefined reference to `exit'

Linking milkytracker
obj/m68k-amigaos/Release/milkytracker/CGX_Main.o(.text+0x188c): undefined reference to `exit'
obj/m68k-amigaos/Release/milkytracker/CGX_Main.o(.text+0x1fa2): undefined reference to `exit'
obj/m68k-amigaos/Release/milkytracker/CGX_Main.o(.text+0x20e6): undefined reference to `exit'
../lib/libppui.a(DisplayDeviceFB_SDL.o)(.text+0x25e): undefined reference to `exit'
../lib/libppui.a(DisplayDeviceFB_SDL.o)(.text+0x51a): undefined reference to `exit'
../lib/libppui.a(DisplayDeviceFB_SDL.o)(.text+0x42a): more undefined references to `exit' follow
/opt/m68k-amigaos/m68k-amigaos/libnix/lib/libnix/libnix.a(open.o)(.text+0x3ca): undefined reference to `_WBenchMsg'
/opt/m68k-amigaos/m68k-amigaos/libnix/lib/libnix/libnix.a(open.o)(.text+0x420): undefined reference to `exit'
/opt/m68k-amigaos/m68k-amigaos/libnix/lib/libnix/libnix.a(abort.o)(.text+0x3a): undefined reference to `exit'
/opt/m68k-amigaos/m68k-amigaos/libnix/lib/libnix/libnix.a(raise.o)(.text+0x9c): undefined reference to `exit'
collect2: error: ld returned 1 exit status
milkytracker.make:500: recipe for target '../bin/milkytracker.68k' failed
make[1]: *** [../bin/milkytracker.68k] Error 1
Makefile:48: recipe for target 'milkytracker' failed
make: *** [milkytracker] Error 2

Doesn't build, failing to find libiberty.a

A new build failed for reason hightlighted below.
I was building with the non-default PREFIX:

make all PREFIX=/home/matze/amigatoolchain/gcc-6.2/m68k-amigaos_2/ -j8

matze@ubuntu-VirtualBox:~/amigatoolchain/gcc-6.2/amiga-gcc$ find ./ -name *iberty*
./build/gcc/build-x86_64-pc-linux-gnu/libiberty
./build/gcc/build-x86_64-pc-linux-gnu/libiberty/libiberty.a
./build/gcc/libiberty
./build/binutils/libiberty
./projects/gcc/include/libiberty.h
./projects/gcc/libiberty
./projects/gcc/libiberty/libiberty.texi
./projects/binutils/include/libiberty.h
./projects/binutils/libiberty
./projects/binutils/libiberty/libiberty.texi

It looks like 'build-x86_64-pc-linux-gnu' is missing in the search path to libiberty.a:


~/amigatoolchain/gcc-6.2/amiga-gcc
pushd build/gcc; make install-gcc; popd
~/amigatoolchain/gcc-6.2/amiga-gcc/build/gcc ~/amigatoolchain/gcc-6.2/amiga-gcc
make[2]: Entering directory '/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/build/gcc'
/bin/bash /home/matze/amigatoolchain/gcc-6.2/amiga-gcc/projects/gcc/mkinstalldirs /home/matze/amigatoolchain/gcc-6.2/m68k-amigaos_2 /home/matze/amigatoolchain/gcc-6.2/m68k-amigaos_2
/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/projects/gcc/libcpp/macro.c: In function ‘bool create_iso_definition(cpp_reader*, cpp_macro*)’:
/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/projects/gcc/libcpp/macro.c:3093:58: warning: format not a string literal and no format arguments [-Wformat-security]
        cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
                                                          ^
/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/projects/gcc/libcpp/macro.c:3106:58: warning: format not a string literal and no format arguments [-Wformat-security]
        cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg);
                                                          ^
g++  -I/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/projects/gcc/libcpp -I. -I/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/projects/gcc/libcpp/../include -I/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/projects/gcc/libcpp/include  -Os -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/projects/gcc/libcpp -I. -I/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/projects/gcc/libcpp/../include -I/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/projects/gcc/libcpp/include   -c -o mkdeps.o -MT mkdeps.o -MMD -MP -MF .deps/mkdeps.Tpo /home/matze/amigatoolchain/gcc-6.2/amiga-gcc/projects/gcc/libcpp/mkdeps.c
make[3]: Entering directory '/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/build/gcc/fixincludes'
**make[3]: *** No rule to make target '../libiberty/libiberty.a', needed by 'full-stamp'.  Stop.**
make[3]: Leaving directory '/home/matze/amigatoolchain/gcc-6.2/amiga-gcc/build/gcc/fixincludes'
Makefile:3577: recipe for target 'install-fixincludes' failed
make[2]: *** [install-fixincludes] Error 2
make[2]: *** Waiting for unfinished jobs....

Would it be possible to include bsdsocket.library into the SDK?

(this is a nice-to-have)

It looks like the way sockets work through clib2/libnix right now by implicitly opening bsdsocket.library.
If its not available, program start will fail.

I'd rather use bsdsocket dynamically.... i.e. have no networking available, when bsdsocket can't be opened.

Therefore it'd be really nice to have bsdsocket as part of the SDK :-)

#error "<dirent.h> not supported

/home/developer/opt/m68k-amigaos_24Mai18/m68k-amigaos/sys-include/sys/dirent.h:10:2: error: #error "<dirent.h> not supported"

In former versions this did not happen.

libnix build failure

Cloning into 'libnix'...
mkdir -p /opt/amiga/m68k-amigaos/libnix/lib/libnix
mkdir -p build/libnix
echo 'void foo(){}' > build/libnix/x.c
if [ ! -e /opt/amiga/m68k-amigaos/libnix/lib/libnix/ncrt0.o ]; then /opt/amiga/bin/m68k-amigaos-gcc -c build/libnix/x.c -o /opt/amiga/m68k-amigaos/libnix/lib/libnix/ncrt0.o; fi
if [ ! -e /opt/amiga/m68k-amigaos/libnix/lib/libnix/libm.a ]; then /opt/amiga/bin/m68k-amigaos-ar r /opt/amiga/m68k-amigaos/libnix/lib/libnix/libm.a; fi
if [ ! -e /opt/amiga/m68k-amigaos/libnix/lib/libnix/libnixmain.a ]; then /opt/amiga/bin/m68k-amigaos-ar r /opt/amiga/m68k-amigaos/libnix/lib/libnix/libnixmain.a; fi
if [ ! -e /opt/amiga/m68k-amigaos/libnix/lib/libnix/libnix.a ]; then /opt/amiga/bin/m68k-amigaos-ar r /opt/amiga/m68k-amigaos/libnix/lib/libnix/libnix.a; fi
if [ ! -e /opt/amiga/m68k-amigaos/libnix/lib/libnix/libnix20.a ]; then /opt/amiga/bin/m68k-amigaos-ar r /opt/amiga/m68k-amigaos/libnix/lib/libnix/libnix20.a; fi
if [ ! -e /opt/amiga/m68k-amigaos/libnix/lib/libnix/libstubs.a ]; then /opt/amiga/bin/m68k-amigaos-ar r /opt/amiga/m68k-amigaos/libnix/lib/libnix/libstubs.a; fi
mkdir -p /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b
if [ ! -e /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/libgcc.a ]; then /opt/amiga/bin/m68k-amigaos-ar r /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/libgcc.a; fi
cd build/libnix && CFLAGS="-Os -g -fomit-frame-pointer" AR=m68k-amigaos-ar AS=m68k-amigaos-as CC=m68k-amigaos-gcc  /root/amiga-gcc/projects/libnix/configure --prefix=/opt/amiga/m68k-amigaos/libnix --target=m68k-amigaos --host=m68k-amigaos
checking for m68k-amigaos-CC... m68k-amigaos-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether m68k-amigaos-gcc accepts -g... yes
checking for m68k-amigaos-gcc option to accept ISO C89... none needed
checking for m68k-amigaos-ranlib... m68k-amigaos-ranlib
checking for ar... m68k-amigaos-ar
checking for as... m68k-amigaos-as
checking how to run the C preprocessor... m68k-amigaos-gcc -E
checking for gawk... no
checking for mawk... mawk
checking for m68k-amigaos-ranlib... (cached) m68k-amigaos-ranlib
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sources/Makefile
config.status: creating sources/amiga/Makefile
config.status: creating sources/math/Makefile
config.status: creating sources/misc/Makefile
config.status: creating sources/nix/Makefile
config.status: creating sources/nix13/Makefile
config.status: creating sources/nix20/Makefile
config.status: creating sources/nixmain/Makefile
config.status: creating sources/nix_main/Makefile
config.status: creating sources/socket/Makefile
config.status: creating sources/stack/Makefile
config.status: creating sources/startup/Makefile
config.status: creating sources/stubs/Makefile
config.status: creating examples/Makefile
mkdir -p /opt/amiga/m68k-amigaos/libnix/include/
rsync -a projects/libnix/sources/headers/* /opt/amiga/m68k-amigaos/libnix/include/
touch build/libnix/Makefile
cd build/libnix && make
make[1]: Entering directory '/root/amiga-gcc/build/libnix'
mkdir startup
mkdir lib
mkdir libb
mkdir lib020
mkdir libb020
mkdir lib881
mkdir libb881
mkdir libb32
mkdir libb32881
cd sources;	make filelists
make[2]: Entering directory '/root/amiga-gcc/build/libnix/sources'
cd /root/amiga-gcc/projects/libnix/sources/math;	make -f /root/amiga-gcc/build/libnix/sources/Makefile SOURCEFILES="*/*.[cSCh]" FLDIR=/root/amiga-gcc/build/libnix/sources/math /root/amiga-gcc/build/libnix/sources/math/filelist
make[3]: Entering directory '/root/amiga-gcc/projects/libnix/sources/math'
echo "#Computer generated partial Makefile-do not edit" >/root/amiga-gcc/build/libnix/sources/math/filelist
echo "OBJECTS= \\" >>/root/amiga-gcc/build/libnix/sources/math/filelist
( for file in */*.[cSCh]; do echo $file; done ) | \
mawk '{ if($0 !~ /CVS/) { print substr($0,1,length($0)-2) ".o \\" } }' >>/root/amiga-gcc/build/libnix/sources/math/filelist
echo >>/root/amiga-gcc/build/libnix/sources/math/filelist
echo "SUBDIRS= \\" >>/root/amiga-gcc/build/libnix/sources/math/filelist
ls -d -F *|mawk '/\// { if($0 !~ /CVS/) { print substr($0,1,length($0)-1) " \\" } }' >>/root/amiga-gcc/build/libnix/sources/math/filelist
make[3]: Leaving directory '/root/amiga-gcc/projects/libnix/sources/math'
cd /root/amiga-gcc/projects/libnix/sources/nix;	make -f /root/amiga-gcc/build/libnix/sources/Makefile SOURCEFILES="*/*.[cSCh]" FLDIR=/root/amiga-gcc/build/libnix/sources/nix /root/amiga-gcc/build/libnix/sources/nix/filelist
make[3]: Entering directory '/root/amiga-gcc/projects/libnix/sources/nix'
echo "#Computer generated partial Makefile-do not edit" >/root/amiga-gcc/build/libnix/sources/nix/filelist
echo "OBJECTS= \\" >>/root/amiga-gcc/build/libnix/sources/nix/filelist
( for file in */*.[cSCh]; do echo $file; done ) | \
mawk '{ if($0 !~ /CVS/) { print substr($0,1,length($0)-2) ".o \\" } }' >>/root/amiga-gcc/build/libnix/sources/nix/filelist
echo >>/root/amiga-gcc/build/libnix/sources/nix/filelist
echo "SUBDIRS= \\" >>/root/amiga-gcc/build/libnix/sources/nix/filelist
ls -d -F *|mawk '/\// { if($0 !~ /CVS/) { print substr($0,1,length($0)-1) " \\" } }' >>/root/amiga-gcc/build/libnix/sources/nix/filelist
make[3]: Leaving directory '/root/amiga-gcc/projects/libnix/sources/nix'
cd /root/amiga-gcc/projects/libnix/sources/nix13;	make -f /root/amiga-gcc/build/libnix/sources/Makefile SOURCEFILES="*/*.[cSCh]" FLDIR=/root/amiga-gcc/build/libnix/sources/nix13 /root/amiga-gcc/build/libnix/sources/nix13/filelist
make[3]: Entering directory '/root/amiga-gcc/projects/libnix/sources/nix13'
echo "#Computer generated partial Makefile-do not edit" >/root/amiga-gcc/build/libnix/sources/nix13/filelist
echo "OBJECTS= \\" >>/root/amiga-gcc/build/libnix/sources/nix13/filelist
( for file in */*.[cSCh]; do echo $file; done ) | \
mawk '{ if($0 !~ /CVS/) { print substr($0,1,length($0)-2) ".o \\" } }' >>/root/amiga-gcc/build/libnix/sources/nix13/filelist
echo >>/root/amiga-gcc/build/libnix/sources/nix13/filelist
echo "SUBDIRS= \\" >>/root/amiga-gcc/build/libnix/sources/nix13/filelist
ls -d -F *|mawk '/\// { if($0 !~ /CVS/) { print substr($0,1,length($0)-1) " \\" } }' >>/root/amiga-gcc/build/libnix/sources/nix13/filelist
make[3]: Leaving directory '/root/amiga-gcc/projects/libnix/sources/nix13'
cd /root/amiga-gcc/projects/libnix/sources/nix20;	make -f /root/amiga-gcc/build/libnix/sources/Makefile SOURCEFILES="*/*.[cSCh]" FLDIR=/root/amiga-gcc/build/libnix/sources/nix20 /root/amiga-gcc/build/libnix/sources/nix20/filelist
make[3]: Entering directory '/root/amiga-gcc/projects/libnix/sources/nix20'
echo "#Computer generated partial Makefile-do not edit" >/root/amiga-gcc/build/libnix/sources/nix20/filelist
echo "OBJECTS= \\" >>/root/amiga-gcc/build/libnix/sources/nix20/filelist
( for file in */*.[cSCh]; do echo $file; done ) | \
mawk '{ if($0 !~ /CVS/) { print substr($0,1,length($0)-2) ".o \\" } }' >>/root/amiga-gcc/build/libnix/sources/nix20/filelist
echo >>/root/amiga-gcc/build/libnix/sources/nix20/filelist
echo "SUBDIRS= \\" >>/root/amiga-gcc/build/libnix/sources/nix20/filelist
ls -d -F *|mawk '/\// { if($0 !~ /CVS/) { print substr($0,1,length($0)-1) " \\" } }' >>/root/amiga-gcc/build/libnix/sources/nix20/filelist
make[3]: Leaving directory '/root/amiga-gcc/projects/libnix/sources/nix20'
cd /root/amiga-gcc/projects/libnix/sources/socket;	make -f /root/amiga-gcc/build/libnix/sources/Makefile SOURCEFILES="*/*.[cSCh]" FLDIR=/root/amiga-gcc/build/libnix/sources/socket /root/amiga-gcc/build/libnix/sources/socket/filelist
make[3]: Entering directory '/root/amiga-gcc/projects/libnix/sources/socket'
echo "#Computer generated partial Makefile-do not edit" >/root/amiga-gcc/build/libnix/sources/socket/filelist
echo "OBJECTS= \\" >>/root/amiga-gcc/build/libnix/sources/socket/filelist
( for file in */*.[cSCh]; do echo $file; done ) | \
mawk '{ if($0 !~ /CVS/) { print substr($0,1,length($0)-2) ".o \\" } }' >>/root/amiga-gcc/build/libnix/sources/socket/filelist
echo >>/root/amiga-gcc/build/libnix/sources/socket/filelist
echo "SUBDIRS= \\" >>/root/amiga-gcc/build/libnix/sources/socket/filelist
ls -d -F *|mawk '/\// { if($0 !~ /CVS/) { print substr($0,1,length($0)-1) " \\" } }' >>/root/amiga-gcc/build/libnix/sources/socket/filelist
make[3]: Leaving directory '/root/amiga-gcc/projects/libnix/sources/socket'
cd /root/amiga-gcc/projects/libnix/sources/stack;	make -f /root/amiga-gcc/build/libnix/sources/Makefile SOURCEFILES="*.c" FLDIR=/root/amiga-gcc/build/libnix/sources/stack /root/amiga-gcc/build/libnix/sources/stack/filelist
make[3]: Entering directory '/root/amiga-gcc/projects/libnix/sources/stack'
echo "#Computer generated partial Makefile-do not edit" >/root/amiga-gcc/build/libnix/sources/stack/filelist
echo "OBJECTS= \\" >>/root/amiga-gcc/build/libnix/sources/stack/filelist
( for file in *.c; do echo $file; done ) | \
mawk '{ if($0 !~ /CVS/) { print substr($0,1,length($0)-2) ".o \\" } }' >>/root/amiga-gcc/build/libnix/sources/stack/filelist
echo >>/root/amiga-gcc/build/libnix/sources/stack/filelist
echo "SUBDIRS= \\" >>/root/amiga-gcc/build/libnix/sources/stack/filelist
ls -d -F *|mawk '/\// { if($0 !~ /CVS/) { print substr($0,1,length($0)-1) " \\" } }' >>/root/amiga-gcc/build/libnix/sources/stack/filelist
make[3]: Leaving directory '/root/amiga-gcc/projects/libnix/sources/stack'
cd /root/amiga-gcc/projects/libnix/sources/stubs;	make -f /root/amiga-gcc/build/libnix/sources/Makefile STUBDIR=/root/amiga-gcc/build/libnix/sources/stubs libbases/dos.c; \
	make -f /root/amiga-gcc/build/libnix/sources/Makefile SOURCEFILES=" \
	libbases/*.[cSCh] misc/*.c libnames/* stubs/*.[cSCh]" \
	FLDIR=/root/amiga-gcc/build/libnix/sources/stubs /root/amiga-gcc/build/libnix/sources/stubs/filelist
make[3]: Entering directory '/root/amiga-gcc/projects/libnix/sources/stubs'
rm -f libbases/* libnames/*
mawk <library.list '{ sname=substr($2,1,length($2)-8);        \
  fname="libbases/" sname ".c";                      \
  print "/* Machine-generated C-file- do not edit ! */" >fname; \
  print "#include <stabs.h>"                            >fname; \
  print "extern char __" sname "name[];"                >fname; \
  print "void *" $1 "[2]={ 0l,__" sname "name };"      >fname; \
  print "ADD2LIB(" $1 ");"                             >fname; \
  fname="libnames/" sname ".c";                      \
  print "/* Machine-generated C-file- do not edit ! */" >fname; \
  print "char __" sname "name[]=\"" $2 "\";"           >fname;}'
make[3]: Leaving directory '/root/amiga-gcc/projects/libnix/sources/stubs'
make[3]: Entering directory '/root/amiga-gcc/projects/libnix/sources/stubs'
echo "#Computer generated partial Makefile-do not edit" >/root/amiga-gcc/build/libnix/sources/stubs/filelist
echo "OBJECTS= \\" >>/root/amiga-gcc/build/libnix/sources/stubs/filelist
( for file in libbases/*.[cSCh] misc/*.c libnames/* stubs/*.[cSCh]; do echo $file; done ) | \
mawk '{ if($0 !~ /CVS/) { print substr($0,1,length($0)-2) ".o \\" } }' >>/root/amiga-gcc/build/libnix/sources/stubs/filelist
echo >>/root/amiga-gcc/build/libnix/sources/stubs/filelist
echo "SUBDIRS= \\" >>/root/amiga-gcc/build/libnix/sources/stubs/filelist
ls -d -F *|mawk '/\// { if($0 !~ /CVS/) { print substr($0,1,length($0)-1) " \\" } }' >>/root/amiga-gcc/build/libnix/sources/stubs/filelist
make[3]: Leaving directory '/root/amiga-gcc/projects/libnix/sources/stubs'
cd /root/amiga-gcc/projects/libnix/sources/amiga;	make -f /root/amiga-gcc/build/libnix/sources/Makefile SOURCEFILES="*/*.[cSCh]" FLDIR=/root/amiga-gcc/build/libnix/sources/amiga /root/amiga-gcc/build/libnix/sources/amiga/filelist
make[3]: Entering directory '/root/amiga-gcc/projects/libnix/sources/amiga'
echo "#Computer generated partial Makefile-do not edit" >/root/amiga-gcc/build/libnix/sources/amiga/filelist
echo "OBJECTS= \\" >>/root/amiga-gcc/build/libnix/sources/amiga/filelist
( for file in */*.[cSCh]; do echo $file; done ) | \
mawk '{ if($0 !~ /CVS/) { print substr($0,1,length($0)-2) ".o \\" } }' >>/root/amiga-gcc/build/libnix/sources/amiga/filelist
echo >>/root/amiga-gcc/build/libnix/sources/amiga/filelist
echo "SUBDIRS= \\" >>/root/amiga-gcc/build/libnix/sources/amiga/filelist
ls -d -F *|mawk '/\// { if($0 !~ /CVS/) { print substr($0,1,length($0)-1) " \\" } }' >>/root/amiga-gcc/build/libnix/sources/amiga/filelist
make[3]: Leaving directory '/root/amiga-gcc/projects/libnix/sources/amiga'
make[2]: Leaving directory '/root/amiga-gcc/build/libnix/sources'
cd startup;	make -f /root/amiga-gcc/build/libnix/sources/startup/Makefile V="VER: libnix 2.1b (01.12.2017)"
make[2]: Entering directory '/root/amiga-gcc/build/libnix/startup'
m68k-amigaos-as /root/amiga-gcc/projects/libnix/sources/startup/nrcrt0.S -o nrcrt0.o
m68k-amigaos-as  /root/amiga-gcc/projects/libnix/sources/startup/nbcrt0.S -o nbcrt0.o
m68k-amigaos-as -m68020 /root/amiga-gcc/projects/libnix/sources/startup/nlrcrt0.S -o nlrcrt0.o
m68k-amigaos-as -m68020 /root/amiga-gcc/projects/libnix/sources/startup/nlbcrt0.S -o nlbcrt0.o
m68k-amigaos-as /root/amiga-gcc/projects/libnix/sources/startup/ncrt0.S -o ncrt0.o
m68k-amigaos-gcc -I/root/amiga-gcc/projects/libnix/sources/startup/../headers -O -fomit-frame-pointer -c /root/amiga-gcc/projects/libnix/sources/startup/libinit.c 2>&1|tee libinit.err
In file included from /root/amiga-gcc/projects/libnix/sources/startup/libinit.c:7:0:
/root/amiga-gcc/projects/libnix/sources/startup/../headers/libinit.h:20:24: fatal error: proto/exec.h: No such file or directory
 #include <proto/exec.h>
                        ^
compilation terminated.
if test ! -s libinit.err; then rm libinit.err; fi
m68k-amigaos-gcc -I/root/amiga-gcc/projects/libnix/sources/startup/../headers -O -fomit-frame-pointer -c /root/amiga-gcc/projects/libnix/sources/startup/libinitr.c 2>&1|tee libinitr.err
In file included from /root/amiga-gcc/projects/libnix/sources/startup/libinitr.c:8:0:
/root/amiga-gcc/projects/libnix/sources/startup/../headers/libinit.h:20:24: fatal error: proto/exec.h: No such file or directory
 #include <proto/exec.h>
                        ^
compilation terminated.
if test ! -s libinitr.err; then rm libinitr.err; fi
m68k-amigaos-gcc -I/root/amiga-gcc/projects/libnix/sources/startup/../headers -O -fomit-frame-pointer -c /root/amiga-gcc/projects/libnix/sources/startup/devinit.c 2>&1|tee devinit.err
In file included from /root/amiga-gcc/projects/libnix/sources/startup/devinit.c:7:0:
/root/amiga-gcc/projects/libnix/sources/startup/../headers/libinit.h:20:24: fatal error: proto/exec.h: No such file or directory
 #include <proto/exec.h>
                        ^
compilation terminated.
if test ! -s devinit.err; then rm devinit.err; fi
make[2]: Leaving directory '/root/amiga-gcc/build/libnix/startup'
cd lib; 	make -f /root/amiga-gcc/build/libnix/sources/Makefile V="VER: libnix 2.1b (01.12.2017)" CFLAGS="-Wall -Os -fomit-frame-pointer"
make[2]: Entering directory '/root/amiga-gcc/build/libnix/lib'
( mkdir -p nixmain; cd nixmain; make -f ../../sources/nixmain/Makefile V="VER: libnix 2.1b (01.12.2017)" CFLAGS="-Wall -Os -fomit-frame-pointer" )
make[3]: Entering directory '/root/amiga-gcc/build/libnix/lib/nixmain'
m68k-amigaos-gcc -I/root/amiga-gcc/projects/libnix/sources/nixmain/../headers -Wall -Os -fomit-frame-pointer -S /root/amiga-gcc/projects/libnix/sources/nixmain/__nocommandline.c -o __nocommandline.S 2>&1|tee __nocommandline.err
/root/amiga-gcc/projects/libnix/sources/nixmain/__nocommandline.c:4:24: fatal error: proto/exec.h: No such file or directory
 #include <proto/exec.h>
                        ^
compilation terminated.
m68k-amigaos-gcc -E -traditional -D_DOSBase=___DOSBase -D_UtilityBase=___UtilityBase -D_MathIeeeSingBasBase=___MathIeeeSingBasBase -D_MathIeeeSingTransBase=___MathIeeeSingTransBase -D_MathIeeeDoubBasBase=___MathIeeeDoubBasBase -D_MathIeeeDoubTransBase=___MathIeeeDoubTransBase -D_LocaleBase=___LocaleBase __nocommandline.S -o __nocommandline__2.S
m68k-amigaos-gcc: error: __nocommandline.S: No such file or directory
m68k-amigaos-gcc: fatal error: no input files
compilation terminated.
../../sources/nixmain/Makefile:30: recipe for target '__nocommandline.o' failed
make[3]: Leaving directory '/root/amiga-gcc/build/libnix/lib/nixmain'
make[3]: *** [__nocommandline.o] Error 1
/root/amiga-gcc/build/libnix/sources/Makefile:38: recipe for target 'nixmain' failed
make[2]: Leaving directory '/root/amiga-gcc/build/libnix/lib'
make[2]: *** [nixmain] Error 2
Makefile:43: recipe for target 'all' failed
make[1]: Leaving directory '/root/amiga-gcc/build/libnix'
make[1]: *** [all] Error 2
Makefile:522: recipe for target 'build/libnix/_done' failed

make all borks under cygwin with spurious newlines in makefile

cd build/binutils && CFLAGS="-Os" CPPFLAGS="-Os" CXXFLAGS="-Os" LIBCFLAGS_FOR_TARGET="-Os -g -fomit-frame-pointer" /home/thomc/Workspace/amiga-gcc/projects/binutils/configure --prefix=/opt/amiga --target=m68k-amigaos --disable-plugins --disable-werror
/home/thomc/Workspace/amiga-gcc/projects/binutils/configure: line 14: $'\r': command not found
/home/thomc/Workspace/amiga-gcc/projects/binutils/configure: line 29: syntax error near unexpected token newline' 'home/thomc/Workspace/amiga-gcc/projects/binutils/configure: line 29: ;;
make: *** [Makefile:346: build/binutils/gas/Makefile] Error 2

-Thom

vsnprintf is broken

Not sure if submitted on proper repo (clib2 has issues disabled). Suppose small test code:

#include <stdio.h>
#include <stdarg.h>

int lva(va_list va) {
	// This should return 8, returns 1
	char szTmp[2];
	return vsnprintf(szTmp, 2, "%s", va);
	
	// This too should return 8
	return vsnprintf(NULL, 0, "%s", va);
}

int l(int a, ...) {
		va_list va;
		va_start(va, a);
		int result = lva(va);
		va_end(va);
		
		return result;
}

void main(void) {
	int len = l(0, "testtest");
	printf("%d", len);
}

compiled with: m68k-amigaos-gcc main.c -o test -noixemul

This approach is commonly used to measure strings vsprintf output. Stumblet upon it when tried to compile https://github.com/fragglet/lhasa

Quoting http://www.cplusplus.com/reference/cstdio/vsnprintf/ :

Return Value
The number of characters that would have been written if n had been sufficiently large, not counting the terminating null character.

clib2 clashes with system includes

Trying to compile this file

#include <map>

with clib2, i.e.

m68k-amigaos-gcc -mcrt=clib2 test.cpp 

will make all hell break loose:

softwarefailure@mint:~ > m68k-amigaos-gcc -mcrt=clib2 test.cpp        
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/cstdlib:75:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:41,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/m68k-amigaos/sys-include/stdlib.h:47:22: error: conflicting declaration 'typedef long unsigned int size_t'
 typedef _BSD_SIZE_T_ size_t;
                      ^~~~~~
In file included from /opt/amiga/m68k-amigaos/clib2/include/time.h:47:0,
                 from /opt/amiga/m68k-amigaos/clib2/include/sys/types.h:51,
                 from /opt/amiga/m68k-amigaos/sys-include/stdlib.h:43,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/cstdlib:75,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:41,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/m68k-amigaos/clib2/include/stddef.h:63:22: note: previous declaration as 'typedef unsigned int size_t'
 typedef unsigned int size_t;
                      ^~~~~~
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/cstdlib:75:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:41,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/m68k-amigaos/sys-include/stdlib.h:71:2: error: 'quad_t' does not name a type
  quad_t quot;  /* quotient */
  ^~~~~~
/opt/amiga/m68k-amigaos/sys-include/stdlib.h:72:2: error: 'quad_t' does not name a type
  quad_t rem;  /* remainder */
  ^~~~~~
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/cstdlib:75:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:41,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/m68k-amigaos/sys-include/stdlib.h:192:11: error: 'quad_t' does not name a type
 __stdargs quad_t  qabs __P((quad_t));
           ^~~~~~
In file included from /opt/amiga/m68k-amigaos/sys-include/stdlib.h:88:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/cstdlib:75,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:41,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/m68k-amigaos/sys-include/stdlib.h:193:24: error: 'quad_t' was not declared in this scope
 __stdargs qdiv_t  qdiv __P((quad_t, quad_t));
                        ^
/opt/amiga/m68k-amigaos/sys-include/stdlib.h:193:24: error: 'quad_t' was not declared in this scope
 __stdargs qdiv_t  qdiv __P((quad_t, quad_t));
                        ^
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/cstdlib:75:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:41,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/m68k-amigaos/sys-include/stdlib.h:194:11: error: 'quad_t' does not name a type
 __stdargs quad_t  strtoq __P((const char *, char **, int));
           ^~~~~~
/opt/amiga/m68k-amigaos/sys-include/stdlib.h:195:11: error: 'u_quad_t' does not name a type
 __stdargs u_quad_t strtouq __P((const char *, char **, int));
           ^~~~~~~~
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(int)':
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5475:20: error: no matching function for call to '__to_xstring(int (__attribute__((__stkparm__)) *)(char*, size_t, const char*, va_list), long unsigned int, const char [3], int&)'
         "%d", __val); }
                    ^
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note: candidate: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, std::size_t, const _CharT*, void*), std::size_t, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^~~~~~~~~~~~
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note:   template argument deduction/substitution failed:
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5475:20: note:   mismatched types 'std::size_t {aka long unsigned int}' and 'size_t {aka unsigned int}'
         "%d", __val); }
                    ^
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(unsigned int)':
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5481:20: error: no matching function for call to '__to_xstring(int (__attribute__((__stkparm__)) *)(char*, size_t, const char*, va_list), long unsigned int, const char [3], unsigned int&)'
         "%u", __val); }
                    ^
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note: candidate: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, std::size_t, const _CharT*, void*), std::size_t, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^~~~~~~~~~~~
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note:   template argument deduction/substitution failed:
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5481:20: note:   mismatched types 'std::size_t {aka long unsigned int}' and 'size_t {aka unsigned int}'
         "%u", __val); }
                    ^
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(long int)':
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5486:21: error: no matching function for call to '__to_xstring(int (__attribute__((__stkparm__)) *)(char*, size_t, const char*, va_list), long unsigned int, const char [4], long int&)'
         "%ld", __val); }
                     ^
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note: candidate: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, std::size_t, const _CharT*, void*), std::size_t, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^~~~~~~~~~~~
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note:   template argument deduction/substitution failed:
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5486:21: note:   mismatched types 'std::size_t {aka long unsigned int}' and 'size_t {aka unsigned int}'
         "%ld", __val); }
                     ^
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(long unsigned int)':
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5492:21: error: no matching function for call to '__to_xstring(int (__attribute__((__stkparm__)) *)(char*, size_t, const char*, va_list), long unsigned int, const char [4], long unsigned int&)'
         "%lu", __val); }
                     ^
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note: candidate: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, std::size_t, const _CharT*, void*), std::size_t, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^~~~~~~~~~~~
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note:   template argument deduction/substitution failed:
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5492:21: note:   mismatched types 'std::size_t {aka long unsigned int}' and 'size_t {aka unsigned int}'
         "%lu", __val); }
                     ^
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(long long int)':
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5498:22: error: no matching function for call to '__to_xstring(int (__attribute__((__stkparm__)) *)(char*, size_t, const char*, va_list), long unsigned int, const char [5], long long int&)'
         "%lld", __val); }
                      ^
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note: candidate: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, std::size_t, const _CharT*, void*), std::size_t, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^~~~~~~~~~~~
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note:   template argument deduction/substitution failed:
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5498:22: note:   mismatched types 'std::size_t {aka long unsigned int}' and 'size_t {aka unsigned int}'
         "%lld", __val); }
                      ^
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(long long unsigned int)':
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5504:22: error: no matching function for call to '__to_xstring(int (__attribute__((__stkparm__)) *)(char*, size_t, const char*, va_list), long unsigned int, const char [5], long long unsigned int&)'
         "%llu", __val); }
                      ^
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note: candidate: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, std::size_t, const _CharT*, void*), std::size_t, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^~~~~~~~~~~~
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note:   template argument deduction/substitution failed:
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5504:22: note:   mismatched types 'std::size_t {aka long unsigned int}' and 'size_t {aka unsigned int}'
         "%llu", __val); }
                      ^
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(float)':
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5512:20: error: no matching function for call to '__to_xstring(int (__attribute__((__stkparm__)) *)(char*, size_t, const char*, va_list), const int&, const char [3], float&)'
         "%f", __val);
                    ^
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note: candidate: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, std::size_t, const _CharT*, void*), std::size_t, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^~~~~~~~~~~~
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note:   template argument deduction/substitution failed:
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5512:20: note:   mismatched types 'std::size_t {aka long unsigned int}' and 'size_t {aka unsigned int}'
         "%f", __val);
                    ^
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(double)':
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5521:20: error: no matching function for call to '__to_xstring(int (__attribute__((__stkparm__)) *)(char*, size_t, const char*, va_list), const int&, const char [3], double&)'
         "%f", __val);
                    ^
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note: candidate: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, std::size_t, const _CharT*, void*), std::size_t, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^~~~~~~~~~~~
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note:   template argument deduction/substitution failed:
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5521:20: note:   mismatched types 'std::size_t {aka long unsigned int}' and 'size_t {aka unsigned int}'
         "%f", __val);
                    ^
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(long double)':
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5530:21: error: no matching function for call to '__to_xstring(int (__attribute__((__stkparm__)) *)(char*, size_t, const char*, va_list), const int&, const char [4], long double&)'
         "%Lf", __val);
                     ^
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5420:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note: candidate: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, std::size_t, const _CharT*, void*), std::size_t, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^~~~~~~~~~~~
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/ext/string_conversions.h:89:5: note:   template argument deduction/substitution failed:
In file included from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/string:52:0,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/stdexcept:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/array:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/tuple:39,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/stl_map.h:63,
                 from /opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/map:61,
                 from test.cpp:1:
/opt/amiga/lib/gcc/m68k-amigaos/6.4.1b/include/c++/bits/basic_string.h:5530:21: note:   mismatched types 'std::size_t {aka long unsigned int}' and 'size_t {aka unsigned int}'
         "%Lf", __val); 

Looks like clib2 clashes with system includes in many ways.

Profiling: orphaned memcpy() and strange percentages after struct passed by value

I further experimented with -pg.
It looks quite good for simple tests. (nested function calls, functions with many parameters, recursive functions, lots of variables inside functions etc.

Eventually I tried to pass a struct by value to a function.
Now I see a lonely memcpy() in the tree (apparently) called by nobody. The memcopy propably copies the struct, but shouldn't it come from main then?
Additionally the percentage values now look strange to me.
output
profiler_main.c.gz

Multithreaded build sometimes fails

A fresh build sometimes fails for me like shown below:

matze@ubuntu-VirtualBox:~/amigatoolchain/amiga-gcc$ make all -j8 PREFIX=/home/matze/amigatoolchain/amiga-gcc-out
make vbcc dtgen...done
unpack vbcc_target_m68k-amigaos...done
run vbcc dtgen...done
unpack ndk...done
patch ndk...done
configure fd2sfd...done
copying vbcc headers...done
copying vbcc headers...done
configure sfdc...done
creating vbcc config...failed
install: target ‘/home/matze/amigatoolchain/amiga-gcc-out/bin/’ is not a directory: No such file or directory
creating vbcc config...failed
less "log/creating vbcc config.log"
configure binutils... make fd2sfd... make ira... make vlink... make vbcc... make vasm...Makefile:562: recipe for target 'build-Linux/vbcc_target_m68k-amigaos/_done' failed
make: *** [build-Linux/vbcc_target_m68k-amigaos/_done] Error 1
make: *** Waiting for unfinished jobs....
make ira...done
make fd2sfd...done
make vbcc...done
install vbcc...done
make vlink...done
install vlink...done
make vasm...done
install vasm...done
configure binutils...done

Various build issues and assembler error

I've tried to build amiga-gcc according to the instructions. It didn't go smoothly but there were some issues, namely:

  1. First /opt/amiga could not be created. I solved this by running make all as root.
  2. Then proto/exec.h could not be found. I solved this by adding the NDK 3.9 includes to C_INCLUDE_PATH.
  3. Then libtool could not be found in amiga-gcc/build/gcc/m68k-amigaos/libstdc++-v3. I solved this by copying the libtool binary that was in amiga-gcc/build/binutils/binutils.

Just when I thought all was solved I got the following error:

/home/andreas/amiga-gcc/build/gcc/./gcc/xgcc -shared-libgcc -B/home/andreas/amiga-gcc/build/gcc/./gcc -nostdinc++ -L/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libstdc++-v3/src -L/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libstdc++-v3/src/.libs -L/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libstdc++-v3/libsupc++/.libs -B/opt/amiga/m68k-amigaos/bin/ -B/opt/amiga/m68k-amigaos/lib/ -isystem /opt/amiga/m68k-amigaos/include -isystem /opt/amiga/m68k-amigaos/sys-include -I/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libstdc++-v3/include/m68k-amigaos -I/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libstdc++-v3/include -I/home/andreas/amiga-gcc/projects/gcc/libstdc++-v3/libsupc++ -Os -noixemul -Os -noixemul -std=gnu++98 -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -frandom-seed=compatibility.lo -g -O2 -c /home/andreas/amiga-gcc/projects/gcc/libstdc++-v3/src/c++98/compatibility.cc  -fPIC -DPIC -o .libs/compatibility.o
/tmp/ccpPIpJC.s: Assembler messages:
/tmp/ccpPIpJC.s:490: Error: syntax error -- statement `lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), a4' ignored
make[5]: *** [compatibility.lo] Fehler 1
make[5]: Verlasse Verzeichnis '/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libstdc++-v3/src'
make[4]: *** [all-recursive] Fehler 1
make[4]: Verlasse Verzeichnis '/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libstdc++-v3/src'
make[3]: *** [all-recursive] Fehler 1
make[3]: Verlasse Verzeichnis '/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libstdc++-v3'
make[2]: *** [all] Fehler 2
make[2]: Verlasse Verzeichnis '/home/andreas/amiga-gcc/build/gcc/m68k-amigaos/libstdc++-v3'
make[1]: *** [all-target-libstdc++-v3] Fehler 2
make[1]: Verlasse Verzeichnis '/home/andreas/amiga-gcc/build/gcc'
make: *** [build/gcc/_libgcc_done] Fehler 2

Unfortunately, I don't know how to fix this last build error. What's wrong here?

Read only data sections are intermixed with code sections

With current gcc the .rodata sections of generated files are intermixed directly with .text sections. This is not a behavior observable in case of other platforms and it may result in an executable which does compile properly but crash at startup.

Given the source code:

#include <exec/types.h>
const UWORD bad_data = 0x4afc; // ILLEGAL m68k opcode
int function() {
return -1;
}

Compile with options -nostdlib -noixemul. Resulting executable will contain the bad_data placed before the function body in executable section. Thus the file will crash when executed on Amiga.

The .rodata sections should be all passed after executable sections. At least this is the way it work on all other platforms. If any specific data shall be put into executable section, it shall be done with attribute((section(".text"))) instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.