03 October 2019, 10:50 | #1 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Building gcc from source
I'm trying to build gcc from SVN using msys2. I'm using the following configure:
Code:
../gcc-svn/configure --prefix=/opt/gcc-m68k-dev --target=m68k-elf --with-arch=m68k --with-cpu=m68000 --enable-languages=c,c++ --with-newlib --disable-libmudflap --disable-libssp --disable-libgomp --disable-libstdcxx-pch --disable-threads --disable-nls --disable-libquadmath --with-gnu-as --with-gnu-ld --without-headers --build=$MSYSTEM_CHOST --host=$MSYSTEM_CHOST Code:
checking for m68k-elf-gcc... /d/src/gcc/gcc-svn-msys/./gcc/xgcc -B/d/src/gcc/gcc-svn-msys/./gcc/ -B/opt/gcc-m68k-dev/m68k-elf/bin/ -B/opt/gcc-m68k-dev/m68k-elf/lib/ -isystem /opt/gcc-m68k-dev/m68k-elf/include -isystem /opt/gcc-m68k-dev/m68k-elf/sys-include checking for suffix of object files... configure: error: in `/d/src/gcc/gcc-svn-msys/m68k-elf/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details The problem is that it xgcc passes "-m..." to as which complains that it doesn't support that option. Code:
/d/src/gcc/gcc-svn-msys/./gcc/xgcc -B/d/src/gcc/gcc-svn-msys/./gcc/ -B/opt/gcc-m68k-dev/m68k-elf/bin/ -B/opt/gcc-m68k-dev/m68k-elf/lib/ -isystem /opt/gcc-m68k-dev/m68k-elf/include -isystem /opt/gcc-m68k-dev/m68k-elf/sys-include /tmp/t.c /d/src/gcc/gcc-svn-msys/./gcc/as: line 106: exec: -m: invalid option exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...] |
03 October 2019, 11:30 | #2 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 680
|
Quote:
You are using a relative path. Never ever do that again when calling configure! Plus your assembler does not match. |
|
03 October 2019, 13:12 | #3 |
Registered User
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,153
|
|
03 October 2019, 13:38 | #4 | |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Quote:
I'm now rebuilding with an absolute path, but I rather think that this is not the problem. I was building under debian as well, and it worked. What do you mean that my assembler doesn't match? Shouldn't the correct assembler be used by the build system? |
|
03 October 2019, 14:24 | #5 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 680
|
Quote:
the gcc is provided by binutils, gcc by gcc. both are available in various versions. you can't combine every version of binutils with every version of gcc, but you have to use a working combination. so the version of your binutils is presumably not compatible to the used gcc version. |
|
03 October 2019, 18:14 | #6 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
After compiling binutils it worked. Thanks. Now I get another configure error can not compute EOF. It's really hard to compile gcc...
|
03 October 2019, 19:28 | #7 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 680
|
Quote:
you know that there are pre-configured toolchains which do build binutils, gcc and even something more? And if you'd only grab the recipes, it might be useful |
|
03 October 2019, 19:41 | #8 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Actually I wanted to take a a look at that CC0 vs MODE_CC issue, because m68k might go out of business if that is not fixed. So I figured that I should be able to compile gcc.
What toolchain can I use for that? |
04 October 2019, 21:20 | #9 | ||
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 680
|
Quote:
Yes that's true. Plus there is a bounty on implementing it: https://www.bountysource.com/issues/...uture-releases On the other side: one can still maintain it's own m68k branch... Quote:
You might use mine (amiga-gcc) but * switch to the master branch after you build everything once by 'make all -j4' (or -j8 or ...). The easiest way to switch is to delete the gcc folder and clone it again, since it's a shallow clone (you can also unshallow it, but that's more complicated). * modify the Makefile to build it for m68k-elf since there is no m68k-amigaos target in the master branch. * create soft links where needed, so the m68k-amigaos-as, -ld, ... is used also as m68k-elf-as, -ls, ... * make clean-gcc and then run make gcc. Now you should be able to compile for the Amiga using gcc-10-elf. For testing you may use *uae or vamos. Good luck hunting. |
||
04 October 2019, 23:45 | #10 | ||||
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Quote:
Yes. That's one motivation, though I guess that the maintainers will grab it much earlier then me, as it already reaches a level, which makes it interesting for them. Still, it's an interesting project, and maybe they are not interested or have the time to do it (as is the current status). The official maintainers don't have enough time to do this port as there is no commerical incentive, so they would have to do it on their own, which is one reason why the bounty was prepared. I also donated to it, because I'm not sure if I can really complete this and I think in the long run, it may not be good to rot the m68k support away in gcc. Quote:
I was not sure if that would work, as gcc is now at 9.x and yours is currently at 6.5. If I manage to pull this off, would it make sense to backport it (if needed at all)? Quote:
I guess for this particular task, I don't think I need to be able to compile for Amiga specifically, as on the machine level this change is relevant for all m68k targets. I now successfully compiled gcc from source, even though I had to skip c++v3, but again, for this project it shouldn't matter anyway. Still, I'm curious what changes you needed to apply, apart from the includes of course, to have a proper Amiga binary? After all, elf is not the native format, so you somehow must have replaced the linker to produce the proper hunk format. Quote:
Thanks. We will see how far I get with this as it is only a hobby for me. At least it is interesting, and I already learned a lot about how gcc works and it may be useful for the community as well. |
||||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
gcc and cybergraphics | zeGouky | Coders. C/C++ | 3 | 20 November 2016 04:08 |
GCC problems | Minuous | Coders. C/C++ | 3 | 08 September 2016 16:16 |
Instructions for building QEMU plugins (x86 and x64) from source? | headkase | support.WinUAE | 31 | 10 July 2016 16:01 |
Building WinUAE from source | strim | support.WinUAE | 3 | 26 June 2015 12:21 |
Building 68k C++ using gcc and an IDE! | NovaCoder | Coders. General | 25 | 17 May 2010 02:19 |
|
|