nakst/gf

ARM build issues

1ndahous3 opened this issue · 5 comments

There are several issues when building on an ARM7 system (armhf) without the SSE2 instruction set.

  1. Wrap all (2) #include <xmmintrin.h> in #ifdef UI_SSE2 macro:
luigi.h:18:10: fatal error: xmmintrin.h: No such file or directory
   18 | #include <xmmintrin.h>
      |          ^~~~~~~~~~~~~
  1. Dynamic detection of SSE2 support in build.sh to define UI_SSE2 macro.
  2. Wrap all _mm* functions in #ifdef UI_SSE2 macro, write #else blocks:

    gf/luigi.h

    Lines 930 to 934 in f6694e2

    float _UISquareRootFloat(float x) {
    float result[4];
    _mm_storeu_ps(result, _mm_sqrt_ps(_mm_set_ps(0, 0, 0, x)));
    return result[0];
    }
luigi.h: In function ‘float _UISquareRootFloat(float)’:
luigi.h:936:36: error: ‘_mm_set_ps’ was not declared in this scope
  936 |  _mm_storeu_ps(result, _mm_sqrt_ps(_mm_set_ps(0, 0, 0, x)));
      |                                    ^~~~~~~~~~
luigi.h:936:24: error: ‘_mm_sqrt_ps’ was not declared in this scope
  936 |  _mm_storeu_ps(result, _mm_sqrt_ps(_mm_set_ps(0, 0, 0, x)));
      |                        ^~~~~~~~~~~
luigi.h:936:2: error: ‘_mm_storeu_ps’ was not declared in this scope
  936 |  _mm_storeu_ps(result, _mm_sqrt_ps(_mm_set_ps(0, 0, 0, x)));
      |  ^~~~~~~~~~~~~
  1. Other errors and warnings:
luigi.h: In function ‘bool _UIProcessEvent(XEvent*)’:
luigi.h:5075:60: warning: left shift count >= width of type [-Wshift-count-overflow]
 5075 |     (void *) (((uintptr_t) (event->xkey.time & 0xFFFFFFFF) << 32)
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
luigi.h:5186:114: error: cannot convert ‘uint64_t*’ {aka ‘long long unsigned int*’} to ‘long unsigned int*’
 5186 |   XGetWindowProperty(ui.display, window->window, ui.primaryID, 0, 65536, False, AnyPropertyType, &type, &format, &count, &bytesLeft, &data);
      |                                                                                                                  ^~~~~~
      |                                                                                                                  |
      |                                                                                                                  uint64_t* {aka long long unsigned int*}

luigi.h: In function ‘void UIWindowPostMessage(UIWindow*, UIMessage, void*)’:
luigi.h:5349:18: warning: right shift count >= width of type [-Wshift-count-overflow]
 5349 |  event.time = dp >> 32;
      |               ~~~^~~~~
nakst commented

Is this fixed in ca7e4c5?

Is this fixed in ca7e4c5?

All fixed except for the count type convert error in the XGetWindowProperty() call.

And the question is, can it now be compiled with a color picker without SSE2?

nakst commented

All fixed except for the count type convert error in the XGetWindowProperty() call.

Now fixed in 20cb042.

And the question is, can it now be compiled with a color picker without SSE2?

Not yet. But gf does not use the color picker, so it is not an issue. I will make the color picker work without SSE2 before merging it into the luigi library repository, though.

Now it happens with the next variable bytesLeft :D
I fixed the type locally and the debugger finally compiled.