BindBC / bindbc-sdl

Static & dynamic D bindings to SDL and the SDL_* libraries, compatible with BetterC, @nogc, and nothrow.
Boost Software License 1.0
88 stars 23 forks source link

Build error on ARM #42

Closed neilsf closed 1 year ago

neilsf commented 2 years ago

Hi

I just wanted to try this library on a Raspberry Pi 400.

  1. Created a new dub package using dub init
  2. Added bindbc-sdl as dependency
  3. Added some example code to app.d

...and i got this error when trying to run dub build:

 Fetching bindbc-loader 1.0.1 (getting selected version)...
 Fetching bindbc-sdl 1.2.1 (getting selected version)...
 Performing "debug" build using /usr/bin/gdc for arm, arm_hardfloat.
 bindbc-loader 1.0.1: building configuration "noBC"...
 bindbc-sdl 1.2.1: building configuration "dynamic"...
 ../../.dub/packages/bindbc-sdl-1.2.1/bindbc-sdl/source/bindbc/sdl/bind/sdlatomic.d:29:29: error:
 template instance atomicFence!() atomicFence is not a template declaration, it is a function
    29 | alias SDL_CompilerBarrier = atomicFence!();
       |                             ^
 /usr/bin/gdc failed with exit code 1.

Is there something I'm missing?

mdparker commented 2 years ago

I've never attempted to build any of my bindbc packages on a Pi, so it's unsurprising to see an error like this.

The error says atomicFence is not a template, but you can see in the DRuntime repo that it really is. So this suggests that the DRuntime implementation you're using on Pi differs from the main repo. I'll have a look at the GDC version of DRuntime to see how it's configured and then special case it in the binding in one form or another.

But I have to ask for your patience. I'm just coming off a three-week vacation, and I have a lot of higher priority work to get done (SAOC applications, DConf videos, meeting summaries). It may be a few days before I get to it.

ichordev commented 1 year ago

Looking at the history of GDC, about 2 years ago it used a version of Phobos where atomicFence was a function instead of a template. Have you tried this with the latest version of GDC?

neilsf commented 1 year ago

I'll try that, thanks!

neilsf commented 1 year ago

I tried with ldc2 this time and I can confirm that it works now. I'll try gdc again when I have some time later.

ichordev commented 1 year ago

Thank you for confirming that. If you get a chance to test it with a recent version of GDC I'll close this issue.

ichordev commented 1 year ago

As of 1.3.0, BindBC-SDL no longer uses atomicFence, so this issue should be alleviated.