aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2019-09-27 14:33:35 -0400
committerXavier Claessens <xclaesse@gmail.com>2019-10-01 13:06:45 -0400
commita3153747b97512b57309e493b8b6545994d0a106 (patch)
tree86f6e696c2471d3c01c018b2f5e8b3c55ee19476 /test cases
parent19fc692b2554a03c0452001ca17d635f2445fafa (diff)
downloadmeson-a3153747b97512b57309e493b8b6545994d0a106.zip
meson-a3153747b97512b57309e493b8b6545994d0a106.tar.gz
meson-a3153747b97512b57309e493b8b6545994d0a106.tar.bz2
Do not promote to link_whole when an internal library links to another
Diffstat (limited to 'test cases')
-rw-r--r--test cases/unit/69 static link/lib/func10.c4
-rw-r--r--test cases/unit/69 static link/lib/func11.c6
-rw-r--r--test cases/unit/69 static link/lib/func12.c7
-rw-r--r--test cases/unit/69 static link/lib/meson.build15
4 files changed, 32 insertions, 0 deletions
diff --git a/test cases/unit/69 static link/lib/func10.c b/test cases/unit/69 static link/lib/func10.c
new file mode 100644
index 0000000..75a911f
--- /dev/null
+++ b/test cases/unit/69 static link/lib/func10.c
@@ -0,0 +1,4 @@
+int func10()
+{
+ return 1;
+}
diff --git a/test cases/unit/69 static link/lib/func11.c b/test cases/unit/69 static link/lib/func11.c
new file mode 100644
index 0000000..1d5119b
--- /dev/null
+++ b/test cases/unit/69 static link/lib/func11.c
@@ -0,0 +1,6 @@
+int func10();
+
+int func11()
+{
+ return func10() + 1;
+}
diff --git a/test cases/unit/69 static link/lib/func12.c b/test cases/unit/69 static link/lib/func12.c
new file mode 100644
index 0000000..73db5c0
--- /dev/null
+++ b/test cases/unit/69 static link/lib/func12.c
@@ -0,0 +1,7 @@
+int func10();
+int func11();
+
+int func12()
+{
+ return func10() + func11();
+}
diff --git a/test cases/unit/69 static link/lib/meson.build b/test cases/unit/69 static link/lib/meson.build
index 309543c..85e1880 100644
--- a/test cases/unit/69 static link/lib/meson.build
+++ b/test cases/unit/69 static link/lib/meson.build
@@ -41,3 +41,18 @@ libfunc9_linkwith = static_library('func9_linkwith', 'func9.c',
libfunc9_linkwhole = static_library('func9_linkwhole', 'func9.c',
link_whole : libfunc8,
install : true)
+
+# Pattern found in mesa:
+# - libfunc11 uses func10()
+# - libfunc12 uses both func10() and func11()
+# When a shared library link_whole on libfunc12, we ensure we don't include
+# func10.c.o twice which would fail to link.
+libfunc10 = static_library('func10', 'func10.c',
+ install : false)
+libfunc11 = static_library('func11', 'func11.c',
+ link_with : libfunc10,
+ install : false)
+libfunc12 = static_library('func12', 'func12.c',
+ link_with : [libfunc10, libfunc11],
+ install : false)
+libfunc13 = shared_library('func13', link_whole : libfunc12)