Opened 5 years ago

Last modified 2 years ago

#59637 assigned defect

babl @0.1.72+universal: error: initializing '__m128i' (vector of 2 'long long' values) with an expression of incompatible type 'int'

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: pending Cc:
Port: babl

Description

babl failed to build the i386 part of the +universal variant:

[131/184] Compiling C object 'extensions/20ef773@@sse-half@sha/sse-half.c.o'.
FAILED: extensions/20ef773@@sse-half@sha/sse-half.c.o
ccache /usr/bin/clang -Iextensions/20ef773@@sse-half@sha -Iextensions -I../babl-0.1.72-i386/extensions -I. -I../babl-0.1.72-i386/ -Ibabl -I../babl-0.1.72-i386/babl -I/opt/local/include -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -g -Ofast -Wdeclaration-after-statement -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wpointer-arith -mmmx -msse -mfpmath=sse -Os -arch i386 -msse4.1 -mf16c -MD -MQ 'extensions/20ef773@@sse-half@sha/sse-half.c.o' -MF 'extensions/20ef773@@sse-half@sha/sse-half.c.o.d' -o 'extensions/20ef773@@sse-half@sha/sse-half.c.o' -c ../babl-0.1.72-i386/extensions/sse-half.c
../babl-0.1.72-i386/extensions/sse-half.c:48:24: warning: implicit declaration of function '_mm_insert_epi64' is invalid in C99 [-Wimplicit-function-declaration]
      __m128i in_val = _mm_insert_epi64((__m128i)_mm_setzero_ps(), *s_vec++, 0);
                       ^
../babl-0.1.72-i386/extensions/sse-half.c:48:15: error: initializing '__m128i' (vector of 2 'long long' values) with an expression of incompatible type 'int'
      __m128i in_val = _mm_insert_epi64((__m128i)_mm_setzero_ps(), *s_vec++, 0);
              ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.

This wasn't a problem with babl @0.1.68.

Attachments (2)

main.log (61.1 KB) - added by ryandesign (Ryan Carsten Schmidt) 5 years ago.
main.2.log (22.5 KB) - added by ryandesign (Ryan Carsten Schmidt) 5 years ago.

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.log added

comment:1 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Now that the muniversal portgroup has been removed from this port the error has changed:

../babl-0.1.72/babl/babl-extension.c:201:3: error: use of undeclared identifier 'HLIB'
  HLIB  dl_handle = NULL;
  ^
../babl-0.1.72/babl/babl-extension.c:206:3: error: use of undeclared identifier 'dl_handle'
  dl_handle = dlopen (path, RTLD_NOW);
  ^
../babl-0.1.72/babl/babl-extension.c:206:15: warning: implicit declaration of function 'dlopen' is invalid in C99 [-Wimplicit-function-declaration]
  dl_handle = dlopen (path, RTLD_NOW);
              ^
../babl-0.1.72/babl/babl-extension.c:207:8: error: use of undeclared identifier 'dl_handle'
  if (!dl_handle)
       ^
../babl-0.1.72/babl/babl-extension.c:209:43: warning: implicit declaration of function 'dlerror' is invalid in C99 [-Wimplicit-function-declaration]
      babl_log ("dlopen() failed:\n\t%s", dlerror ());
                                          ^
../babl-0.1.72/babl/babl-extension.c:212:34: warning: implicit declaration of function 'dlsym' is invalid in C99 [-Wimplicit-function-declaration]
  init = (BablExtensionInitFunc) dlsym (dl_handle, "init");
                                 ^
../babl-0.1.72/babl/babl-extension.c:212:41: error: use of undeclared identifier 'dl_handle'
  init = (BablExtensionInitFunc) dlsym (dl_handle, "init");
                                        ^
../babl-0.1.72/babl/babl-extension.c:216:7: warning: implicit declaration of function 'dlclose' is invalid in C99 [-Wimplicit-function-declaration]
      dlclose (dl_handle);
      ^
../babl-0.1.72/babl/babl-extension.c:216:16: error: use of undeclared identifier 'dl_handle'
      dlclose (dl_handle);
               ^
../babl-0.1.72/babl/babl-extension.c:220:47: error: use of undeclared identifier 'dl_handle'
  destroy = (BablExtensionDestroyFunc) dlsym (dl_handle, "destroy");
                                              ^
../babl-0.1.72/babl/babl-extension.c:222:28: error: use of undeclared identifier 'dl_handle'
                           dl_handle,
                           ^
../babl-0.1.72/babl/babl-extension.c:229:16: error: use of undeclared identifier 'dl_handle'
      dlclose (dl_handle);
               ^
4 warnings and 8 errors generated.

Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.2.log added

comment:2 Changed 5 years ago by kencu (Ken)

I did get it to build i386 on Leopard, with some shenanigans:

$ port -v installed babl
The following ports are currently installed:
  babl @0.1.68_0 platform='darwin 9' archs='i386' date='2019-08-16T20:38:53-0700'
  babl @0.1.72_0 (active) platform='darwin 9' archs='i386' date='2019-11-09T14:44:25-0800'

on Leopard, I needed a newer linker (ld64-236) which was a minor project, and then it built with clang-7.0 against libc++.

comment:3 Changed 5 years ago by dbevans (David B. Evans)

This problem seems to be similar to the (non universal) build failure on 10.10.

FAILED: extensions/20ef773@@sse-half@sha/sse-half.c.o 
/usr/bin/clang -Iextensions/20ef773@@sse-half@sha -Iextensions -I../babl-0.1.72/extensions -I. -I../babl-0.1.72/ -Ibabl -I../babl-0.1.72/babl -I/opt/local/include -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -g -Ofast -Wdeclaration-after-statement -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wpointer-arith -mmmx -msse -mfpmath=sse -Os -arch x86_64 -msse4.1 -mf16c -MD -MQ 'extensions/20ef773@@sse-half@sha/sse-half.c.o' -MF 'extensions/20ef773@@sse-half@sha/sse-half.c.o.d' -o 'extensions/20ef773@@sse-half@sha/sse-half.c.o' -c ../babl-0.1.72/extensions/sse-half.c
../babl-0.1.72/extensions/sse-half.c:49:32: warning: implicit declaration of function '_mm_cvtph_ps' is invalid in C99 [-Wimplicit-function-declaration]
      __v4sf out_val = (__v4sf)_mm_cvtph_ps(in_val);
                               ^
../babl-0.1.72/extensions/sse-half.c:49:24: error: invalid conversion between vector type '__v4sf' (vector of 4 'float' values) and integer type 'int' of different size
      __v4sf out_val = (__v4sf)_mm_cvtph_ps(in_val);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../babl-0.1.72/extensions/sse-half.c:60:24: error: invalid conversion between vector type '__v4sf' (vector of 4 'float' values) and integer type 'int' of different size
      __v4sf out_val = (__v4sf)_mm_cvtph_ps(in_val);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../babl-0.1.72/extensions/sse-half.c:110:25: warning: implicit declaration of function '_mm_cvtps_ph' is invalid in C99 [-Wimplicit-function-declaration]
      __m128i out_val = _mm_cvtps_ph(in_val, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
                        ^
../babl-0.1.72/extensions/sse-half.c:110:15: error: initializing '__m128i' (vector of 2 'long long' values) with an expression of incompatible type 'int'
      __m128i out_val = _mm_cvtps_ph(in_val, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
              ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../babl-0.1.72/extensions/sse-half.c:121:15: error: initializing '__m128i' (vector of 2 'long long' values) with an expression of incompatible type 'int'
      __m128i out_val = _mm_cvtps_ph(in_val, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
 

Looks like, specifically, the sse-half babl extension is using newer SSE compiler instructions that are not recognized on older compilers. A similar problem was found in graphene. Trying a tentative fix for 10.10 ([2071cbdb2d77350462172f62bddf68f6e380aaed/macports-ports]) and looking into this in more detail.

@ryandesign: on which platform, compiler did your reported errors appear?

Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

As you can see in my log, this was on High Sierra with the clang from Xcode 9.4.1.

Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:5 in reply to:  1 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

../babl-0.1.72/babl/babl-extension.c:201:3: error: use of undeclared identifier 'HLIB'
  HLIB  dl_handle = NULL;
  ^

The problem remains. Just to make sure it's clear, the problem only exists when building universal; no problem when building for only x86_64.

comment:6 Changed 5 years ago by kencu (Ken)

babl is a moving target. I think it probably needs the muniversal PG again, but at any rate, on 10.5 Leopard i386, adding this incantation made it build

if {${build_arch} eq "i386"} {
    configure.args-append -Denable-f16c=false
}

no promises as to whether that is the most elegant solution, but I'm thinking that this command has no business in a 32bit build:

../babl-0.1.72-i386/extensions/sse-half.c:48:24: warning: implicit declaration of function '_mm_insert_epi64' is invalid in C99 [-Wimplicit-function-declaration]
      __m128i in_val = _mm_insert_epi64(

comment:7 Changed 5 years ago by kencu (Ken)

yeah, babl is misconfiguring. That file is supposed to be blocked off when building 32bit <https://gitlab.gnome.org/GNOME/babl/blob/30cf039d8f7c0523853fc496a093c7bea4a7fc61/extensions/sse-half.c> but it isn't due to (probably) the ARCH_X86_64 macro being defined when it shouldn't be defined.

comment:8 Changed 3 years ago by mascguy (Christopher Nielsen)

Owner: changed from dbevans to mascguy

Reassign babl-related tickets to me

comment:9 Changed 2 years ago by mascguy (Christopher Nielsen)

Keywords: pending added
Note: See TracTickets for help on using tickets.