Commit b0bc902
Luca Toniolo
build: Filter rtapi module version scripts to defined symbols only
rtapi_app.h unconditionally declares EXPORT_SYMBOL(rtapi_app_main) and
EXPORT_SYMBOL(rtapi_app_exit), causing every module to list both names
in its generated linker version script. Modules that only implement
rtapi_app_main (e.g. hal/components/enum.c) then triggered lld's
--no-undefined-version (default since LLD 17, see LLVM D135402):
ld.lld: error: version script assignment of 'global' to symbol
'rtapi_app_exit' failed: symbol not defined
Intersect the exported-name list with the actual defined symbols from
nm -g --defined-only so the version script only mentions symbols that
are really present in the linked object. Behavior under GNU ld is
unchanged (the new list is a strict subset of the previous one), and
LLD now accepts the build without needing --undefined-version.
Fixes #3191.1 parent 568354c commit b0bc902
2 files changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1255 | 1255 | | |
1256 | 1256 | | |
1257 | 1257 | | |
1258 | | - | |
1259 | | - | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1260 | 1261 | | |
1261 | 1262 | | |
1262 | 1263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
0 commit comments