Package: aom / 1.0.0-3

cmake-restrict-exported-symbols-in-share.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From: Tom Finegan <tomfinegan@google.com>
Date: Mon, 6 Aug 2018 11:53:40 -0700
X-Dgit-Generated: 1.0.0-1 d494bba3c001db562b2719966f5520c3fceea241
Subject: cmake: Restrict exported symbols in shared object builds.

Add missing local section to linker script. Also some cosmetics:
- set() -> list(APPEND) in generate_exports.cmake.
- Make the linker script more readable (indent/whitespace).

BUG=aomedia:2072

Change-Id: I96d474f5ac9a7f9a19108cb9efd2af3587c9b81e
(cherry picked from commit 7fe8cb729bf36264d47a5d5d1e1803fa2623d3c3)
[jcowgill: remove exports_test related code because v1.0.0 does not
have this]

---

--- aom-1.0.0.orig/build/cmake/exports_sources.cmake
+++ aom-1.0.0/build/cmake/exports_sources.cmake
@@ -13,14 +13,15 @@ if(AOM_BUILD_CMAKE_EXPORTS_SOURCES_CMAKE
 endif() # AOM_BUILD_CMAKE_EXPORTS_SOURCES_CMAKE_
 set(AOM_BUILD_CMAKE_EXPORTS_SOURCES_CMAKE_ 1)
 
-set(AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_com")
+list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_com")
 
 if(CONFIG_AV1_DECODER)
-  set(AOM_EXPORTS_SOURCES ${AOM_EXPORTS_SOURCES} "${AOM_ROOT}/aom/exports_dec"
-      "${AOM_ROOT}/av1/exports_dec")
+  list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_dec"
+              "${AOM_ROOT}/av1/exports_dec")
 endif()
 
 if(CONFIG_AV1_ENCODER)
-  set(AOM_EXPORTS_SOURCES ${AOM_EXPORTS_SOURCES} "${AOM_ROOT}/aom/exports_enc"
-      "${AOM_ROOT}/av1/exports_enc")
+  list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_enc"
+              "${AOM_ROOT}/av1/exports_enc")
 endif()
+
--- aom-1.0.0.orig/build/cmake/generate_exports.cmake
+++ aom-1.0.0/build/cmake/generate_exports.cmake
@@ -39,7 +39,7 @@ elseif("${AOM_TARGET_SYSTEM}" MATCHES "W
   file(WRITE "${aom_sym_file}" "LIBRARY libaom INITINSTANCE TERMINSTANCE\n"
              "DATA MULTIPLE NONSHARED\n" "EXPORTS\n")
 else()
-  file(WRITE "${aom_sym_file}" "{ global:\n")
+  file(WRITE "${aom_sym_file}" "{\nglobal:\n")
 endif()
 
 foreach(export_file ${AOM_EXPORTS_SOURCES})
@@ -51,10 +51,10 @@ endforeach()
 foreach(exported_symbol ${exported_symbols})
   string(STRIP "${exported_symbol}" exported_symbol)
   string(REGEX REPLACE "text \|data " "" "exported_symbol" "${exported_symbol}")
-  set(exported_symbol "${symbol_prefix}${exported_symbol}${symbol_suffix}")
+  set(exported_symbol "  ${symbol_prefix}${exported_symbol}${symbol_suffix}")
   file(APPEND "${aom_sym_file}" "${exported_symbol}\n")
 endforeach()
 
 if("${aom_sym_file}" MATCHES "ver$")
-  file(APPEND "${aom_sym_file}" " };")
+  file(APPEND "${aom_sym_file}" " \nlocal:\n  *;\n};")
 endif()