It crashes with SIGSEGV, when -sanitize is not given. Also thirdparty/glad/glad.o should be build with -fPIC .