semaphore functions in the wrong place during cross-build