Skip to content

Commit 41af21f

Browse files
daviesrobwhitwham
authored andcommitted
Fix htslib.map update
At some point `nm --with-symbol-versions` stopped appending `@@Base` to unversioned symbols. This broke the awk script that looked for symbols to add to the `htslib.map` file. Fix by changing the match criteria to accept symbol names with no version appended as well as `@@Base`, and make minor adjustments to how the semicolon is appended to the name in the output. Also add `--defined-only` to the `nm` command line to get rid of imported functions as they don't follow the same output format as for the symbols we want (the first column is blank). Removing them eliminates the chance that these lines could be incorrectly included.
1 parent fe1721d commit 41af21f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ $(srcprefix)htslib.map: libhts.so
952952
echo "Refusing to update $@ - HTSlib version not changed" 1>&2 ; \
953953
exit 1 ; \
954954
fi && \
955-
nm --with-symbol-versions -D -g libhts.so | awk '$$2 ~ /^[DGRT]$$/ && $$3 ~ /@@Base$$/ && $$3 !~ /^(_init|_fini|_edata)@@/ { sub(/@@Base$$/, ";", $$3); print " " $$3 }' > $@.tmp && \
955+
nm --defined-only --with-symbol-versions -D -g libhts.so | awk '$$2 ~ /^[DGRT]$$/ && ($$3 ~ /@@Base$$/ || $$3 !~ /@/) && $$3 !~ /^(_init|_fini|_edata)(@|$$)/ { sub(/@@Base$$/, "", $$3); print " " $$3 ";" }' > $@.tmp && \
956956
if [ -s $@.tmp ] ; then \
957957
cat $@ > $@.new.tmp && \
958958
printf '\n%s {\n' "HTSLIB_$$curr_vers" >> $@.new.tmp && \

0 commit comments

Comments
 (0)