Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: loadable builtins on HP-UX Date: Wed, 4 Nov 2015 09:04:45 -0500 Lines: 43 Approved: bug-bash@gnu.org Message-ID: References: <20151103214551.GI27325@eeg.ccf.org> <56394274.9050607@case.edu> <20151104050956.GW5154@vapier.lan> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1446645897 11372 208.118.235.17 (4 Nov 2015 14:04:57 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org Content-Disposition: inline In-Reply-To: <20151104050956.GW5154@vapier.lan> User-Agent: Mutt/1.4.2.3i X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 139.137.100.1 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11834 On Wed, Nov 04, 2015 at 12:09:56AM -0500, Mike Frysinger wrote: > On 03 Nov 2015 18:25, Chet Ramey wrote: > > On 11/3/15 4:45 PM, Greg Wooledge wrote: > > > bash-4.4# enable -f ./tty tty > > > bash-4.4# type -a tty > > > tty is a shell builtin > > > tty is /usr/bin/tty > > > bash-4.4# tty > > > /usr/lib/dld.sl: Unresolved symbol: reset_internal_getopt (code) from ./tty > > > /usr/lib/dld.sl: Unresolved symbol: reset_internal_getopt (code) from ./tty > > > ABORT instruction (core dumped) > > > > It looks like shared objects loaded by dlopen don't have access to the > > loading program's symbols. That might be an HP-specific option to dlopen. > > It might not, in which case you're out of luck. > > FWIW, the option on linux is -rdynamic. guess you'll (Greg) want to find > the HP-UX equivalent to that. see the configure.ac block for details. > -mike The linker option in HP-UX 11.11 is -E . For gcc to pass it along, the correct option is -Wl,-E . I'm not sure how to do it if you're using the pay-for HP C compiler. bash-4.3# rm bash bash-4.3# /usr/local/bin/make -n rm -f bash gcc -L./builtins -L./lib/readline -L./lib/readline -L./lib/glob -L./lib/tilde -L./lib/malloc -L./lib/sh -g -O2 -Wno-parentheses -Wno-format-security -o bash shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o hashlib.o mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o alias.o array.o arrayfunc.o assoc.o braces.o bracecomp.o bashhist.o bashline.o siglist.o list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o -lbuiltins -lglob -lsh -lreadline -lhistory -ltermcap -ltilde -lmalloc /usr/local/lib/libintl.sl -L/usr/local/lib /usr/local/lib/libiconv.sl /usr/local/lib/libiconv.sl -L/usr/local/lib ls -l bash size bash echo "bash last made for a hppa2.0w running hpux11.11" >.made bash-4.3# gcc -Wl,-E -L./builtins -L./lib/readline -L./lib/readline -L./lib/glob -L./lib/tilde -L./lib/malloc -L./lib/sh -g -O2 -Wno-parentheses -Wno-format-security -o bash shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o hashlib.o mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o alias.o array.o arrayfunc.o assoc.o braces.o bracecomp.o bashhist.o bashline.o siglist.o list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o -lbuiltins -lglob -lsh -lreadline -lhistory -ltermcap -ltilde -lmalloc /usr/local/lib/libintl.sl -L/usr/local/lib /usr/local/lib/libiconv.sl /usr/local/lib/libiconv.sl -L/usr/local/lib bash-4.3# ./bash bash-4.4# cd examples/loadables/ bash-4.4# enable -f ./tty tty bash-4.4# tty /dev/pts/3 I don't