EleonoreMizo / fmtconv

Format conversion tools for Vapoursynth and Avisynth+
Do What The F*ck You Want To Public License
67 stars 14 forks source link

Building using Mingw64 - gcc v9.2(rev2) fails for x64 #14

Closed pat357 closed 4 years ago

pat357 commented 4 years ago

The x86 version compiles without errors, but the x64 version gives me the following:

Using

LDFLAGS+=" -static-libgcc -static-libstdc++" \
    CFLAGS+=" -std=gnu++11 -pipe -static-libgcc" \
    CXXFLAGS="${CFLAGS} -static-libstdc++" \
    ../configure --prefix="$LOCALDESTDIR" --{host,target}="${MINGW_CHOST}"
    make -j4
    make install

Build log

17:38:36 + vs-fmtc git  ................................. [Files missing]
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf: running: /usr/bin/autoconf --force
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:8: installing './compile'
configure.ac:5: installing './missing'
Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'
configure: loading site script /mingw64/etc/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for x86_64-w64-mingw32-gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
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 whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /mingw64/bin/nm -B
checking the name lister (/mingw64/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-w64-mingw32 file names to x86_64-w64-mingw32 format... func_convert_file_msys_to_w32
checking how to convert x86_64-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
checking for H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe option to reload object files... -r
checking for x86_64-w64-mingw32-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for x86_64-w64-mingw32-dlltool... no
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for x86_64-w64-mingw32-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for x86_64-w64-mingw32-strip... strip
checking for x86_64-w64-mingw32-ranlib... no
checking for ranlib... ranlib
checking command to parse /mingw64/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for x86_64-w64-mingw32-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for x86_64-w64-mingw32-as... no
checking for as... as
checking for x86_64-w64-mingw32-dlltool... dlltool
checking for x86_64-w64-mingw32-objdump... objdump
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether we are using the GNU C++ compiler... yes
checking whether ccache g++ accepts -g... yes
checking dependency style of ccache g++... gcc3
checking how to run the C++ preprocessor... ccache g++ -E
checking for ld used by ccache g++... H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking whether the ccache g++ linker (H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking for ccache g++ option to produce PIC... -DDLL_EXPORT -DPIC
checking if ccache g++ PIC flag -DDLL_EXPORT -DPIC works... yes
checking if ccache g++ static flag -static works... yes
checking if ccache g++ supports -c -o file.o... yes
checking if ccache g++ supports -c -o file.o... (cached) yes
checking whether the ccache g++ linker (H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
  CXX      ../../src/fstb/libsse2_la-ToolsSse2.lo
  CXX      ../../src/fmtcl/libavx_la-MatrixProc_avx.lo
  CXX      ../../src/fmtcl/libavx2_la-BitBltConv_avx2.lo
  CXX      ../../src/fmtcl/libavx2_la-MatrixProc_avx2.lo
  CXX      ../../src/fmtcl/libavx2_la-Scaler_avx2.lo
  CXX      ../../src/fmtcl/libavx2_la-TransLut_avx2.lo
  CXX      ../../src/fstb/libavx2_la-ToolsAvx2.lo
  CXX      ../../src/AvstpWrapper.lo
  CXX      ../../src/main.lo
  CXX      ../../src/fmtc/Bitdepth.lo
  CXX      ../../src/fmtc/Convert.lo
  CXX      ../../src/fmtc/ConvStep.lo
In file included from ../../../src/conc/Interlocked.h:132,
                 from ../../../src/conc/AtomicPtr.hpp:27,
                 from ../../../src/conc/AtomicPtr.h:121,
                 from ../../../src/conc/CellPool.h:30,
                 from ../../../src/conc/ObjPool.h:44,
                 from ../../../src/fmtc/Bitdepth.h:30,
                 from ../../../src/main.cpp:18:
../../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
../../../src/conc/Interlocked.hpp:297:4: error: '::InterlockedCompareExchange128' has not been declared; did you mean 'InterlockedCompareExchange16'?
  297 |  ::InterlockedCompareExchange128 (
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |    InterlockedCompareExchange16
../../../src/conc/Interlocked.hpp:299:4: error: 'excg_hi' was not declared in this scope; did you mean 'excg'?
  299 |    excg_hi,
      |    ^~~~~~~
      |    excg
../../../src/conc/Interlocked.hpp:300:4: error: 'excg_lo' was not declared in this scope; did you mean 'excg'?
  300 |    excg_lo,
      |    ^~~~~~~
      |    excg
At global scope:
cc1plus.exe: warning: unrecognized command line option '-Wno-unused-private-field'
make: *** [Makefile:1206: ../../src/main.lo] Error 1
make: *** Waiting for unfinished jobs....
In file included from ../../../src/conc/Interlocked.h:132,
                 from ../../../src/conc/AtomicPtr.hpp:27,
                 from ../../../src/conc/AtomicPtr.h:121,
                 from ../../../src/conc/CellPool.h:30,
                 from ../../../src/conc/ObjPool.h:44,
                 from ../../../src/fmtc/Bitdepth.h:30,
                 from ../../../src/fmtc/Bitdepth.cpp:28:
../../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
../../../src/conc/Interlocked.hpp:297:4: error: '::InterlockedCompareExchange128' has not been declared; did you mean 'InterlockedCompareExchange16'?
  297 |  ::InterlockedCompareExchange128 (
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |    InterlockedCompareExchange16
../../../src/conc/Interlocked.hpp:299:4: error: 'excg_hi' was not declared in this scope; did you mean 'excg'?
  299 |    excg_hi,
      |    ^~~~~~~
      |    excg
../../../src/conc/Interlocked.hpp:300:4: error: 'excg_lo' was not declared in this scope; did you mean 'excg'?
  300 |    excg_lo,
      |    ^~~~~~~
      |    excg
In file included from ../../../src/conc/Interlocked.h:132,
                 from ../../../src/conc/AtomicPtr.hpp:27,
                 from ../../../src/conc/AtomicPtr.h:121,
                 from ../../../src/conc/CellPool.h:30,
                 from ../../../src/conc/ObjPool.h:44,
                 from ../../../src/fmtcl/FilterResize.h:31,
                 from ../../../src/fmtc/Resample.h:31,
                 from ../../../src/fmtc/Convert.cpp:33:
../../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
../../../src/conc/Interlocked.hpp:297:4: error: '::InterlockedCompareExchange128' has not been declared; did you mean 'InterlockedCompareExchange16'?
  297 |  ::InterlockedCompareExchange128 (
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |    InterlockedCompareExchange16
../../../src/conc/Interlocked.hpp:299:4: error: 'excg_hi' was not declared in this scope; did you mean 'excg'?
  299 |    excg_hi,
      |    ^~~~~~~
      |    excg
../../../src/conc/Interlocked.hpp:300:4: error: 'excg_lo' was not declared in this scope; did you mean 'excg'?
  300 |    excg_lo,
      |    ^~~~~~~
      |    excg
At global scope:
cc1plus.exe: warning: unrecognized command line option '-Wno-unused-private-field'
make: *** [Makefile:1206: ../../src/fmtc/Convert.lo] Error 1
At global scope:
cc1plus.exe: warning: unrecognized command line option '-Wno-unused-private-field'
make: *** [Makefile:1206: ../../src/fmtc/Bitdepth.lo] Error 1
  CXX      ../../src/main.lo
In file included from ../../../src/conc/Interlocked.h:132,
                 from ../../../src/conc/AtomicPtr.hpp:27,
                 from ../../../src/conc/AtomicPtr.h:121,
                 from ../../../src/conc/CellPool.h:30,
                 from ../../../src/conc/ObjPool.h:44,
                 from ../../../src/fmtc/Bitdepth.h:30,
                 from ../../../src/main.cpp:18:
../../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
../../../src/conc/Interlocked.hpp:297:4: error: '::InterlockedCompareExchange128' has not been declared; did you mean 'InterlockedCompareExchange16'?
  297 |  ::InterlockedCompareExchange128 (
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |    InterlockedCompareExchange16
../../../src/conc/Interlocked.hpp:299:4: error: 'excg_hi' was not declared in this scope; did you mean 'excg'?
  299 |    excg_hi,
      |    ^~~~~~~
      |    excg
../../../src/conc/Interlocked.hpp:300:4: error: 'excg_lo' was not declared in this scope; did you mean 'excg'?
  300 |    excg_lo,
      |    ^~~~~~~
      |    excg
At global scope:
cc1plus.exe: warning: unrecognized command line option '-Wno-unused-private-field'
make: *** [Makefile:1206: ../../src/main.lo] Error 1
17:40:24 + vs-fmtc-git  ........................................ [Failed]

Using this patch allows it to compile 👍 , but I'm not sure it is ok or not. Please have a look at it and let me know if it should be correct or not.

fmtc.patch.txt

EleonoreMizo commented 4 years ago

The patch works. I updated the repository, along with a few other things. Could you please tell me if it works better for you?

pat357 commented 4 years ago

It works perfectly now : not a single warning and a successful build ! Thank you very much ! I suppose I can better drop the "-std=gnu++11" in CXXFLAGS and replace it by "-std=c++17" now ?

Because you updated the MSVC toolk to v141, I suppose your builds are compiled using VS2017 and not VS2019 (=using v142) ?

EleonoreMizo commented 4 years ago

-std=c++17 is the default if supported, otherwise it falls back on -std=c++11. And yes my builds are compiled with VS2017.