fix build and added patches

Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>