Skip to content
Snippets Groups Projects
Commit f8ee0abc authored by Vivek Das Mohapatra's avatar Vivek Das Mohapatra
Browse files

gen-stublib.sh: Include the major version of the proxied library

When searching the ld cache, calling dlopen etc we cannot assume
that there will be a libfoo.so linkk - or that it will point to
the right major version of the library. Always search for an explcit
libfoo.so.X target.

Value of X is automatically parsed from the arguments to libtool.

X defaults to 0.
parent 2d0fb6f1
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -73,7 +73,7 @@ include disabled.mk ...@@ -73,7 +73,7 @@ include disabled.mk
# explicitly depend on the generators and .excluded and .shared metafiles # explicitly depend on the generators and .excluded and .shared metafiles
# depend on the .dlopen file IFF it exists # depend on the .dlopen file IFF it exists
shim/lib%.so.c: generate-stublib.sh print-libstubs capsule-shim.h shim/lib%.so.c.* shim/lib%.so.c: generate-stublib.sh print-libstubs capsule-shim.h shim/lib%.so.c.*
$(GENSTUB)$(top_srcdir)/$< $$(basename $@ .c) $@.excluded $@.shared $@ $(GENSTUB)$(top_srcdir)/$< $$(basename $@ .c) $@.excluded $@.shared $@ "$(lib$(*)_la_LDFLAGS)";
debug: debug:
@echo srcs : $(shim_srcs) @echo srcs : $(shim_srcs)
......
...@@ -20,6 +20,18 @@ ...@@ -20,6 +20,18 @@
set -u set -u
set -e set -e
major_version=0;
parse_ldflags ()
{
while [ $# -ge 2 ] && [ "$1" != -version-number ]; do shift; done;
if [ $# -ge 2 ] && [ "$1" = -version-number ] && [ -n "$2" ];
then
major_version=${2%%:*};
fi
}
declare -A NODE; declare -A NODE;
top=$(dirname $0); top=$(dirname $0);
top=${top:-.}; top=${top:-.};
...@@ -28,9 +40,16 @@ proxied_dso=$1; shift; ...@@ -28,9 +40,16 @@ proxied_dso=$1; shift;
proxy_excluded=$1; shift; proxy_excluded=$1; shift;
proxy_extra=$1; shift; proxy_extra=$1; shift;
proxy_src=$1; shift; proxy_src=$1; shift;
ldflags=$1; shift;
parse_ldflags $ldflags;
proxied_dso=${proxied_dso%.so*}.so.${major_version};
symbol_file=${proxy_src%.c}.symbols; symbol_file=${proxy_src%.c}.symbols;
map_file=${proxy_src%.c}.map; map_file=${proxy_src%.c}.map;
dlopen_file=${proxy_src}.dlopen; dlopen_file=${proxy_src}.dlopen;
echo -n > $symbol_file; echo -n > $symbol_file;
echo -n > $map_file; echo -n > $map_file;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment