core: fix some compilation problems on SmartOS