MinGW build error: ‘ifunc’ is not supported on this target
Steps to reproduce
- Compile GTK for x86_64-w64-mingw32 using the MinGW toolchain provided by Arch Linux.
Current behavior
[147/1453] Compiling C object gsk/libgsk.a.p/ngl_fp16.c.obj
FAILED: gsk/libgsk.a.p/ngl_fp16.c.obj
x86_64-w64-mingw32-gcc -Igsk/libgsk.a.p -Igsk -I../gsk -I. -I.. -I../gdk/x11 -Igdk -I../gdk -Igtk/css -I/usr/x86_64-w64-mingw32/include/graphene-1.0 -I/usr/x86_64-w64-mingw32/lib/graphene-1.0/include -I/usr/x86_64-w64-mingw32/include -I/usr/x86_64-w64-mingw32/include/glib-2.0 -I/usr/x86_64-w64-mingw32/lib/glib-2.0/include -I/usr/x86_64-w64-mingw32/include/pango-1.0 -I/usr/x86_64-w64-mingw32/include/harfbuzz -I/usr/x86_64-w64-mingw32/include/freetype2 -I/usr/x86_64-w64-mingw32/include/fribidi -I/usr/x86_64-w64-mingw32/include/cairo -I/usr/x86_64-w64-mingw32/include/pixman-1 -I/usr/x86_64-w64-mingw32/include/libpng16 -I/usr/x86_64-w64-mingw32/include/gdk-pixbuf-2.0 -I/usr/x86_64-w64-mingw32/include/gio-win32-2.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O3 -DG_LOG_USE_STRUCTURED=1 -DGLIB_DISABLE_DEPRECATION_WARNINGS '-DGTK_VERSION="4.4.0"' -D_GNU_SOURCE -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT -mstackrealign -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fcf-protection -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mfpmath=sse -msse -msse2 -mms-bitfields -DGTK_COMPILATION '-DG_LOG_DOMAIN="Gsk"' -DG_LOG_STRUCTURED=1 -fno-strict-aliasing -Wno-missing-include-dirs -Wduplicated-branches -Wduplicated-cond -Wformat=2 -Wformat-nonliteral -Wformat-security -Wignored-qualifiers -Wimplicit-function-declaration -Wlogical-op -Wmisleading-indentation -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wuninitialized -Wunused -Werror=address -Werror=array-bounds -Werror=empty-body -Werror=implicit -Werror=implicit-fallthrough -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=missing-declarations -Werror=missing-prototypes -Werror=nonnull -Werror=pointer-to-int-cast -Werror=redundant-decls -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=vla -Werror=write-strings -Wcast-align -fvisibility=hidden -MD -MQ gsk/libgsk.a.p/ngl_fp16.c.obj -MF gsk/libgsk.a.p/ngl_fp16.c.obj.d -o gsk/libgsk.a.p/ngl_fp16.c.obj -c ../gsk/ngl/fp16.c
../gsk/ngl/fp16.c:127:6: error: ‘ifunc’ is not supported on this target
127 | void float_to_half4 (const float f[4], guint16 h[4]) __attribute__((ifunc ("resolve_float_to_half4")));
| ^~~~~~~~~~~~~~
../gsk/ngl/fp16.c:128:6: error: ‘ifunc’ is not supported on this target
128 | void half_to_float4 (const guint16 h[4], float f[4]) __attribute__((ifunc ("resolve_half_to_float4")));
| ^~~~~~~~~~~~~~
Expected outcome
If f16c
feature is supported on Windows, the build should succeed.
If f16c
feature isn't supported on Windows, the build should fail at the configure step and ask the user to disable it.
Version information
GTK 4.4.0