build: improve platform portability