Gentle People:

   I am attempting to build a GCC Cross compiler running on CentOS (RedHat) and targeting Mingw x86_64-w64-mingw32-gcc. The linker Error occurs on Pass 2 of The Gcc Build, noting that all of the previous steps were successful. I have included the detailed directions that I used for the build shown below, with the full detailed Error Listing at the bottom of this Email.
Short Error Listing:
/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find dllcrt2.o: No such file or directory /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find crtbegin.o: No such file or directory /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmingwthrd.a when searching for -lmingwthrd
Questions:
1) "cannot find dllcrt2.o" --> Where - What directory(s) is it looking in?
and what library dose it want Host or new Target?
2) "skipping incompatible" -> What library is required here Host or new Target?
Using -libdir I cannot seem to find ANY Libraries it likes!
3) " /home/tdineen/Mingw_X86_12_2019/gcc-4.8.0/Build/./gcc/xgcc"
Is the correct tool being called here?

;
; Successful Header Build
;
cd /home/tdineen/Mingw_X86_12_2019/mingw-w64-v7.0.0/mingw-w64-headers
./configure --prefix=/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot --host=x86_64-w64-mingw32
make
make install
Success!

;
; Targets
;
x86_64-w64-mingw32-gcc
i686-w64-mingw32-gcc

;
; Library Builds
;

;
; gmp
;
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2
bunzip2 gmp-4.3.2.tar.bz2
tar xvf gmp-4.3.2.tar
cd gmp-4.3.2
./configure --disable-shared --enable-static --prefix=/tmp/gcc
make && make check && make install
Success!

;
; mpfr
;
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2
bunzip2 mpfr-2.4.2.tar.bz2
tar xvf mpfr-2.4.2.tar
cd mpfr-2.4.2
./configure --disable-shared --enable-static --prefix=/tmp/gcc --with-gmp=/tmp/gcc
make && make check && make install
Success!

;
; mpc
;
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz
tar zxvf mpc-0.8.1.tar.gz
cd mpc-0.8.1
/configure --disable-shared --enable-static --prefix=/tmp/gcc --with-gmp=/tmp/gcc --with-mpfr=/tmp/gcc
make && make check && make install
Success!

;
; Main Build Mingw
;
mkdir Mingw_X86_12_2019
cd Mingw_X86_12_2019
bunzip2 *
gunzip mingw-w64-v2.0.7.tar.gz
tar -xvf binutils-2.23.1.tar
tar -xvf gcc-4.8.0.tar
tar -xvf mingw-w64-v2.0.7.tar

;
; MingwRT Headers:
;
; GCC Requires some files from the mingw package to compile,
; so we will install them first
;

cd /home/tdineen/Mingw_X86_12_2019
mkdir x86_64-w64-mingw32
cd x86_64-w64-mingw32
mkdir sysroot
/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot
cd /home/tdineen/Mingw_X86_12_2019

cd /home/tdineen/Mingw_X86_12_2019
unzip mingw-w64-v7.0.0.zip
cd mingw-w64-v7.0.0
cd mingw-w64-headers
/home/tdineen/Mingw_X86_12_2019/mingw-w64-v7.0.0/mingw-w64-headers

cd /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot
mkdir mingw
cd mingw
mkdir lib
cd lib
/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/mingw/lib

cd /home/tdineen/Mingw_X86_12_2019
cd mingw-w64-v7.0.0
cd mingw-w64-headers

./configure --prefix=/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot --host=x86_64-w64-mingw32

make install --> Success

ln -s /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/x86_64-w64-mingw32 x86_64-w64-mingw32

install -d -m755 ./include /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/mingw/include
Success!

cp -R ./include/* /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/mingw/include

;
; Headers In:
;
;
/home/tdineen/Mingw_X86_12_2019/mingw-w64-v7.0.0/mingw-w64-headers/include
/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/mingw/include


;
; Binutils
;

cd /home/tdineen/Mingw_X86_12_2019
cd binutils-2.23.1
mkdir Build
cd Build
../configure --prefix=/home/tdineen/Mingw_X86_12_2019 --target=x86_64-w64-mingw32 --with-sysroot=/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot --enable-targets=x86_64-w64-mingw32,i686-w64-mingw32
make --> Success
make install --> Succes


Linux3% pwd
/home/tdineen/Mingw_X86_12_2019/bin
Linux3% ls
x86_64-w64-mingw32-addr2line  x86_64-w64-mingw32-gprof x86_64-w64-mingw32-readelf
x86_64-w64-mingw32-ar          x86_64-w64-mingw32-ld x86_64-w64-mingw32-size
x86_64-w64-mingw32-as          x86_64-w64-mingw32-ld.bfd x86_64-w64-mingw32-strings
x86_64-w64-mingw32-c++filt    x86_64-w64-mingw32-nm x86_64-w64-mingw32-strip
x86_64-w64-mingw32-dlltool    x86_64-w64-mingw32-objcopy x86_64-w64-mingw32-windmc x86_64-w64-mingw32-dllwrap    x86_64-w64-mingw32-objdump x86_64-w64-mingw32-windres
x86_64-w64-mingw32-elfedit    x86_64-w64-mingw32-ranlib


;
; GCC Pass1
;

We will start by compiling a basic gcc compiler, just enough to compile the mingw headers.
The full gcc suite requires us to install the mingw headers/libraries first

;
; Adjust PATH To Leave Out Local Directories:
;

setenv PATH "/usr/lib64/qt-3.3/bin:/usr/bin:/usr/local/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"

; Linux3% echo $PATH
;
/usr/lib64/qt3.3/bin:/usr/bin:/usr/local/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

cd /home/tdineen/Mingw_X86_12_2019
bash
cd gcc-4.8.0
mkdir build
cd build
../configure --prefix=/home/tdineen/Mingw_X86_12_2019 --target=x86_64-w64-mingw32 --enable-languages=c,c++ --libexecdir=/usr/lib --disable-static --enable-threads=win32 --with-sysroot=/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot --enable-targets=all --with-cpu=generic -with-gmp=/home/tdineen/Mingw_X86_12_2019 --with-mpfr=/home/tdineen/Mingw_X86_12_2019 --with-mpc=/home/tdineen/Mingw_X86_12_2019

make all-gcc -- Success
; As root:
make install-gcc --> Success


cd /home/tdineen/Mingw_X86_12_2019/lib/gcc/x86_64-w64-mingw32/4.8.0


;
; MingwRT Libraries
;
; Now a full install of the mingw headers and libraries
;

cd /home/tdineen/Mingw_X86_12_2019
cd mingw-w64-v7.0.0
;
; Ran At mingw-w64-v7.0.0 Directory To Fix Configure And Make Errors. --> Build Whole Package!

cd mingw-w64-v7.0.0
../configure --prefix=/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot --host=x86_64-w64-mingw32 --with-sysroot=/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot
make --> Success
make install --> Success


;
; GCC Pass2
;
And now to do a full gcc install

;
; Use Same Configure As Pass1
;
../configure --prefix=/home/tdineen/Mingw_X86_12_2019 --target=x86_64-w64-mingw32 --enable-languages=c,c++ --libexecdir=/usr/lib --disable-static --enable-threads=win32 --with-sysroot=/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot --enable-targets=all --with-cpu=generic -with-gmp=/home/tdineen/Mingw_X86_12_2019 --with-mpfr=/home/tdineen/Mingw_X86_12_2019 --with-mpc=/home/tdineen/Mingw_X86_12_2019


mkdir build
cd build

make --> Crash Bug
make install

;
; Crash Listing
;


/bin/sh ../../../../libgcc/../mkinstalldirs 32
ln -s -f libgcc.map libgcc.map.def && if [ ! -d 32/shlib ]; then mkdir 32/shlib; else true; fi && /home/tdineen/Mingw_X86_12_2019/gcc-4.8.0/Build/./gcc/xgcc -B/home/tdineen/Mingw_X86_12_2019/gcc-4.8.0/Build/./gcc/ -L/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/lib -L/home/tdineen/Mingw_X86_12_2019/mingw/lib -isystem /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/include -isystem /home/tdineen/Mingw_X86_12_2019/mingw/include -B/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ -B/home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/lib/ -isystem /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/include -isystem /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sys-include -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -shared -nodefaultlibs libgcc.map.def -Wl,--out-implib,32/shlib/libgcc_s.a.tmp -o 32/shlib/libgcc_s_sjlj-1.dll.tmp -g -O2 -m32 -B./ _chkstk_s.o _chkstk_ms_s.o _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o gthr-win32_s.o cpuinfo_s.o tf-signs_s.o sfp-exceptions_s.o addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o floatunditf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a  -lmingwthrd -lmingw32 -lmingwex -lmoldname -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 && if [ -f 32/shlib/libgcc_s_sjlj-1.dll ]; then mv -f 32/shlib/libgcc_s_sjlj-1.dll 32/shlib/libgcc_s_sjlj-1.dll.backup; else true; fi && mv 32/shlib/libgcc_s_sjlj-1.dll.tmp 32/shlib/libgcc_s_sjlj-1.dll && mv 32/shlib/libgcc_s.a.tmp 32/shlib/libgcc_s.a /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find dllcrt2.o: No such file or directory /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find crtbegin.o: No such file or directory /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmingwthrd.a when searching for -lmingwthrd /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmingwthrd.a when searching for -lmingwthrd /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmingwthrd.a when searching for -lmingwthrd /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find -lmingwthrd /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmingw32.a when searching for -lmingw32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmingw32.a when searching for -lmingw32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmingw32.a when searching for -lmingw32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find -lmingw32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmingwex.a when searching for -lmingwex /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmingwex.a when searching for -lmingwex /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmingwex.a when searching for -lmingwex /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find -lmingwex /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmoldname.a when searching for -lmoldname /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmoldname.a when searching for -lmoldname /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmoldname.a when searching for -lmoldname /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find -lmoldname /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmsvcrt.a when searching for -lmsvcrt /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmsvcrt.a when searching for -lmsvcrt /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libmsvcrt.a when searching for -lmsvcrt /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find -lmsvcrt /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libadvapi32.a when searching for -ladvapi32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libadvapi32.a when searching for -ladvapi32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libadvapi32.a when searching for -ladvapi32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find -ladvapi32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libshell32.a when searching for -lshell32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libshell32.a when searching for -lshell32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libshell32.a when searching for -lshell32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find -lshell32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libuser32.a when searching for -luser32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libuser32.a when searching for -luser32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libuser32.a when searching for -luser32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find -luser32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libkernel32.a when searching for -lkernel32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libkernel32.a when searching for -lkernel32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: skipping incompatible /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/sysroot/lib/libkernel32.a when searching for -lkernel32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find -lkernel32 /home/tdineen/Mingw_X86_12_2019/x86_64-w64-mingw32/bin/ld: cannot find crtend.o: No such file or directory
collect2: error: ld returned 1 exit status
make[4]: *** [libgcc_s.dll] Error 1
make[4]: Leaving directory `/home/tdineen/Mingw_X86_12_2019/gcc-4.8.0/Build/x86_64-w64-mingw32/32/libgcc'
make[3]: *** [multi-do] Error 1
make[3]: Leaving directory `/home/tdineen/Mingw_X86_12_2019/gcc-4.8.0/Build/x86_64-w64-mingw32/libgcc'
make[2]: *** [all-multi] Error 2
make[2]: Leaving directory `/home/tdineen/Mingw_X86_12_2019/gcc-4.8.0/Build/x86_64-w64-mingw32/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/home/tdineen/Mingw_X86_12_2019/gcc-4.8.0/Build'
make: *** [all] Error 2







_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to