compile with -fPIC on x64
fix constructor, global var def