diff options
author | Ryo Hashimoto <hashimoto@google.com> | 2021-03-12 18:58:55 +0900 |
---|---|---|
committer | Ryo Hashimoto <hashimoto@google.com> | 2021-03-18 19:44:02 +0900 |
commit | 6b06a8e25bc1761789f24ae77321ce2b0a16a186 (patch) | |
tree | 670b2008ff8484c5b755006915334d675da27b4d | |
parent | 47a91ba31472e458c9f2bb5aca387b04d1b8b4ee (diff) | |
download | pdfium-6b06a8e25bc1761789f24ae77321ce2b0a16a186.tar.gz |
Shrink pdfiumandroid-12.1.0_r9android-12.1.0_r8android-12.1.0_r7android-12.1.0_r26android-12.1.0_r25android-12.1.0_r24android-12.1.0_r23android-12.1.0_r22android-12.1.0_r21android-12.1.0_r20android-12.1.0_r19android-12.1.0_r18android-12.1.0_r17android-12.1.0_r16android-12.1.0_r15android-12.1.0_r14android-12.1.0_r13android-12.1.0_r12android-12.1.0_r11android-12.1.0_r10android-12.0.0_r32android-12.0.0_r29android-12.0.0_r28android-12.0.0_r27android-12.0.0_r26android-12.0.0_r21android-12.0.0_r20android-12.0.0_r19android-12.0.0_r18android-12.0.0_r16android12L-devandroid12L-d2-s8-releaseandroid12L-d2-s7-releaseandroid12L-d2-s6-releaseandroid12L-d2-s5-releaseandroid12L-d2-s4-releaseandroid12L-d2-s3-releaseandroid12L-d2-s2-releaseandroid12L-d2-s1-releaseandroid12L-d2-releaseandroid12-qpr3-s7-releaseandroid12-qpr3-s6-releaseandroid12-qpr3-s5-releaseandroid12-qpr3-s4-releaseandroid12-qpr3-s3-releaseandroid12-qpr3-s2-releaseandroid12-qpr3-s1-releaseandroid12-qpr3-releaseandroid12-qpr1-releaseandroid12-qpr1-d-s3-releaseandroid12-qpr1-d-s2-releaseandroid12-qpr1-d-s1-releaseandroid12-qpr1-d-releaseandroid12-dev
Explicitly export functions and enable the linker's identical code
folding optimization.
This makes libpdfium.so in /system/lib and /system/lib64 ~1MB smaller.
Also, this makes system.raw.img 870KB smaller.
Bug: 182446785
Test: build
Change-Id: I5ed403aa88110f924d1d9d1f69793511662737ee
(cherry picked from commit 94adbcf7b9134f6e49ba84b7ab5b6130c8276dec)
-rw-r--r-- | Android.bp | 12 | ||||
-rw-r--r-- | third_party/Android.bp | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp index 750884b16..4af25048f 100644 --- a/Android.bp +++ b/Android.bp @@ -55,6 +55,14 @@ cc_defaults { "-DOPJ_STATIC", "-DPNG_PREFIX", "-DPNG_USE_READ_MACROS", + + // Do not export functions by default. Export only functions annotated + // with FPDF_EXPORT. + "-fvisibility=hidden", + + // Macro definitions to enable FPDF_EXPORT. + "-DCOMPONENT_BUILD", + "-DFPDF_IMPLEMENTATION", ], arch: { @@ -143,6 +151,10 @@ cc_library_shared { "libz", ], + ldflags: [ + "-Wl,-icf=all", + ], + export_include_dirs: ["public"], } diff --git a/third_party/Android.bp b/third_party/Android.bp index 6571fb1bd..3fcb08d80 100644 --- a/third_party/Android.bp +++ b/third_party/Android.bp @@ -80,6 +80,7 @@ cc_library_static { cc_library_static { name: "libpdfium-libopenjpeg2", defaults: ["pdfium-third-party"], + visibility: ["//cts/hostsidetests/securitybulletin/securityPatch/CVE-2016-8332"], exclude_srcs: [ "libopenjpeg20/t1_generate_luts.c", |