Commit f28a1c8
committed
[fix][build] Hide non-exported symbols from the dependencies (#155)
### Motivation
Currently the released libraries don't hide the symbols from the
dependencies, it can be verified by the following steps on Ubuntu:
```bash
curl -O -L https://archive.apache.org/dist/pulsar/pulsar-client-cpp-3.1.0/deb-x86_64/apache-pulsar-client.deb
apt install ./apache-pulsar-client.deb
nm -D /usr/lib/libpulsar.so | grep curl
```
You will see lots of symbols from libcurl are included in
`libpulsar.so`:
```
0000000000709f50 T curl_easy_cleanup
000000000070a000 T curl_easy_duphandle
...
```
The root cause is that `-Wl,--exclude-libs,ALL` is added as the compile
option, but it should work as a link option.
### Modifications
Use `add_link_options` to add `-Wl,--exclude-libs=ALL` as the link
option. It seems that `=ALL` should be correct but `,ALL` also works.
(cherry picked from commit 3a3e973)1 parent 9350d1b commit f28a1c8
2 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments