First of all, if you're observing a crash in clBuildProgram, please report the issue here: Issues · RadeonOpenCompute/ROCm · GitHub . Actually, ROCm has a separate GitHub place to report an issue or post a query related to it.
Regarding the offline compilation, both clang and clang-ocl tools can be used. I think clang-ocl is easier to use because it requires less number of flags. Say,
>> clang-ocl simple.cl -o simple.o
or
>> clang-ocl simple.cl -mcpu=ARCH -o simple.o
Here ARCH denotes specific architecture, for example, gfx803 for Fiji or gfx900 for Vega.
Also OpenCL 2.0 specific flags might be required for compiling OpenCL 2.0 kernels. As I haven't used it myself, I can't provide the exact command or steps. Please check ROCm community for more information.
Regards,