make package; seems to work.
Manual testing with https://github.com/taviso/ctypes.sh/ .
Differential D3231
bash: Export symbols for "enable -f" cem on Jul 29 2015, 5:22 AM. Authored by Tags None Referenced Files
Subscribers None
Details
make package; seems to work. Manual testing with https://github.com/taviso/ctypes.sh/ .
Diff Detail
Event TimelineThis comment was removed by ehaupt. Comment Actions Can you give me a test case on how to test this? From what I can tell the dynamically linked version (shells/bash) already supports 'enable -f': $ enable -f foo enable . enable : enable [ enable alias enable bg ... while the static version (shells/bash-static) (IMO) correctly doesn't: $ enable -f foo -bash: enable: dynamic loading not available It appears to me that this is already handled correctly. Comment Actions It doesn't actually work, though, if foo references any bash-provided symbols (and plugins expect to). Here's an example extension that does not load without this patch: https://github.com/taviso/ctypes.sh I get: bash: enable: cannot open shared object /usr/local/lib/ctypes.so: /usr/local/lib/ctypes.so: Undefined symbol "list_optarg". https://github.com/taviso/ctypes.sh/pull/6 for more context. Comment Actions I've tried the example you've provided. Unfortunately I don't get the expected result: root@portjail:~/ctypes.sh # pkg info libffi binutils libffi-3.2.1 binutils-2.25.1 root@portjail:~/ctypes.sh # source /usr/local/bin/ctypes.sh -bash: enable: cannot open shared object /usr/local/lib/ctypes.so: /usr/local/lib/ctypes.so: Undefined symbol "ffi_type_pointer" can't find the ctypes.so library, run make install? root@portjail:~/ctypes.sh # ldconfig -r | grep ffi 129:-lffi.6 => /usr/local/lib/libffi.so.6 root@portjail:~/ctypes.sh # ls -l /usr/local/lib/ctypes.so -rwxr-xr-x 1 root wheel 53650 Jul 30 09:20 /usr/local/lib/ctypes.so To build/install https://github.com/taviso/ctypes.sh I had to patch the Makefile: --- Makefile.patch begins here --- diff --git a/Makefile b/Makefile index 0cc654d..ff85695 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -CFLAGS = -std=gnu99 -fPIC -O0 -ggdb3 -Wall -Wextra -fvisibility=hidden -CPPFLAGS= -Iinclude $(shell pkg-config --cflags libffi) +CFLAGS = -std=gnu99 -fPIC -O0 -ggdb3 -Wall -Wextra -fvisibility=hidden -I/usr/local/include +CPPFLAGS= -Iinclude $(shell pkg-config --cflags libffi) -I/usr/local/include UNAME = $(shell uname -s) -LDLIBS = $(shell pkg-config --libs libffi) +LDLIBS = $(shell pkg-config --libs libffi) -L/usr/local/lib PREFIX = /usr/local ifeq ($(UNAME), Linux) --- Makefile.patch ends here --- Are there any additional steps/dependencies required? Comment Actions Do you have pkgconf installed? It is needed for pkg-config invocations. For example, pkg-config --libs libffi emits: -L/usr/local/lib -lffi on my system (obviating the added -L/usr/local/lib). Comment Actions
There we go, that's what I was missing. Comment Actions Per ehaupt@, bump revision and make -Wl,-export-dynamic conditional on |