diff --git a/compiler/cgen.v b/compiler/cgen.v index dfc3e7713a..6491113509 100644 --- a/compiler/cgen.v +++ b/compiler/cgen.v @@ -241,7 +241,7 @@ fn build_thirdparty_obj_file(flag string) { } } cc := if os.user_os() == 'windows' { 'gcc' } else { 'cc' } // TODO clang support on Windows - res := os.exec('$cc -c -o $obj_path $cfiles') + res := os.exec('$cc -fPIC -c -o $obj_path $cfiles') println(res) } diff --git a/examples/hot_code_reloading/bounce.v b/examples/hot_code_reloading/bounce.v index 051d1b6380..f4a0bd8c03 100644 --- a/examples/hot_code_reloading/bounce.v +++ b/examples/hot_code_reloading/bounce.v @@ -1,5 +1,5 @@ // Build this example with -// v -live bounce.v +// v -live -sanitize bounce.v module main import gx @@ -64,7 +64,7 @@ const ( W = 50 ) -//[live] TODO segfaults +[live] fn (ctx &Game) draw() { ctx.vg.draw_rect(ctx.x, ctx.y, W, W, gx.rgb(0, 0, 255)) }