(1)V850 gcc 64位CPU的道路

Docker GCC – Docker 容器的 GCC 编译器

官方的Docker GCC (https://hub.docker.com/_/gcc/)

$ mkdir gcc
$ cd vgcc
$ docker pull gcc
Using default tag: latest
latest: Pulling from library/gcc
bc9ab73e5b14: Pull complete 
193a6306c92a: Pull complete 
e5c3f8c317dc: Pull complete 
a587a86c9dcb: Pull complete 
72744d0a318b: Downloading [===================>                               ]  81.34MB/213.2MB
49c09f517488: Download complete 
31779c261ff3: Downloading [==========>                                        ]  43.84MB/212.4MB
e28bce690143: Download complete 
882c09a8660a: Download complete 

$ docker run -it gcc:latest /bin/bash

root@af947f86fb70:/# ls /usr/src/gcc
ABOUT-NLS	    MAINTAINERS   config.rpath	gotools       libdecnumber  liboffloadmic    ltoptions.m4	 mpfr
COPYING		    MD5SUMS	  config.sub	include       libffi	    libquadmath      ltsugar.m4		 mpfr-3.1.4
COPYING.LIB	    Makefile.def  configure	install-sh    libgcc	    libsanitizer     ltversion.m4	 symlink-tree
COPYING.RUNTIME     Makefile.in   configure.ac	intl	      libgfortran   libssp	     lt~obsolete.m4	 ylwrap
COPYING3	    Makefile.tpl  contrib	isl	      libgo	    libstdc++-v3     maintainer-scripts  zlib
COPYING3.LIB	    NEWS	  depcomp	isl-0.18      libgomp	    libtool-ldflags  missing
ChangeLog	    README	  fixincludes	libada	      libhsail-rt   libtool.m4	     mkdep
ChangeLog.jit	    compile	  gcc		libatomic     libiberty     libvtv	     mkinstalldirs
ChangeLog.tree-ssa  config	  gmp		libbacktrace  libitm	    ltgcc.m4	     move-if-change
INSTALL		    config-ml.in  gmp-6.1.0	libcc1	      libmpx	    ltmain.sh	     mpc
LAST_UPDATED	    config.guess  gnattools	libcpp	      libobjc	    lto-plugin	     mpc-1.0.3

# cat  /usr/src/gcc/ChangeLog

2018-07-26  Release Manager
	* GCC 8.2.0 released.

gcc版本号:8.2.0
mpfr版本号:3.1.4
gmp版本号:6.1.0
mac版本号:1.0.3
binutils版本号:2.28
newlib版本号:2.4.0.20160527
gdb版本号:7.12.0

cat ChangeLog | grep version 
	* version.in: Set GDB version number to 7.12.0.DATE-git.

2011年6月29日,构建了v850交叉开发环境。

【原文】GCC 4.7.1を構築する(準備編) 2012-07-05
【翻譯】建構GCC 4.7.1(準備稿)2012年07月05日
【解釋】這是一篇關於建構GCC 4.7.1的準備步驟的文章,日期是2012年07月05日。

完成构建GCC 4.7.1(v850版)的过程。日期为2012年7月5日。

使用交叉编译器gcc进行构建-成功版
http://blog.techlab-xe.net/archives/3271

必要的库有GMP、MPFR、MPC、PPL和CLOOG。

道具
GNU编译器集合
GNU调试器
新库

git clone https://github.com/syohex/p5-Testgen.git

请前往以下网站,下载 V850 平台的编译工具链: https://gcc-renesas.com/ja/v850/v850-download-toolchains/

从源代码构建
https://github.com/nagadomi/otama/wiki/Building-from-source

关于Binutils的第一次。

...
WARNING: 'flex' is missing on your system.
         You should only need it if you modified a '.l' file.
         You may want to install the Fast Lexical Analyzer package:
         <http://flex.sourceforge.net/>
Makefile:983: recipe for target 'arlex.c' failed
make[4]: *** [arlex.c] Error 127
make[4]: Leaving directory '/usr/src/binutils/binutils-2.28/v850/binutils'
Makefile:1004: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/usr/src/binutils/binutils-2.28/v850/binutils'
Makefile:663: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/usr/src/binutils/binutils-2.28/v850/binutils'
Makefile:3609: recipe for target 'all-binutils' failed
make[1]: *** [all-binutils] Error 2
make[1]: Leaving directory '/usr/src/binutils/binutils-2.28/v850'
Makefile:849: recipe for target 'all' failed
make: *** [all] Error 2

听说需要使用Flex。

# apt install -y flex  mpc gperf autogen libpng-dev libjpeg-dev libgif-dev  
# apt install -y# apt-get install -y libssl-dev libyaml-dev libsqlite3-dev libleveldb-dev libgmp3-dev libmpfr-dev
# apt install -y binutils-source newlib-source gdb-source
root@a06d58840d37:~# apt-get install -y binutils-source newlib-source gdb-source
Reading package lists... Done
Building dependency tree        
Reading state information... Done
The following additional packages will be installed:
  libauthen-sasl-perl libencode-locale-perl libfile-listing-perl libfont-afm-perl libhtml-form-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl
  libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libio-html-perl libio-socket-ssl-perl liblwp-mediatypes-perl
  liblwp-protocol-https-perl libmailtools-perl libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libtext-unidecode-perl libtimedate-perl liburi-perl libwww-perl
  libwww-robotrules-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-parser-perl libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl perl-openssl-defaults
  tex-common texinfo
Suggested packages:
  libdigest-hmac-perl libgssapi-perl libdata-dump-perl libcrypt-ssleay-perl libauthen-ntlm-perl debhelper texlive-base texlive-latex-base texlive-generic-recommended
  texinfo-doc-nonfree texlive-fonts-recommended
The following NEW packages will be installed:
  binutils-source gdb-source libauthen-sasl-perl libencode-locale-perl libfile-listing-perl libfont-afm-perl libhtml-form-perl libhtml-format-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libio-html-perl
  libio-socket-ssl-perl liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libtext-unidecode-perl
  libtimedate-perl liburi-perl libwww-perl libwww-robotrules-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-parser-perl libxml-sax-base-perl libxml-sax-expat-perl
  libxml-sax-perl newlib-source perl-openssl-defaults tex-common texinfo
0 upgraded, 39 newly installed, 0 to remove and 1 not upgraded.
Need to get 56.3 MB of archives.
After this operation, 70.1 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 libtext-unidecode-perl all 1.30-1 [103 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 libxml-namespacesupport-perl all 1.11-1 [14.8 kB]
Get:3 http://deb.debian.org/debian stretch/main amd64 libxml-sax-base-perl all 1.07-1 [23.1 kB]
Get:4 http://deb.debian.org/debian stretch/main amd64 libxml-sax-perl all 0.99+dfsg-2 [68.3 kB]
Get:5 http://deb.debian.org/debian stretch/main amd64 libxml-libxml-perl amd64 2.0128+dfsg-1+deb9u1 [338 kB]
Get:6 http://deb.debian.org/debian stretch/main amd64 tex-common all 6.06 [566 kB]
Get:7 http://deb.debian.org/debian stretch/main amd64 texinfo amd64 6.3.0.dfsg.1-1+b2 [1295 kB]
Get:8 http://deb.debian.org/debian stretch/main amd64 binutils-source all 2.28-5 [19.4 MB]
Get:9 http://deb.debian.org/debian stretch/main amd64 gdb-source all 7.12-6 [27.3 MB]                                                                                             
Get:10 http://deb.debian.org/debian stretch/main amd64 libauthen-sasl-perl all 2.1600-1 [50.8 kB]                                                                                 
Get:11 http://deb.debian.org/debian stretch/main amd64 libencode-locale-perl all 1.05-1 [13.7 kB]                                                                                 
Get:12 http://deb.debian.org/debian stretch/main amd64 libtimedate-perl all 2.3000-2 [42.2 kB]                                                                                    
Get:13 http://deb.debian.org/debian stretch/main amd64 libhttp-date-perl all 6.02-1 [10.7 kB]                                                                                     
Get:14 http://deb.debian.org/debian stretch/main amd64 libfile-listing-perl all 6.04-1 [10.3 kB]                                                                                  
Get:15 http://deb.debian.org/debian stretch/main amd64 libfont-afm-perl all 1.20-2 [13.6 kB]                                                                                      
Get:16 http://deb.debian.org/debian stretch/main amd64 libhtml-tagset-perl all 3.20-3 [12.7 kB]                                                                                   
Get:17 http://deb.debian.org/debian stretch/main amd64 liburi-perl all 1.71-1 [88.6 kB]                                                                                           
Get:18 http://deb.debian.org/debian stretch/main amd64 libhtml-parser-perl amd64 3.72-3 [104 kB]                                                                                  
Get:19 http://deb.debian.org/debian stretch/main amd64 libio-html-perl all 1.001-1 [17.6 kB]                                                                                      
Get:20 http://deb.debian.org/debian stretch/main amd64 liblwp-mediatypes-perl all 6.02-1 [22.1 kB]                                                                                
Get:21 http://deb.debian.org/debian stretch/main amd64 libhttp-message-perl all 6.11-1 [75.9 kB]                                                                                  
Get:22 http://deb.debian.org/debian stretch/main amd64 libhtml-form-perl all 6.03-1 [23.9 kB]                                                                                     
Get:23 http://deb.debian.org/debian stretch/main amd64 libhtml-tree-perl all 5.03-2 [210 kB]                                                                                      
Get:24 http://deb.debian.org/debian stretch/main amd64 libhtml-format-perl all 2.12-1 [43.5 kB]                                                                                   
Get:25 http://deb.debian.org/debian stretch/main amd64 libhttp-cookies-perl all 6.01-1 [17.4 kB]                                                                                  
Get:26 http://deb.debian.org/debian stretch/main amd64 libhttp-daemon-perl all 6.01-1 [17.3 kB]                                                                                   
Get:27 http://deb.debian.org/debian stretch/main amd64 libhttp-negotiate-perl all 6.00-2 [13.6 kB]                                                                                
Get:28 http://deb.debian.org/debian stretch/main amd64 perl-openssl-defaults amd64 3 [6782 B]                                                                                     
Get:29 http://deb.debian.org/debian stretch/main amd64 libnet-ssleay-perl amd64 1.80-1 [285 kB]                                                                                   
Get:30 http://deb.debian.org/debian stretch/main amd64 libio-socket-ssl-perl all 2.044-1 [195 kB]                                                                                 
Get:31 http://deb.debian.org/debian stretch/main amd64 libnet-http-perl all 6.12-1 [23.8 kB]                                                                                      
Get:32 http://deb.debian.org/debian stretch/main amd64 libwww-robotrules-perl all 6.01-1 [14.3 kB]                                                                                
Get:33 http://deb.debian.org/debian stretch/main amd64 libwww-perl all 6.15-1 [195 kB]                                                                                            
Get:34 http://deb.debian.org/debian stretch/main amd64 liblwp-protocol-https-perl all 6.06-2 [9582 B]                                                                             
Get:35 http://deb.debian.org/debian stretch/main amd64 libnet-smtp-ssl-perl all 1.04-1 [6184 B]                                                                                   
Get:36 http://deb.debian.org/debian stretch/main amd64 libmailtools-perl all 2.18-1 [88.5 kB]                                                                                     
Get:37 http://deb.debian.org/debian stretch/main amd64 libxml-parser-perl amd64 2.44-2+b1 [212 kB]                                                                                
Get:38 http://deb.debian.org/debian stretch/main amd64 libxml-sax-expat-perl all 0.40-2 [12.9 kB]                                                                                 
Get:39 http://deb.debian.org/debian stretch/main amd64 newlib-source all 2.4.0.20160527-2 [5310 kB]                                                                               
Fetched 56.3 MB in 24s (2341 kB/s)                                                                                                                                                
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libtext-unidecode-perl.
(Reading database ... 29653 files and directories currently installed.)
Preparing to unpack .../00-libtext-unidecode-perl_1.30-1_all.deb ...
Unpacking libtext-unidecode-perl (1.30-1) ...
Selecting previously unselected package libxml-namespacesupport-perl.
Preparing to unpack .../01-libxml-namespacesupport-perl_1.11-1_all.deb ...
Unpacking libxml-namespacesupport-perl (1.11-1) ...
Selecting previously unselected package libxml-sax-base-perl.
Preparing to unpack .../02-libxml-sax-base-perl_1.07-1_all.deb ...
Unpacking libxml-sax-base-perl (1.07-1) ...
Selecting previously unselected package libxml-sax-perl.
Preparing to unpack .../03-libxml-sax-perl_0.99+dfsg-2_all.deb ...
Unpacking libxml-sax-perl (0.99+dfsg-2) ...
Selecting previously unselected package libxml-libxml-perl.
Preparing to unpack .../04-libxml-libxml-perl_2.0128+dfsg-1+deb9u1_amd64.deb ...
Unpacking libxml-libxml-perl (2.0128+dfsg-1+deb9u1) ...
Selecting previously unselected package tex-common.
Preparing to unpack .../05-tex-common_6.06_all.deb ...
Unpacking tex-common (6.06) ...
Selecting previously unselected package texinfo.
Preparing to unpack .../06-texinfo_6.3.0.dfsg.1-1+b2_amd64.deb ...
Unpacking texinfo (6.3.0.dfsg.1-1+b2) ...
Selecting previously unselected package binutils-source.
Preparing to unpack .../07-binutils-source_2.28-5_all.deb ...
Unpacking binutils-source (2.28-5) ...
Selecting previously unselected package gdb-source.
Preparing to unpack .../08-gdb-source_7.12-6_all.deb ...
Unpacking gdb-source (7.12-6) ...
Selecting previously unselected package libauthen-sasl-perl.
Preparing to unpack .../09-libauthen-sasl-perl_2.1600-1_all.deb ...
Unpacking libauthen-sasl-perl (2.1600-1) ...
Selecting previously unselected package libencode-locale-perl.
Preparing to unpack .../10-libencode-locale-perl_1.05-1_all.deb ...
Unpacking libencode-locale-perl (1.05-1) ...
Selecting previously unselected package libtimedate-perl.
Preparing to unpack .../11-libtimedate-perl_2.3000-2_all.deb ...
Unpacking libtimedate-perl (2.3000-2) ...
Selecting previously unselected package libhttp-date-perl.
Preparing to unpack .../12-libhttp-date-perl_6.02-1_all.deb ...
Unpacking libhttp-date-perl (6.02-1) ...
Selecting previously unselected package libfile-listing-perl.
Preparing to unpack .../13-libfile-listing-perl_6.04-1_all.deb ...
Unpacking libfile-listing-perl (6.04-1) ...
Selecting previously unselected package libfont-afm-perl.
Preparing to unpack .../14-libfont-afm-perl_1.20-2_all.deb ...
Unpacking libfont-afm-perl (1.20-2) ...
Selecting previously unselected package libhtml-tagset-perl.
Preparing to unpack .../15-libhtml-tagset-perl_3.20-3_all.deb ...
Unpacking libhtml-tagset-perl (3.20-3) ...
Selecting previously unselected package liburi-perl.
Preparing to unpack .../16-liburi-perl_1.71-1_all.deb ...
Unpacking liburi-perl (1.71-1) ...
Selecting previously unselected package libhtml-parser-perl.
Preparing to unpack .../17-libhtml-parser-perl_3.72-3_amd64.deb ...
Unpacking libhtml-parser-perl (3.72-3) ...
Selecting previously unselected package libio-html-perl.
Preparing to unpack .../18-libio-html-perl_1.001-1_all.deb ...
Unpacking libio-html-perl (1.001-1) ...
Selecting previously unselected package liblwp-mediatypes-perl.
Preparing to unpack .../19-liblwp-mediatypes-perl_6.02-1_all.deb ...
Unpacking liblwp-mediatypes-perl (6.02-1) ...
Selecting previously unselected package libhttp-message-perl.
Preparing to unpack .../20-libhttp-message-perl_6.11-1_all.deb ...
Unpacking libhttp-message-perl (6.11-1) ...
Selecting previously unselected package libhtml-form-perl.
Preparing to unpack .../21-libhtml-form-perl_6.03-1_all.deb ...
Unpacking libhtml-form-perl (6.03-1) ...
Selecting previously unselected package libhtml-tree-perl.
Preparing to unpack .../22-libhtml-tree-perl_5.03-2_all.deb ...
Unpacking libhtml-tree-perl (5.03-2) ...
Selecting previously unselected package libhtml-format-perl.
Preparing to unpack .../23-libhtml-format-perl_2.12-1_all.deb ...
Unpacking libhtml-format-perl (2.12-1) ...
Selecting previously unselected package libhttp-cookies-perl.
Preparing to unpack .../24-libhttp-cookies-perl_6.01-1_all.deb ...
Unpacking libhttp-cookies-perl (6.01-1) ...
Selecting previously unselected package libhttp-daemon-perl.
Preparing to unpack .../25-libhttp-daemon-perl_6.01-1_all.deb ...
Unpacking libhttp-daemon-perl (6.01-1) ...
Selecting previously unselected package libhttp-negotiate-perl.
Preparing to unpack .../26-libhttp-negotiate-perl_6.00-2_all.deb ...
Unpacking libhttp-negotiate-perl (6.00-2) ...
Selecting previously unselected package perl-openssl-defaults:amd64.
Preparing to unpack .../27-perl-openssl-defaults_3_amd64.deb ...
Unpacking perl-openssl-defaults:amd64 (3) ...
Selecting previously unselected package libnet-ssleay-perl.
Preparing to unpack .../28-libnet-ssleay-perl_1.80-1_amd64.deb ...
Unpacking libnet-ssleay-perl (1.80-1) ...
Selecting previously unselected package libio-socket-ssl-perl.
Preparing to unpack .../29-libio-socket-ssl-perl_2.044-1_all.deb ...
Unpacking libio-socket-ssl-perl (2.044-1) ...
Selecting previously unselected package libnet-http-perl.
Preparing to unpack .../30-libnet-http-perl_6.12-1_all.deb ...
Unpacking libnet-http-perl (6.12-1) ...
Selecting previously unselected package libwww-robotrules-perl.
Preparing to unpack .../31-libwww-robotrules-perl_6.01-1_all.deb ...
Unpacking libwww-robotrules-perl (6.01-1) ...
Selecting previously unselected package libwww-perl.
Preparing to unpack .../32-libwww-perl_6.15-1_all.deb ...
Unpacking libwww-perl (6.15-1) ...
Selecting previously unselected package liblwp-protocol-https-perl.
Preparing to unpack .../33-liblwp-protocol-https-perl_6.06-2_all.deb ...
Unpacking liblwp-protocol-https-perl (6.06-2) ...
Selecting previously unselected package libnet-smtp-ssl-perl.
Preparing to unpack .../34-libnet-smtp-ssl-perl_1.04-1_all.deb ...
Unpacking libnet-smtp-ssl-perl (1.04-1) ...
Selecting previously unselected package libmailtools-perl.
Preparing to unpack .../35-libmailtools-perl_2.18-1_all.deb ...
Unpacking libmailtools-perl (2.18-1) ...
Selecting previously unselected package libxml-parser-perl.
Preparing to unpack .../36-libxml-parser-perl_2.44-2+b1_amd64.deb ...
Unpacking libxml-parser-perl (2.44-2+b1) ...
Selecting previously unselected package libxml-sax-expat-perl.
Preparing to unpack .../37-libxml-sax-expat-perl_0.40-2_all.deb ...
Unpacking libxml-sax-expat-perl (0.40-2) ...
Selecting previously unselected package newlib-source.
Preparing to unpack .../38-newlib-source_2.4.0.20160527-2_all.deb ...
Unpacking newlib-source (2.4.0.20160527-2) ...
Setting up libhtml-tagset-perl (3.20-3) ...
Setting up libfont-afm-perl (1.20-2) ...
Setting up tex-common (6.06) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
update-language: texlive-base not installed and configured, doing nothing!
Setting up libxml-namespacesupport-perl (1.11-1) ...
Setting up libencode-locale-perl (1.05-1) ...
Setting up libtimedate-perl (2.3000-2) ...
Setting up perl-openssl-defaults:amd64 (3) ...
Setting up libio-html-perl (1.001-1) ...
Setting up libtext-unidecode-perl (1.30-1) ...
Setting up libxml-sax-base-perl (1.07-1) ...
Setting up liblwp-mediatypes-perl (6.02-1) ...
Setting up liburi-perl (1.71-1) ...
Setting up libhtml-parser-perl (3.72-3) ...
Setting up newlib-source (2.4.0.20160527-2) ...
Setting up libnet-http-perl (6.12-1) ...
Setting up libwww-robotrules-perl (6.01-1) ...
Setting up gdb-source (7.12-6) ...
Setting up libauthen-sasl-perl (2.1600-1) ...
Setting up libxml-sax-perl (0.99+dfsg-2) ...
update-perl-sax-parsers: Registering Perl SAX parser XML::SAX::PurePerl with priority 10...
update-perl-sax-parsers: Updating overall Perl SAX parser modules info file...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline

Creating config file /etc/perl/XML/SAX/ParserDetails.ini with new version
Setting up libhttp-date-perl (6.02-1) ...
Setting up libnet-ssleay-perl (1.80-1) ...
Setting up libio-socket-ssl-perl (2.044-1) ...
Setting up libhtml-tree-perl (5.03-2) ...
Setting up libfile-listing-perl (6.04-1) ...
Setting up libhttp-message-perl (6.11-1) ...
Setting up libxml-libxml-perl (2.0128+dfsg-1+deb9u1) ...
update-perl-sax-parsers: Registering Perl SAX parser XML::LibXML::SAX::Parser with priority 50...
update-perl-sax-parsers: Registering Perl SAX parser XML::LibXML::SAX with priority 50...
update-perl-sax-parsers: Updating overall Perl SAX parser modules info file...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Replacing config file /etc/perl/XML/SAX/ParserDetails.ini with new version
Setting up libhttp-negotiate-perl (6.00-2) ...
Setting up libnet-smtp-ssl-perl (1.04-1) ...
Setting up libhtml-format-perl (2.12-1) ...
Setting up libhttp-cookies-perl (6.01-1) ...
Setting up libhttp-daemon-perl (6.01-1) ...
Setting up libhtml-form-perl (6.03-1) ...
Setting up texinfo (6.3.0.dfsg.1-1+b2) ...
Setting up libmailtools-perl (2.18-1) ...
Setting up binutils-source (2.28-5) ...
Setting up liblwp-protocol-https-perl (6.06-2) ...
Setting up libwww-perl (6.15-1) ...
Setting up libxml-parser-perl (2.44-2+b1) ...
Setting up libxml-sax-expat-perl (0.40-2) ...
update-perl-sax-parsers: Registering Perl SAX parser XML::SAX::Expat with priority 50...
update-perl-sax-parsers: Updating overall Perl SAX parser modules info file...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Replacing config file /etc/perl/XML/SAX/ParserDetails.ini with new version

解凍 –

tar jxf gdb.tar.bz2 

cd ../binutils
tar Jxfv binutils-2.28.tar.xz

cd ../newlib
tar  Jxfv newlib-2.4.0.20160527.tar.xz 

GNU Binutils – GNU的二进制工具集

root@fc4077c03665:/usr/src/binutils/binutils-2.28/build_v850#  ../configure --target=v850-linux-elf --prefix=/usr/local/v850 --disable-nls

root@fc4077c03665:/usr/src/binutils/binutils-2.28/build_v850#  make

root@fc4077c03665:/usr/src/binutils/binutils-2.28/build_v850#  make install

配置、编译、安装日志

浓缩物

#./configure --enable-cxx --prefix=/usr/local/
# make
# make check
# make install

GMP记录(无错误)。链接:https://bit.ly/2Psz5Pj。

MPFR是一个原生支持多精度浮点运算的库。

# ./configure --with-gmp=/usr/local  --prefix=/usr/local/
# make
# make check

這是MPFR log(1 Fail, 1 Skip)的連結:https://bit.ly/2CSblgH,我還沒有執行make install。

# 原生中文:GCC (GNU C Compiler)

root@978fe57a45cc:/usr/src# ls
binutils  gcc  gdb  gdb.tar.bz2  newlib
root@978fe57a45cc:/usr/src# cd gcc
root@978fe57a45cc:/usr/src/gcc# ls
ABOUT-NLS	    INSTALL	  compile	depcomp      intl	   libffi	libobjc		 ltgcc.m4	     mkdep	     zlib
COPYING		    LAST_UPDATED  config	fixincludes  isl	   libgcc	liboffloadmic	 ltmain.sh	     mkinstalldirs
COPYING.LIB	    MAINTAINERS   config-ml.in	gcc	     isl-0.18	   libgfortran	libquadmath	 lto-plugin	     move-if-change
COPYING.RUNTIME     MD5SUMS	  config.guess	gmp	     libada	   libgo	libsanitizer	 ltoptions.m4	     mpc
COPYING3	    Makefile.def  config.rpath	gmp-6.1.0    libatomic	   libgomp	libssp		 ltsugar.m4	     mpc-1.0.3
COPYING3.LIB	    Makefile.in   config.sub	gnattools    libbacktrace  libhsail-rt	libstdc++-v3	 ltversion.m4	     mpfr
ChangeLog	    Makefile.tpl  configure	gotools      libcc1	   libiberty	libtool-ldflags  lt~obsolete.m4      mpfr-3.1.4
ChangeLog.jit	    NEWS	  configure.ac	include      libcpp	   libitm	libtool.m4	 maintainer-scripts  symlink-tree
ChangeLog.tree-ssa  README	  contrib	install-sh   libdecnumber  libmpx	libvtv		 missing	     ylwrap
root@978fe57a45cc:/usr/src/gcc# ln -sf ../newlib-2.4.0.20160527/newlib .
root@978fe57a45cc:/usr/src/gcc# ln -sf ../newlib-2.4.0.20160527/libgloss .
root@978fe57a45cc:/usr/src/gcc# mkdir -p build_v850 && cd build_v850
root@978fe57a45cc:/usr/src/gcc/build_v850# ../configure --target=v850-linux-elf --prefix=/home/syohei/local/v850 --disable-nls --enable-languages=c --with-gmp=/home/syohei/local --with-mpfr=/home/syohei/local --with-mpc=/home/syohei/local     --with-ppl=/home/syohei/local --with-cloog=/home/syohei/local --with-newlib --with-headers=../newlib/libc/include --enable-lto --enable-cloog-backend=isl
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... v850-linux-elf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... no
checking for mawk... mawk
checking for libatomic support... no
checking for libitm support... no
checking for libsanitizer support... no
checking for libvtv support... no
checking for libmpx support... no
checking for libhsail-rt support... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
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 ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... 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 objdir... .libs
checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.

GMP (Good Manufacturing Practice) 规范

root@978fe57a45cc:/usr/src/gmp-6.1.0#  CPPFLAGS=-fexceptions ../gcc/configure --prefix=/tmp/gcc --enable-cxx
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... no
checking for mawk... mawk
checking for libatomic support... ../gcc/configure: line 3177: ../gcc/libatomic/configure.tgt: No such file or directory
yes
checking for libitm support... ../gcc/configure: line 3215: ../gcc/libitm/configure.tgt: No such file or directory
yes
checking for libsanitizer support... ../gcc/configure: line 3234: ../gcc/libsanitizer/configure.tgt: No such file or directory
yes
checking for libvtv support... yes
checking for libmpx support... ../gcc/configure: line 3273: ../gcc/libmpx/configure.tgt: No such file or directory
yes
checking for libhsail-rt support... ../gcc/configure: line 3292: ../gcc/libhsail-rt/configure.tgt: No such file or directory
yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
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 ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... 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 objdir... .libs
configure: WARNING: using in-tree isl, disabling version check
The following languages will be built: c,c++,fortran,lto,objc
*** This configuration is not supported in the following subdirectories:
     gnattools
    (Any other directories should still work fine.)
checking for default BUILD_CONFIG... bootstrap-debug
checking for --enable-vtable-verify... no
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/local/lib/gcc/x86_64-linux-gnu/8.2.0/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/local/lib/gcc/x86_64-linux-gnu/8.2.0/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
configure: error: I suspect your system does not have 32-bit development libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.
root@978fe57a45cc:/usr/src/gmp-6.1.0# 

生成文件

创建一个最基本的交叉编译器的方式

跨编译器 2011年5月13日
http://d.hatena.ne.jp/n7shi/20110513

作为参考的自动化脚本: https://gist.github.com/7shi/d9556be0474220916649

一气呵成地制作一个跨编译器

gcc-4.6.1目前支持的架构是2011年7月22日发布的,具体信息请参考http://d.hatena.ne.jp/n7shi/20110722/1311322802

《跨平台编译器大合集》2011年06月27日
http://d.hatena.ne.jp/n7shi/20110627

保存作業中

$ docker ps
CONTAINER ID        IMAGE                      COMMAND             CREATED              STATUS              PORTS                                                                                                                                                                                                    NAMES
978fe57a45cc        kaizenjapan/gcc            "/bin/bash"         About a minute ago   Up About a minute                                                                                                                                                                                                            dreamy_rosalind

$ docker commit 978fe57a45cc  kaizenjapan/gcc

$ docker push kaizenjapan/gcc

第二次

$ mkdir v850
$ cd v850
$ docker run -it gcc /bin/bash

Docker(只需一种选项):

# apt-get update

gcc: 8.2.0
mpfr: 3.1.4
gmp: 6.1.0
mac: 1.0.3
binutils: 2.28-5
newlib: 2.4.0.20160527-2
gdb: 7.12.0

gcc:8.2.0
mpfr:3.1.4
gmp:6.1.0
mac:1.0.3
binutils:2.28-5
newlib:2.4.0.20160527-2
gdb:7.12.0

文献引用

GNU GCC的构建(从源代码)。
https://qiita.com/silverskyvicto/items/9cd51bc9aa035eb301bb

尝试从源代码构建GCC的修行:https://qiita.com/t_uda/items/080ae8adf924f83d2133

从源代码构建/安装GCC。

从源代码构建gcc 7.2.0。

使用源代码编译和安装 GCC 7.3.0
https://qiita.com/shun_tak/items/48f0541c299b0170563e

构建和安装最新的GCC 8.1版本。请参考链接:https://qiita.com/reishoku/items/5b9d6d696d7f6ad29359

在64位Linux上编译32位ELF程序。

如何逐个安装GCC与GMP、MPFR、MPC、ELF,且不使用共享库?

文件历史

版本0.10 初稿 20181022
版本0.11 推送 20181023
版本0.12 考虑V850/RH850两种方案 20181024
版本0.13 重新审查工作整理 20181029
版本0.14 记录mpfr错误 20181030