In theory it should be as simple as setting it in lflags. But you will need to test it, as I'm not sure if it'll propagate upwards to where you need it. If that doesn't work, having dub automatically handle registration functions would be a nice feature request to have.