Package Details: mingw-w64-cmake 1-23.2

Git Clone URL: (read-only)
Package Base: mingw-w64-cmake
Description: CMake wrapper for MinGW (mingw-w64)
Upstream URL:
Licenses: GPL
Submitter: brcha
Maintainer: xantares
Last Packager: xantares
Votes: 48
Popularity: 0.609616
First Submitted: 2013-04-17 12:11
Last Updated: 2019-01-05 08:50

Required by (144)

Sources (3)

Latest Comments

1 2 3 4 Next › Last »

xantares commented on 2019-01-05 09:57

Martchus, I found this report regarding -fstack-protector-strong:

Does the example crash on native windows (It does not on wine) ? Maybe I can try to backport the proposed patch.

xantares commented on 2019-01-05 08:48

Good to know, although I dont know why it would crash.

I think I've got similar issues for qt applications when not stripping the .exe

I'm including your changes.

Thanks for investigating the flags and stuff.

Martchus commented on 2019-01-05 01:06

Seems I've got already punished for playing too much with the compile flags :-)

In particular -fstack-protector-strong causes the application to crash even before main() is invoked. So if you decide to follow my suggestions, don't include that flag.

But I still find it weird. When running the app compiled with that flag within WINE it does not crash. The crash is only observable under Windows. Hence I only discovered the issue quite late. The crash also does not happen with a plain application which links only against libstdc++ but not Qt or other libraries and prints "Hello world!" via std::cout.

Just out of curiosity, has anybody an explanation for this?

Martchus commented on 2018-12-22 13:57

Can you change the default flags of this package and mingw-w64-configure to match the default flags more closely?

I would certainly remove -g for the following reasons:

  • Consistency with regular flags.
  • It serves no purpose as debugging information gets stripped out unconditionally anyways.
  • Enabling debugging information leads to bigger object files and DLLs during the build. This is annoying if you want to keep build artifacts for a while around. One use case for this is speeding up rebuilds using ccache. With -g one has to choose a ridiculously big cache size to make this actually work. Another use case is keeping the actual build directory, e.g. to be able to use --repackage in case something was wrongly packaged.
  • I'm aware that using -g and -O2 at the same time is not necessarily bad. Sometimes one wants to debug optimized binaries. However, that's not the case here. At least not for me and likely not for the default user.

It would be great if the script would read the flags from a certain environment variables, e.g. MINGW_CFLAGS and MINGW_CPPFLAGS and MINGW_CXXFLAGS and only impose the defaults. Then people with extra wishes (e.g. adding -g) could do that by adjusting their makepkg.conf or specifying the variable on the makepkg invocation if it should only affect a certain package. That is how it already works for regular packages. Why limiting ourselves when building mingw-w64 packages?

I'm also aware the script currently allows to extend the flags ($mingw_c_flags $CFLAGS). However, that only works for overriding flags which have a negating counterpart. And further, this only works on package level. A user who wants specific flags would need to adjust each and every PKGBUILD to export that variable.

Of course I would also adjust mingw-w64-qt5-base and add a line similar to the regular package:
The packaging guild lines would need to be adjusted, too.

I did a few tests and it seems most of the regular defaults also work for mingw-w64. So what about the following defaults:

MINGW_CPPFLAGS="-D_FORTIFY_SOURCE=2" # that one we had previously as CFLAGS/CXXFLAGS
MINGW_CFLAGS="-O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4" # almost everything from regular packages seems applicable + -fexceptions --param=ssp-buffer-size=4
MINGW_CXXFLAGS="-O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4" # almost everything from regular packages seems applicable + -fexceptions --param=ssp-buffer-size=4
MINGW_LDFLAGS="-Wl,-O1,--sort-common,--as-needed" # the -z options are ELF specific and therefore not applicable

See my comment from 2019-01-05 why -fstack-protector-strong is not applicable.

I would keep -fexceptions --param=ssp-buffer-size=4 because we had these so far and I don't want to break anything. Maybe some peculiarities of Windows/PE require them. Especially turning on exceptions for C code might have a reason specific to the SJLJ and SEH exception handling on Windows so better keep it.

I did not include -march=x86_64/i686 and -mtune=generic because -march=x86_64/pentiumpro and -mtune=generic are present anyways. This is observable by invoking the compiler with -Q -v. Leaving that flags out avoids handling i686 and x86_64 differently. (The architectures pentiumpro and i686 should be the same.)

drakkan commented on 2018-05-11 15:12

thanks! actually meson does not allow to have wine as optdepend

xantares commented on 2018-05-11 11:22

Ok, split into mingw-w64-wine. It's a good idea to mark it as optdepend as wine is a big dependency, I only add it to package that explicitely need runtime support. xan.

drakkan commented on 2018-05-10 21:27

${_arch}-wine should be a separate package, I would like to add it as depends for mingw-w64-meson and so replace wine here

without the need to have this package as depends, thanks!

xantares commented on 2018-02-07 17:29

ok, seems good

jpcima commented on 2018-02-07 01:26

The toolchain files do not define CMAKE_SYSTEM_PROCESSOR, so this variable presents to cmake as empty and cannot do architecture checks. Can you add this definition to the toolchain files?


xantares commented on 2017-08-17 15:36

Adding wine as dependency here does not make it a runtime dependency of mingw packages as mingw-w64-cmake is never a runtime dependency.

But I agree not all packages (cgal, hdf5, ...) rely on running compile checks (try_compile, ...) that use wine.
You can also override these results but it's a pain to update (see hdf5).