diff --git a/gn/BUILD.gn b/gn/BUILD.gn index 11ac26b8b5..3203df7fc0 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -9,6 +9,7 @@ declare_args() { extra_cflags_c = [] extra_cflags_cc = [] extra_ldflags = [] + use_PIC = true malloc = "" } @@ -88,10 +89,10 @@ config("default") { "$win_vc/Tools/MSVC/$win_toolchain_version/lib/$target_cpu", ] } else { - cflags += [ - "-fstrict-aliasing", - "-fPIC", - ] + if (use_PIC) { + cflags += [ "-fPIC" ] + } + cflags += [ "-fstrict-aliasing" ] cflags_cc += [ "-std=c++14" ] # The main idea is to slim the exported API, but these flags also improve link time on Mac. diff --git a/modules/canvaskit/compile.sh b/modules/canvaskit/compile.sh index 50c41fe8ee..303aa0c24a 100755 --- a/modules/canvaskit/compile.sh +++ b/modules/canvaskit/compile.sh @@ -162,6 +162,7 @@ echo "Compiling bitcode" is_component_build=false \ werror=true \ target_cpu=\"wasm\" \ + use_PIC=false \ \ skia_use_angle = false \ skia_use_dng_sdk=false \