OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 23, 2024 7:10 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Porting GCC
PostPosted: Wed Sep 26, 2018 4:48 pm 
Offline
Member
Member

Joined: Sat Sep 24, 2016 12:06 am
Posts: 90
Hi!
I'm trying to build gcc, firstly i'm building binutils, but getting an some error, i'm noob in linux, using cygwin.
There is output:
MrLolthe1st@MrLolthe1stPC /cygdrive/e/BOS/GCC/build-binutils
$ ../binutils/configure --target=i686-butterflyos --prefix="$PREFIX" --with-sysroot=os/sysroot --disable-werror
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking target system type... i686-pc-butterflyos
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for bison... no
checking for byacc... no
checking for yacc... no
checking for bison... no
checking for gm4... no
checking for gnum4... no
checking for m4... no
checking for flex... no
checking for lex... no
checking for flex... no
checking for makeinfo... no
checking for expect... no
checking for runtest... no
checking for ar... ar
checking for as... as
checking for dlltool... dlltool
checking for ld... (cached) E:/OS/compilers/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe
checking for lipo... no
checking for nm... nm
checking for ranlib... ranlib
checking for strip... strip
checking for windres... windres
checking for windmc... windmc
checking for objcopy... objcopy
checking for objdump... objdump
checking for i686-butterflyos-cc... no
checking for i686-butterflyos-gcc... no
checking for i686-butterflyos-c++... no
checking for i686-butterflyos-g++... no
checking for i686-butterflyos-cxx... no
checking for i686-butterflyos-gxx... no
checking for i686-butterflyos-gcc... no
checking for i686-butterflyos-gcj... no
checking for i686-butterflyos-gfortran... no
checking for i686-butterflyos-ar... no
checking for i686-butterflyos-as... no
checking for i686-butterflyos-dlltool... no
checking for i686-butterflyos-ld... no
checking for i686-butterflyos-lipo... no
checking for i686-butterflyos-nm... no
checking for i686-butterflyos-objdump... no
checking for i686-butterflyos-ranlib... no
checking for i686-butterflyos-strip... no
checking for i686-butterflyos-windres... no
checking for i686-butterflyos-windmc... no
checking where to find the target ar... just compiled
checking where to find the target as... just compiled
checking where to find the target cc... pre-installed
checking where to find the target c++... pre-installed
checking where to find the target c++ for libstdc++... pre-installed
checking where to find the target dlltool... just compiled
checking where to find the target gcc... pre-installed
checking where to find the target gcj... pre-installed
checking where to find the target gfortran... pre-installed
checking where to find the target ld... just compiled
checking where to find the target lipo... pre-installed
checking where to find the target nm... just compiled
checking where to find the target objdump... just compiled
checking where to find the target ranlib... just compiled
checking where to find the target strip... just compiled
checking where to find the target windres... just compiled
checking where to find the target windmc... just compiled
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether -fkeep-inline-functions is supported... yes
configure: creating ./config.status
config.status: creating Makefile

MrLolthe1st@MrLolthe1stPC /cygdrive/e/BOS/GCC/build-binutils
$ make
MAKE Version 5.2 Copyright (c) 1987, 1998 Inprise Corp.
Error makefile 186: Command syntax error
Error makefile 190: Command syntax error
Fatal makefile 13340: No terminator specified for in-line file operator

I'm assign files to post.


Attachments:
File comment: makefile
Makefile.zip [38.84 KiB]
Downloaded 8 times
Top
 Profile  
 
 Post subject: Re: Porting GCC
PostPosted: Wed Sep 26, 2018 5:42 pm 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 676
MrLolthe1st wrote:
$ ../binutils/configure --target=i686-butterflyos --prefix="$PREFIX" --with-sysroot=os/sysroot --disable-werror

Based on this configure line, you are building a cross compiler, not porting GCC. That is a very important difference in the context of OS development. If your intention was to build GCC to run on your OS, you need to specify --host, and you will find that you also need quite a complete environment to accomplish that.

Quote:
$ make
MAKE Version 5.2 Copyright (c) 1987, 1998 Inprise Corp.

You are trying to use Borland Make to run a GNU Makefile. This will never work.

I suggest you stop trying to use cygwin. if you are on Windows 10, use the Windows Subsystem for Linux. If you are using an older version of Windows, either upgrade or set up a Linux VM to run your builds. Alternatively, someone will eventually come in with recommendations on a native Windows-based build system.

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
 Post subject: Re: Porting GCC
PostPosted: Thu Sep 27, 2018 7:10 am 
Offline
Member
Member

Joined: Sat Sep 24, 2016 12:06 am
Posts: 90
Ok, how i can port GCC. Are there any articles?


Top
 Profile  
 
 Post subject: Re: Porting GCC
PostPosted: Thu Sep 27, 2018 8:38 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
Could you clarify what you are trying to do.

Are you

1. Trying to build a version of gcc to run on Windows, or

2. Trying to build a version of gcc to run on an operating system that you have written.

The former (building a cross-compiler) supposes that you are running gcc on Windows already but want a version to target your operating system. This is a fairly simple process which is documented well on this wiki. The latter (porting) supposes that your operating system is fairly complete. This is a rather more complicated and advanced process, and is documented - with further references - here.


Top
 Profile  
 
 Post subject: Re: Porting GCC
PostPosted: Thu Sep 27, 2018 2:25 pm 
Offline
Member
Member

Joined: Mon Oct 29, 2012 2:26 pm
Posts: 28
If you are trying to build a cross compiler on Windows 10 I would recommend using Window Subsystem for Linux (WSL) over Cygwin. This allows you to do development from windows but utilize the same same build environment as most of the tutorials. You can accomplish many of the same things in cygwin, but you have to pay attention to the fact that you are doing something special. In WSL (I use Ubuntu, but any distro works) you can operate much closer to as if you are in a native unix environment. You can use pretty much all of the instructions throughout the wiki and forum with little to no modification to setup a build chain. If you are on something before windows 10 then you are stuck with cygwin.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: 0xY, Bing [Bot], DotBot [Bot], Google [Bot] and 108 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group