issue with inconsistency between SSE(2) passed to different parts of Mesa code
LTO seems to discovers some inconsistency between C and CPP (?). Linking on x86 (Alpine) with LTO enabled (link)
ninja: job failed: g++ -o src/gallium/targets/va/libgallium_drv_video.so src/gallium/targets/va/libgallium_drv_video.so.p/target.c.o -flto -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libgallium_drv_video.so -Wl,--whole-archive src/gallium/frontends/va/libva_st.a -Wl,--no-whole-archive -Wl,--as-needed,-O1,--sort-common -Os -fomit-frame-pointer -g -O2 -g1 -Os -fomit-frame-pointer -O2 -g1 src/gallium/auxiliary/libgalliumvlwinsys.a src/util/libmesa_util.a src/util/format/libmesa_format.a src/util/libmesa_util_sse41.a src/c11/impl/libmesa_util_c11.a src/gallium/auxiliary/libgalliumvl.a src/gallium/auxiliary/libgallium.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/gallium/auxiliary/pipe-loader/libpipe_loader_static.a src/loader/libloader.a src/util/libxmlconfig.a src/gallium/winsys/sw/null/libws_null.a src/gallium/winsys/sw/wrapper/libwsw.a src/gallium/winsys/sw/dri/libswdri.a src/gallium/winsys/sw/kms-dri/libswkmsdri.a src/gallium/drivers/r600/libr600.a src/mesa/libmesa.a src/compiler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a src/mesa/libmesa_sse41.a src/gallium/winsys/radeon/drm/libradeonwinsys.a src/gallium/drivers/radeonsi/libradeonsi_gfx6.a src/gallium/drivers/radeonsi/libradeonsi_gfx7.a src/gallium/drivers/radeonsi/libradeonsi_gfx8.a src/gallium/drivers/radeonsi/libradeonsi_gfx9.a src/gallium/drivers/radeonsi/libradeonsi_gfx10.a src/gallium/drivers/radeonsi/libradeonsi_gfx103.a src/gallium/drivers/radeonsi/libradeonsi_gfx11.a src/gallium/drivers/radeonsi/libradeonsi.a src/gallium/winsys/amdgpu/drm/libamdgpuwinsys.a src/amd/addrlib/libaddrlib.a src/amd/common/libamd_common.a src/amd/llvm/libamd_common_llvm.a src/gallium/winsys/nouveau/drm/libnouveauwinsys.a src/nouveau/codegen/libnouveau_codegen.a src/gallium/drivers/nouveau/libnouveau.a src/gallium/drivers/virgl/libvirgl.a src/gallium/winsys/virgl/drm/libvirgldrm.a src/gallium/winsys/virgl/common/libvirglcommon.a src/gallium/winsys/virgl/vtest/libvirglvtest.a -Wl,--version-script /home/pmos/build/src/mesa-22.3.4/src/gallium/targets/va/va.sym -Wl,--gc-sections /usr/lib/libdrm.so /lib/libz.so -pthread -lm /usr/lib/libxcb-sync.so /usr/lib/libxcb-present.so /usr/lib/libxshmfence.so /usr/lib/libxcb-xfixes.so /usr/lib/libxcb-dri3.so /usr/lib/libzstd.so -L/usr/lib/llvm15/lib -lLLVM-15 /usr/lib/libexpat.so /usr/lib/libdrm_radeon.so /usr/lib/libelf.so -L/usr/lib/llvm15/lib -lLLVM-15 -L/usr/lib/llvm15/lib -lLLVM-15 -L/usr/lib/llvm15/lib -lLLVM-15 -L/usr/lib/llvm15/lib -lLLVM-15 -L/usr/lib/llvm15/lib -lLLVM-15 -L/usr/lib/llvm15/lib -lLLVM-15 -L/usr/lib/llvm15/lib -lLLVM-15 -L/usr/lib/llvm15/lib -lLLVM-15 -L/usr/lib/llvm15/lib -lLLVM-15 -L/usr/lib/llvm15/lib -lLLVM-15 /usr/lib/libdrm_amdgpu.so -L/usr/lib/llvm15/lib -lLLVM-15 /usr/lib/libdrm_nouveau.so /usr/lib/libX11-xcb.so /usr/lib/libX11.so /usr/lib/libxcb.so /usr/lib/libxcb-dri2.so -Wl,--end-group
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_float' at ../src/compiler/nir/nir_builder.h:242:27,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_alu.cpp:113:27:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_float' at ../src/compiler/nir/nir_builder.h:242:27,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_alu.cpp:113:27:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_float' at ../src/compiler/nir/nir_builder.h:242:27,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_alu.cpp:121:20:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_float' at ../src/compiler/nir/nir_builder.h:242:27,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_alu.cpp:122:20:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_float' at ../src/compiler/nir/nir_builder.h:242:27,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_alu.cpp:122:20:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_double' at ../src/compiler/nir/nir_builder.h:248:27,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp:211:31:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_double' at ../src/compiler/nir/nir_builder.h:248:27,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp:223:31:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_fmul_imm' at ../src/compiler/nir/nir_builder.h:725:19,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp:224:40:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_fmul_imm' at ../src/compiler/nir/nir_builder.h:725:19,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp:227:39:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_fmul_imm' at ../src/compiler/nir/nir_builder.h:725:19,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp:240:28:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_fmul_imm' at ../src/compiler/nir/nir_builder.h:725:19,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp:248:28:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_double' at ../src/compiler/nir/nir_builder.h:248:27,
inlined from 'split_load_const' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp:725:29,
inlined from 'lower' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp:798:30:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_float' at ../src/compiler/nir/nir_builder.h:242:27,
inlined from 'r600_nir_lower_cube_to_2darray_impl' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp:271:22:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_float' at ../src/compiler/nir/nir_builder.h:242:27,
inlined from 'r600_nir_lower_cube_to_2darray_impl' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp:280:18:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_float' at ../src/compiler/nir/nir_builder.h:242:27,
inlined from 'r600_nir_lower_cube_to_2darray_impl' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp:280:18:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_float' at ../src/compiler/nir/nir_builder.h:242:27,
inlined from 'r600_nir_lower_cube_to_2darray_impl' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_tex.cpp:285:38:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_float' at ../src/compiler/nir/nir_builder.h:242:27,
inlined from 'r600_lower_tess_coord_impl' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_tess_io.cpp:661:22:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
In function 'nir_imm_floatN_t',
inlined from 'nir_imm_float' at ../src/compiler/nir/nir_builder.h:242:27,
inlined from 'r600_lower_tess_coord_impl' at ../src/gallium/drivers/r600/sfn/sfn_nir_lower_tess_io.cpp:666:22:
../src/compiler/nir/nir_builder.h:229: error: calling 'nir_const_value_for_float' with SSE calling convention without SSE/SSE2 enabled
229 | nir_const_value v = nir_const_value_for_float(x, bit_size);
|
../src/compiler/nir/nir_builder.h:229: sorry, unimplemented: this is a GCC bug that can be worked around by adding attribute used to function called
make: *** [/tmp/ccEDjljN.mk:80: /tmp/ccBOpniP.ltrans26.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/lib/gcc/i586-alpine-linux-musl/12.2.1/../../../../i586-alpine-linux-musl/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
Tried patch:
--- a/meson.build
+++ b/meson.build
@@ -1136,6 +1136,7 @@ if host_machine.cpu_family().startswith('x86')
# __attribute__((force_align_arg_pointer)), but that's not
# always the case.
c_args += ['-msse2', '-mfpmath=sse', '-mstackrealign']
+ cpp_args += ['-msse2', '-mfpmath=sse', '-mstackrealign']
else
# GCC on x86 (not x86_64) with -msse* assumes a 16 byte aligned stack, but
# that's not guaranteed
but without success.
Edited by David Heidelberg