Web lists-archives.com

Re: [Mingw-users] I'm a newbie to MinGW. How Can I build MinGW from source?




My build OS: ubuntu 14
gcc version: 4.9
Note: my login account: www 
How do fix the error in gcc rebuild?

I follow steps in Keith Marshall-3's reply for "Problem with configure when
trying to build gcc 5.3":
1.downloaded source code
binutils-2.25.1-1-mingw32-src.tar.xz
mingwrt-3.22.4-mingw32-src.tar.xz
w32api-3.18.2-mingw32-src.tar.xz
gcc-5.3.0-3-mingw32-src.tar.xz

2.mkdir /home/www/mingw32-src
  mkdir /home/www/mingw32
  cd /home/www/mingw32-src

3.mingwrt:
untar mingwrt-3.22.4-mingw32-src.tar.xz in /home/www/mingw32-src and get
mingwrt-3.22.4 folder
cd /home/www/mingw32-src/mingwrt3.22.4
./configure --prefix=/home/www/mingw32
make install-headers

4.w32api:
untar w32api-3.18.2-mingw32-src.tar.xz in  /home/www/mingw32-src and get
w32api-3.18.2 folder
cd /home/www/mingw32-src/w32api-3.18.2
./configure --prefix=/home/www/mingw32
make install-headers

5.GNU binutils:
untar binutils-2.25.1-1-mingw32-src.tar.xz in  /home/www/mingw32-src and get
binutils-2.25.1 folder
cd /homw/www/mingw32-src/binutils-2.25.1
mkdir build
cd build  (pwd is /home/www/mingw32-src/binutils-2.25.1/build)
../configure --prefix=/home/www/mingw32 --with-sysroot=/home/www/mingw32
--target=mingw32
make
make install

6.Symbolically link:
cd /home/www/mingw32
ln -s /home/www/mingw32 mingw

7.Prepare GCC source:
untar gcc-5.3.0-3-mingw32-src.tar.xz in /home/www/mingw32-src and get
gcc-5.3.0 folder
cd /home/www/mingw32-src
mkdir src
mv gcc-5.3.0 src
cd src/gcc-5.3.0 (pwd is /home/www/mingw32-src/src/gcc-5.3.0 )
./contrib/download_prerequisites

8.Build GCC:
cd /home/www/mingw32-src
mkdir build
cd build     (pwd is /home/www/mingw32-src/build)
../src/gcc-5.3.0/configure --prefix=/home/www/mingw32
--with-sysroot=/home/www/mingw32
make all-gcc (here has a error: can't find /home/www/mingw32/usr/include. I
mkdir this path and rebuild successfully)
make install-gcc

At present, I finish building cross compiler.
Next,I'll start to build second pass.
9. Prepare GCC source again:
untar gcc-5.3.0-3-mingw32-src.tar.xz in /home/www/mingw32-src and get
gcc-5.3.0 folder again
cd /home/www/mingw32-src
mkdir srcx
mv gcc-5.3.0 srcx
cd srcx/gcc-5.3.0 (pwd is /home/www/mingw32-src/srcx/gcc-5.3.0 )
./contrib/download_prerequisites

10.Build GCC again:
cd /home/ww/mingw32-src
mkdir buildx
cd buildx        (pwd is /home/www/mingw32-src/buildx)
mingw-pkg SRCDIR=../srcx/gcc-5.3.0 patch
../srcx/gcc-5.3.0/configure --prefix=/mingw --disable-win32-registry
--target=mingw32 --with-arch=i586 --enable-languages=c,c++ --enable-static
--enable-

shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions
--enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw
--with-libintl-

prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp
--disable-libvtv --enable-nls
make

------There is a error:
make[2]: Leaving directory `/home/www/mingw32-src/buildx/libcc1'
Checking multilib configuration for libgcc...
Configuring in mingw32/libgcc
configure: loading cache ./config.cache
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-mingw32
checking for --enable-version-specific-runtime-libs... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... mawk
checking for mingw32-ar... mingw32-ar
checking for mingw32-lipo... mingw32-lipo
checking for mingw32-nm... /home/www/mingw32-src/buildx/./gcc/nm
checking for mingw32-ranlib... mingw32-ranlib
checking for mingw32-strip... mingw32-strip
checking whether ln -s works... yes
checking for mingw32-gcc... /home/www/mingw32-src/buildx/./gcc/xgcc
-B/home/www/mingw32-src/buildx/./gcc/ -L/home/www/mingw32-

src/buildx/mingw32/winsup/mingw
-L/home/www/mingw32-src/buildx/mingw32/winsup/w32api/lib -isystem
/home/www/mingw32-src/srcx/gcc-5.3.0/winsup/mingw/include 

-isystem /home/www/mingw32-src/srcx/gcc-5.3.0/winsup/w32api/include
-B/mingw/mingw32/bin/ -B/mingw/mingw32/lib/ -isystem /mingw/mingw32/include
-isystem 

/mingw/mingw32/sys-include   
checking for suffix of object files... configure: error: in
`/home/www/mingw32-src/buildx/mingw32/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory `/home/www/mingw32-src/buildx'
make: *** [all] Error 2


------My config.log file in /home/www/mingw32-src/buildx/mingw32/libgcc:
 $ /home/www/mingw32-src/srcx/gcc-5.3.0/libgcc/configure
--srcdir=../../../srcx/gcc-5.3.0/libgcc --cache-file=./config.cache
--enable-multilib --with-

cross-host=i686-pc-linux-gnu --prefix=/mingw --disable-win32-registry
--with-arch=i586 --enable-static --enable-shared --enable-threads
--with-dwarf2 --

disable-sjlj-exceptions --enable-version-specific-runtime-libs
--with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw
--enable-libstdcxx-debug --with-

tune=generic --enable-libgomp --disable-libvtv --enable-nls
--enable-languages=c,c++,lto --program-transform-name=s&^&mingw32-&
--disable-option-checking 

--with-target-subdir=mingw32 --build=i686-pc-linux-gnu --host=mingw32
--target=mingw32

## --------- ##
## Platform. ##
## --------- ##

hostname = ubuntu
uname -m = i686
uname -r = 3.13.0-32-generic
uname -s = Linux
uname -v = #57-Ubuntu SMP Tue Jul 15 03:51:12 UTC 2014

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/java/jre/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /usr/java/jre/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2018: loading cache ./config.cache
configure:2232: checking build system type
configure:2246: result: i686-pc-linux-gnu
configure:2266: checking host system type
configure:2279: result: i686-pc-mingw32
configure:2382: checking for --enable-version-specific-runtime-libs
configure:2395: result: yes
configure:2443: checking for a BSD-compatible install
configure:2511: result: /usr/bin/install -c
configure:2527: checking for gawk
configure:2554: result: mawk
configure:2654: checking for mingw32-ar
configure:2681: result: mingw32-ar
configure:2746: checking for mingw32-lipo
configure:2773: result: mingw32-lipo
configure:2838: checking for mingw32-nm
configure:2865: result: /home/www/mingw32-src/buildx/./gcc/nm
configure:2930: checking for mingw32-ranlib
configure:2957: result: mingw32-ranlib
configure:3022: checking for mingw32-strip
configure:3049: result: mingw32-strip
configure:3111: checking whether ln -s works
configure:3115: result: yes
configure:3132: checking for mingw32-gcc
configure:3159: result: /home/www/mingw32-src/buildx/./gcc/xgcc
-B/home/www/mingw32-src/buildx/./gcc/
-L/home/www/mingw32-src/buildx/mingw32/winsup/mingw 

-L/home/www/mingw32-src/buildx/mingw32/winsup/w32api/lib -isystem
/home/www/mingw32-src/srcx/gcc-5.3.0/winsup/mingw/include -isystem
/home/www/mingw32-

src/srcx/gcc-5.3.0/winsup/w32api/include -B/mingw/mingw32/bin/
-B/mingw/mingw32/lib/ -isystem /mingw/mingw32/include -isystem
/mingw/mingw32/sys-include   
configure:3428: checking for C compiler version
configure:3437: /home/www/mingw32-src/buildx/./gcc/xgcc
-B/home/www/mingw32-src/buildx/./gcc/
-L/home/www/mingw32-src/buildx/mingw32/winsup/mingw -

L/home/www/mingw32-src/buildx/mingw32/winsup/w32api/lib -isystem
/home/www/mingw32-src/srcx/gcc-5.3.0/winsup/mingw/include -isystem
/home/www/mingw32-

src/srcx/gcc-5.3.0/winsup/w32api/include -B/mingw/mingw32/bin/
-B/mingw/mingw32/lib/ -isystem /mingw/mingw32/include -isystem
/mingw/mingw32/sys-include    

--version >&5
xgcc (GCC) 5.3.0
Copyright (C) 2015 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:3448: $? = 0
configure:3437: /home/www/mingw32-src/buildx/./gcc/xgcc
-B/home/www/mingw32-src/buildx/./gcc/
-L/home/www/mingw32-src/buildx/mingw32/winsup/mingw -

L/home/www/mingw32-src/buildx/mingw32/winsup/w32api/lib -isystem
/home/www/mingw32-src/srcx/gcc-5.3.0/winsup/mingw/include -isystem
/home/www/mingw32-

src/srcx/gcc-5.3.0/winsup/w32api/include -B/mingw/mingw32/bin/
-B/mingw/mingw32/lib/ -isystem /mingw/mingw32/include -isystem
/mingw/mingw32/sys-include    

-v >&5
Reading specs from /home/www/mingw32-src/buildx/./gcc/specs
COLLECT_GCC=/home/www/mingw32-src/buildx/./gcc/xgcc
COLLECT_LTO_WRAPPER=/home/www/mingw32-src/buildx/./gcc/lto-wrapper
Target: mingw32
Configured with: ../srcx/gcc-5.3.0/configure --prefix=/mingw
--disable-win32-registry --target=mingw32 --with-arch=i586
--enable-languages=c,c++ --enable-

static --enable-shared --enable-threads --with-dwarf2
--disable-sjlj-exceptions --enable-version-specific-runtime-libs
--with-libiconv-prefix=/mingw --

with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic
--enable-libgomp --disable-libvtv --enable-nls : (reconfigured) ../srcx/gcc-

5.3.0/configure --prefix=/mingw --disable-win32-registry --target=mingw32
--with-arch=i586 --enable-languages=c,c++ --enable-static --enable-shared --

enable-threads --with-dwarf2 --disable-sjlj-exceptions
--enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw
--with-libintl-prefix=/mingw 

--enable-libstdcxx-debug --with-tune=generic --enable-libgomp
--disable-libvtv --enable-nls
Thread model: win32
gcc version 5.3.0 (GCC) 
configure:3448: $? = 0
configure:3437: /home/www/mingw32-src/buildx/./gcc/xgcc
-B/home/www/mingw32-src/buildx/./gcc/
-L/home/www/mingw32-src/buildx/mingw32/winsup/mingw -

L/home/www/mingw32-src/buildx/mingw32/winsup/w32api/lib -isystem
/home/www/mingw32-src/srcx/gcc-5.3.0/winsup/mingw/include -isystem
/home/www/mingw32-

src/srcx/gcc-5.3.0/winsup/w32api/include -B/mingw/mingw32/bin/
-B/mingw/mingw32/lib/ -isystem /mingw/mingw32/include -isystem
/mingw/mingw32/sys-include    

-V >&5
xgcc: error: unrecognized command line option '-V'
xgcc: fatal error: no input files
compilation terminated.
configure:3448: $? = 1
configure:3437: /home/www/mingw32-src/buildx/./gcc/xgcc
-B/home/www/mingw32-src/buildx/./gcc/
-L/home/www/mingw32-src/buildx/mingw32/winsup/mingw -

L/home/www/mingw32-src/buildx/mingw32/winsup/w32api/lib -isystem
/home/www/mingw32-src/srcx/gcc-5.3.0/winsup/mingw/include -isystem
/home/www/mingw32-

src/srcx/gcc-5.3.0/winsup/w32api/include -B/mingw/mingw32/bin/
-B/mingw/mingw32/lib/ -isystem /mingw/mingw32/include -isystem
/mingw/mingw32/sys-include    

-qversion >&5
xgcc: error: unrecognized command line option '-qversion'
xgcc: fatal error: no input files
compilation terminated.
configure:3448: $? = 1
configure:3464: /home/www/mingw32-src/buildx/./gcc/xgcc
-B/home/www/mingw32-src/buildx/./gcc/
-L/home/www/mingw32-src/buildx/mingw32/winsup/mingw -

L/home/www/mingw32-src/buildx/mingw32/winsup/w32api/lib -isystem
/home/www/mingw32-src/srcx/gcc-5.3.0/winsup/mingw/include -isystem
/home/www/mingw32-

src/srcx/gcc-5.3.0/winsup/w32api/include -B/mingw/mingw32/bin/
-B/mingw/mingw32/lib/ -isystem /mingw/mingw32/include -isystem
/mingw/mingw32/sys-include    

-o conftest -g -O2   conftest.c  >&5
/home/www/mingw32-src/buildx/./gcc/as: 106: exec: -o: not found
configure:3467: $? = 1
configure:3655: checking for suffix of object files
configure:3677: /home/www/mingw32-src/buildx/./gcc/xgcc
-B/home/www/mingw32-src/buildx/./gcc/
-L/home/www/mingw32-src/buildx/mingw32/winsup/mingw -

L/home/www/mingw32-src/buildx/mingw32/winsup/w32api/lib -isystem
/home/www/mingw32-src/srcx/gcc-5.3.0/winsup/mingw/include -isystem
/home/www/mingw32-

src/srcx/gcc-5.3.0/winsup/w32api/include -B/mingw/mingw32/bin/
-B/mingw/mingw32/lib/ -isystem /mingw/mingw32/include -isystem
/mingw/mingw32/sys-include    

-c -g -O2  conftest.c >&5
/home/www/mingw32-src/buildx/./gcc/as: 106: exec: -o: not found
configure:3681: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/";
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3695: error: in `/home/www/mingw32-src/buildx/mingw32/libgcc':
configure:3698: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-linux-gnu
ac_cv_env_CC_set=set
ac_cv_env_CC_value='/home/www/mingw32-src/buildx/./gcc/xgcc
-B/home/www/mingw32-src/buildx/./gcc/
-L/home/www/mingw32-src/buildx/mingw32/winsup/mingw -

L/home/www/mingw32-src/buildx/mingw32/winsup/w32api/lib -isystem
/home/www/mingw32-src/srcx/gcc-5.3.0/winsup/mingw/include -isystem
/home/www/mingw32-

src/srcx/gcc-5.3.0/winsup/w32api/include -B/mingw/mingw32/bin/
-B/mingw/mingw32/lib/ -isystem /mingw/mingw32/include -isystem
/mingw/mingw32/sys-include   

'
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-g -O2'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=i686-pc-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=mingw32
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=mingw32
ac_cv_host=i686-pc-mingw32
ac_cv_prog_AR=mingw32-ar
ac_cv_prog_AWK=mawk
ac_cv_prog_CC='/home/www/mingw32-src/buildx/./gcc/xgcc
-B/home/www/mingw32-src/buildx/./gcc/
-L/home/www/mingw32-src/buildx/mingw32/winsup/mingw -

L/home/www/mingw32-src/buildx/mingw32/winsup/w32api/lib -isystem
/home/www/mingw32-src/srcx/gcc-5.3.0/winsup/mingw/include -isystem
/home/www/mingw32-

src/srcx/gcc-5.3.0/winsup/w32api/include -B/mingw/mingw32/bin/
-B/mingw/mingw32/lib/ -isystem /mingw/mingw32/include -isystem
/mingw/mingw32/sys-include   

'
ac_cv_prog_LIPO=mingw32-lipo
ac_cv_prog_NM=/home/www/mingw32-src/buildx/./gcc/nm
ac_cv_prog_RANLIB=mingw32-ranlib
ac_cv_prog_STRIP=mingw32-strip

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='mingw32-ar'
AWK='mawk'
CC='/home/www/mingw32-src/buildx/./gcc/xgcc
-B/home/www/mingw32-src/buildx/./gcc/
-L/home/www/mingw32-src/buildx/mingw32/winsup/mingw -L/home/www/mingw32-

src/buildx/mingw32/winsup/w32api/lib -isystem
/home/www/mingw32-src/srcx/gcc-5.3.0/winsup/mingw/include -isystem
/home/www/mingw32-src/srcx/gcc-

5.3.0/winsup/w32api/include -B/mingw/mingw32/bin/ -B/mingw/mingw32/lib/
-isystem /mingw/mingw32/include -isystem /mingw/mingw32/sys-include   '
CFLAGS='-g -O2'
CPP=''
CPPFLAGS=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GREP=''
INSTALL_DATA='/usr/bin/install -c -m 644'
INSTALL_PROGRAM='/usr/bin/install -c'
INSTALL_SCRIPT='/usr/bin/install -c'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIPO='mingw32-lipo'
LN_S='ln -s'
LTLIBOBJS=''
MAINT='#'
NM='/home/www/mingw32-src/buildx/./gcc/nm'
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME='GNU C Runtime Library'
PACKAGE_STRING='GNU C Runtime Library 1.0'
PACKAGE_TARNAME='libgcc'
PACKAGE_URL='http://www.gnu.org/software/libgcc/'
PACKAGE_VERSION='1.0'
PATH_SEPARATOR=':'
PICFLAG=''
RANLIB='mingw32-ranlib'
SHELL='/bin/bash'
STRIP='mingw32-strip'
ac_ct_CC=''
accel_dir_suffix=''
asm_hidden_op=''
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias='i686-pc-linux-gnu'
build_cpu='i686'
build_libsubdir='build-i686-pc-linux-gnu'
build_os='linux-gnu'
build_subdir='build-i686-pc-linux-gnu'
build_vendor='pc'
cpu_type=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
decimal_float=''
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
double_type_size=''
dvidir='${docdir}'
enable_decimal_float=''
enable_shared='yes'
enable_vtable_verify='no'
exec_prefix='NONE'
extra_parts=''
fixed_point=''
force_explicit_eh_registry=''
host='i686-pc-mingw32'
host_alias='mingw32'
host_cpu='i686'
host_noncanonical='mingw32'
host_os='mingw32'
host_subdir='.'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
libgcc_topdir='../../../srcx/gcc-5.3.0/libgcc/..'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
long_double_type_size=''
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/mingw'
program_transform_name='s&^&mingw32-&'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
set_have_cc_tls=''
set_use_emutls=''
sfp_machine_header=''
sharedstatedir='${prefix}/com'
slibdir='$(libsubdir)'
sysconfdir='${prefix}/etc'
target_alias='mingw32'
target_noncanonical='mingw32'
target_subdir='mingw32'
thread_header=''
tm_defines=''
tm_file=''
tmake_file=''
toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
vis_hide=''
with_aix_soname='aix'

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "GNU C Runtime Library"
#define PACKAGE_TARNAME "libgcc"
#define PACKAGE_VERSION "1.0"
#define PACKAGE_STRING "GNU C Runtime Library 1.0"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL "http://www.gnu.org/software/libgcc/";

configure: exit 1



--
View this message in context: http://mingw.5.n7.nabble.com/SPAM-I-m-a-newbie-to-MinGW-How-Can-I-build-MinGW-from-source-tp35651p35672.html
Sent from the MinGW - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe