Skip to content

Commit b5b739b

Browse files
build: use dynamically generated version maps
Switch to always dynamically generate version maps. As the map files get generated, no check (calling check-symbol-maps.sh) is needed on them. devtools/check-symbol-change.sh must be reimplemented. Signed-off-by: David Marchand <[email protected]>
1 parent 4ee3cf8 commit b5b739b

File tree

8 files changed

+39
-272
lines changed

8 files changed

+39
-272
lines changed

.github/workflows/build.yml

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131
failed=
3232
devtools/check-doc-vs-code.sh upstream/${{ env.REF_GIT_BRANCH }} || failed=true
3333
devtools/check-meson.py || failed=true
34-
devtools/check-symbol-maps.sh || failed=true
3534
[ -z "$failed" ]
3635
ubuntu-vm-builds:
3736
name: ${{ join(matrix.config.*, '-') }}

MAINTAINERS

-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ F: devtools/check-forbidden-tokens.awk
9696
F: devtools/check-git-log.sh
9797
F: devtools/check-spdx-tag.sh
9898
F: devtools/check-symbol-change.sh
99-
F: devtools/check-symbol-maps.sh
10099
F: devtools/checkpatches.sh
101100
F: devtools/get-maintainer.sh
102101
F: devtools/git-log-fixes.sh
@@ -165,7 +164,6 @@ M: Tyler Retzlaff <[email protected]>
165164
F: lib/eal/common/
166165
F: lib/eal/unix/
167166
F: lib/eal/include/
168-
F: lib/eal/version.map
169167
F: doc/guides/prog_guide/env_abstraction_layer.rst
170168
F: app/test/test_alarm.c
171169
F: app/test/test_atomic.c
@@ -395,7 +393,6 @@ Windows support
395393
M: Dmitry Kozlyuk <[email protected]>
396394
M: Tyler Retzlaff <[email protected]>
397395
F: lib/eal/windows/
398-
F: buildtools/map_to_win.py
399396
F: doc/guides/windows_gsg/
400397

401398
Windows memory allocation

buildtools/check-symbols.sh

-17
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,12 @@ OBJFILE=$2
77

88
ROOTDIR=$(readlink -f $(dirname $(readlink -f $0))/..)
99
LIST_SYMBOL=$ROOTDIR/buildtools/map-list-symbol.sh
10-
CHECK_SYMBOL_MAPS=$ROOTDIR/devtools/check-symbol-maps.sh
11-
12-
# added check for "make -C test/" usage
13-
if [ ! -e $MAPFILE ] || [ ! -f $OBJFILE ]
14-
then
15-
exit 0
16-
fi
17-
18-
if [ -d $MAPFILE ]
19-
then
20-
exit 0
21-
fi
22-
2310
DUMPFILE=$(mktemp -t dpdk.${0##*/}.objdump.XXXXXX)
2411
trap 'rm -f "$DUMPFILE"' EXIT
2512
objdump -t $OBJFILE >$DUMPFILE
2613

2714
ret=0
2815

29-
if ! $CHECK_SYMBOL_MAPS $MAPFILE; then
30-
ret=1
31-
fi
32-
3316
for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE |cut -d ' ' -f 3`
3417
do
3518
if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE &&

buildtools/map_to_win.py

-41
This file was deleted.

buildtools/meson.build

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ endif
1818
echo = py3 + ['-c', 'import sys; print(*sys.argv[1:])']
1919
gen_version_map = py3 + files('gen-version-map.py')
2020
list_dir_globs = py3 + files('list-dir-globs.py')
21-
map_to_win_cmd = py3 + files('map_to_win.py')
2221
sphinx_wrapper = py3 + files('call-sphinx-build.py')
2322
get_cpu_count_cmd = py3 + files('get-cpu-count.py')
2423
get_numa_count_cmd = py3 + files('get-numa-count.py')

devtools/check-symbol-maps.sh

-101
This file was deleted.

drivers/meson.build

+20-54
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ if is_ms_compiler
55
subdir_done()
66
endif
77

8-
fs = import('fs')
9-
108
# Defines the order of dependencies evaluation
119
subdirs = [
1210
'common',
@@ -260,71 +258,39 @@ foreach subpath:subdirs
260258
install: true)
261259

262260
# now build the shared driver
263-
version_map = '@0@/@1@/version.map'.format(meson.current_source_dir(), drv_path)
264-
265-
if not fs.is_file(version_map)
266-
if is_ms_linker
267-
link_mode = 'msvc'
268-
elif is_windows
269-
link_mode = 'mingw'
270-
else
271-
link_mode = 'gnu'
272-
endif
273-
version_map = custom_target(lib_name + '_map',
274-
command: [gen_version_map, link_mode, abi_version_file, '@OUTPUT@', '@INPUT@'],
275-
input: sources,
276-
output: 'lib@0@_exports.map'.format(lib_name))
277-
version_map_path = version_map.full_path()
278-
version_map_dep = [version_map]
279-
lk_deps = [version_map]
280-
281-
if is_ms_linker
282-
if is_ms_compiler
283-
lk_args = ['/def:' + version_map.full_path()]
284-
else
285-
lk_args = ['-Wl,/def:' + version_map.full_path()]
286-
endif
287-
else
288-
lk_args = ['-Wl,--version-script=' + version_map.full_path()]
289-
endif
261+
if is_ms_linker
262+
link_mode = 'msvc'
263+
elif is_windows
264+
link_mode = 'mingw'
290265
else
291-
version_map_path = version_map
292-
version_map_dep = []
293-
lk_deps = [version_map]
294-
295-
if is_windows
296-
if is_ms_linker
297-
def_file = custom_target(lib_name + '_def',
298-
command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
299-
input: version_map,
300-
output: '@0@_exports.def'.format(lib_name))
301-
lk_deps += [def_file]
302-
303-
lk_args = ['-Wl,/def:' + def_file.full_path()]
304-
else
305-
mingw_map = custom_target(lib_name + '_mingw',
306-
command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
307-
input: version_map,
308-
output: '@0@_mingw.map'.format(lib_name))
309-
lk_deps += [mingw_map]
310-
311-
lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]
312-
endif
266+
link_mode = 'gnu'
267+
endif
268+
version_map = custom_target(lib_name + '_map',
269+
command: [gen_version_map, link_mode, abi_version_file, '@OUTPUT@', '@INPUT@'],
270+
input: sources,
271+
output: 'lib@0@_exports.map'.format(lib_name))
272+
lk_deps = [version_map]
273+
274+
if is_ms_linker
275+
if is_ms_compiler
276+
lk_args = ['/def:' + version_map.full_path()]
313277
else
314-
lk_args = ['-Wl,--version-script=' + version_map]
278+
lk_args = ['-Wl,/def:' + version_map.full_path()]
315279
endif
280+
else
281+
lk_args = ['-Wl,--version-script=' + version_map.full_path()]
316282
endif
317283

318284
if not is_windows and developer_mode
319285
# on unix systems check the output of the
320286
# check-symbols.sh script, using it as a
321287
# dependency of the .so build
322288
lk_deps += custom_target(lib_name + '.sym_chk',
323-
command: [check_symbols, version_map_path, '@INPUT@'],
289+
command: [check_symbols, version_map.full_path(), '@INPUT@'],
324290
capture: true,
325291
input: static_lib,
326292
output: lib_name + '.sym_chk',
327-
depends: version_map_dep)
293+
depends: [version_map])
328294
endif
329295

330296
shared_lib = shared_library(lib_name, sources_pmd_info,

0 commit comments

Comments
 (0)