niXman / mingw-builds

Scripts for building the 32 and 64-bit MinGW-W64 compilers for Windows
Other
295 stars 107 forks source link

make it possible to cross-compile the toolchain from linux for windows #509

Open niXman opened 4 years ago

niXman commented 4 years ago

subj.

look at this branch: https://github.com/niXman/mingw-builds/tree/cross-build

now I can build everything up to GCS stage. then I faced with this error:

x86_64-w64-mingw32-gcc -L/mingw64/x86_64-w64-mingw32/lib -L/mingw64/mingw/lib -isystem /mingw64/x86_64-w64-mingw32/include -isystem /mingw64/mingw/include   -fno-checking -g -O2 -pipe -fno-ident -I/home/nixman/mingw-gcc-9.3.0/x86_64-930-posix-seh-rt_v7-s/mingw64/opt/include -I/home/nixman/mingw-gcc-9.3.0/prerequisites/x86_64-zlib-static/include -I/home/nixman/mingw-gcc-9.3.0/prerequisites/x86_64-w64-mingw32-static/include -O2 -I../../../../../src/gcc-9.3.0/libgcc/../winsup/w32api/include -g -O2 -pipe -fno-ident -I/home/nixman/mingw-gcc-9.3.0/x86_64-930-posix-seh-rt_v7-s/mingw64/opt/include -I/home/nixman/mingw-gcc-9.3.0/prerequisites/x86_64-zlib-static/include -I/home/nixman/mingw-gcc-9.3.0/prerequisites/x86_64-w64-mingw32-static/include -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -I. -I. -I../.././gcc -I../../../../../src/gcc-9.3.0/libgcc -I../../../../../src/gcc-9.3.0/libgcc/. -I../../../../../src/gcc-9.3.0/libgcc/../gcc -I../../../../../src/gcc-9.3.0/libgcc/../include -I../../../../../src/gcc-9.3.0/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_EMUTLS -Wno-missing-prototypes -Wno-type-limits -o divtf3.o -MT divtf3.o -MD -MP -MF divtf3.dep  -c ../../../../../src/gcc-9.3.0/libgcc/soft-fp/divtf3.c 
../../../../../src/gcc-9.3.0/libgcc/config/i386/cpuinfo.c: In function ‘get_intel_cpu’:
../../../../../src/gcc-9.3.0/libgcc/config/i386/cpuinfo.c:222:20: error: ‘bit_AVX512VNNI’ undeclared (first use in this function); did you mean ‘bit_AVX512VBMI’?
          if (ecx & bit_AVX512VNNI)
                    ^~~~~~~~~~~~~~
                    bit_AVX512VBMI
../../../../../src/gcc-9.3.0/libgcc/config/i386/cpuinfo.c:222:20: note: each undeclared identifier is reported only once for each function it appears in
../../../../../src/gcc-9.3.0/libgcc/config/i386/cpuinfo.c: In function ‘get_available_features’:
../../../../../src/gcc-9.3.0/libgcc/config/i386/cpuinfo.c:372:14: error: ‘bit_AVX512VBMI2’ undeclared (first use in this function); did you mean ‘bit_AVX512VBMI’?
    if (ecx & bit_AVX512VBMI2)
              ^~~~~~~~~~~~~~~
              bit_AVX512VBMI
../../../../../src/gcc-9.3.0/libgcc/config/i386/cpuinfo.c:374:14: error: ‘bit_GFNI’ undeclared (first use in this function); did you mean ‘bit_BMI’?
    if (ecx & bit_GFNI)
              ^~~~~~~~
              bit_BMI
../../../../../src/gcc-9.3.0/libgcc/config/i386/cpuinfo.c:376:14: error: ‘bit_VPCLMULQDQ’ undeclared (first use in this function); did you mean ‘bit_PCLMUL’?
    if (ecx & bit_VPCLMULQDQ)
              ^~~~~~~~~~~~~~
              bit_PCLMUL
../../../../../src/gcc-9.3.0/libgcc/config/i386/cpuinfo.c:378:14: error: ‘bit_AVX512VNNI’ undeclared (first use in this function); did you mean ‘bit_AVX512VBMI’?
    if (ecx & bit_AVX512VNNI)
              ^~~~~~~~~~~~~~
              bit_AVX512VBMI
../../../../../src/gcc-9.3.0/libgcc/config/i386/cpuinfo.c:380:14: error: ‘bit_AVX512BITALG’ undeclared (first use in this function); did you mean ‘bit_AVX5124FMAPS’?
    if (ecx & bit_AVX512BITALG)
              ^~~~~~~~~~~~~~~~
              bit_AVX5124FMAPS
../../../../../src/gcc-9.3.0/libgcc/static-object.mk:17: recipe for target 'cpuinfo.o' failed
make[3]: *** [cpuinfo.o] Error 1

ATM I have no ideas why...

cmd line was used: ./build --mode=gcc-9.3.0 --arch=x86_64 --jobs=4 --rt-version=v7 --exceptions=seh --no-multilib --static-gcc --enable-languages=c,c++

tested on ubuntu 18.04 using MinGW-W64 cross-compiler provided by distro.

@Furniel maybe you have the time and desire to continue this ;)

ghost commented 2 years ago

@niXman Is there any progress? I'm a pkgsrc user and I have built this cross compiler many times. I'm sure this is possible. Please have a look at this, maybe you could learn something: https://pkgsrc.se/cross/mingw-w64 The drawback of pkgsrc is it's overly complex, if you could get your scripts working then I definitely prefer yours from pkgsrc.

eko5624 commented 1 year ago

Is cross-compile available here now? I can cross-compile gcc with posix thread. LINK here: https://github.com/eko5624/toolchain-test/discussions/6#discussion-5289277

But I tried to cross-compile gcc with mcf, something is wrong.
LINK here: https://github.com/eko5624/toolchain-test/discussions/5#discussioncomment-6144234 Any suggestions?