Compile CanvasKit without -fPIC, for latest emscripten compatibility.
Due to an issue in emscripten's latest-upstream compiler (link below), Skia's libraries can't be built using -fPIC. This change allows users to opt-out of using -fPIC during compilation, and sets compile.sh to opt-out accordingly. https://github.com/emscripten-core/emscripten/issues/8995 https://github.com/emscripten-core/emscripten/issues/9317 Change-Id: I25b6e185b58ab1ba8263f2e2f450591f6025f62c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243317 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
parent
b5037ca889
commit
497365778e
@ -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.
|
||||
|
@ -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 \
|
||||
|
Loading…
Reference in New Issue
Block a user