Jacek Caban (@jacek) commented about configure.ac:
AS_VAR_SET([${wine_arch}_DEBUG],[$wine_crossdebug])
test "x$enable_werror" != xyes || WINE_TRY_PE_CFLAGS([-Werror]) - test "x$enable_build_id" != xyes || WINE_TRY_PE_CFLAGS([-Wl,--build-id], - [AS_VAR_APPEND([${wine_arch}_CFLAGS],[" -Wl,--build-id"]) - AS_VAR_APPEND([${wine_arch}_LDFLAGS],[" -Wl,--build-id"])]) + if test "x$enable_build_id" = "xyes" + then + dnl gcc/mingw + WINE_TRY_PE_CFLAGS([-Wl,--build-id], [AS_VAR_APPEND([${wine_arch}_LDFLAGS],[" -Wl,--build-id"])]) + dnl clang + WINE_TRY_PE_CFLAGS([-Wl,-build-id], [AS_VAR_APPEND([${wine_arch}_LDFLAGS],[" -Wl,--build-id"])])
With that logic in `winegcc`, I think we could skip `WINE_TRY_PE_CFLAGS` and just append to `*_LDFLAGS` unconditionally. It means that if the toolchain is not capable of adding handling it, the compilation will fail, but that seems justified for a feature that need to be explicitly enabled (and we can revisit that if we decide to change it changes; toolchains lacking it are mostly theoretical anyway). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6922#note_89427