Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Nov 2002 00:06:54 -0500 (EST)
From:      Mikhail Teterin <mi@corbulon.video-collage.com>
To:        stable@FreeBSD.org
Subject:   A workaround for the missing __stderrp?
Message-ID:  <200211180506.gAI56skX071027@corbulon.video-collage.com>

next in thread | raw e-mail | index | archive | help
For the record :-) In case someone will be Google-ing to solve this
kind of trouble.

The following helped me get the Applix running again:

	% cat stdiocompat.c
	extern struct FILE * __sF[];
	struct FILE *__stderrp;

	static void
	stdiocompat(void)
	{
		__stderrp = __sF[2];
	}
	% make SHLIB_NAME=libapplix-stdiocompat.so.1 SRCS=stdiocompat.c \
	    -f /usr/share/mk/bsd.lib.mk -dl LDADD="-Wl,-init,stdiocompat"
	% echo mv libapplix-stdiocompat.so.1 /opt/lib | su
	% cat /opt/bin/applix 
	#!/bin/sh
	APPLIX_HOME="/opt/applix"
	LD_PRELOAD="libapplix-extralib.so.1:libapplix-stdiocompat.so.1"
	export APPLIX_HOME LD_PRELOAD
	exec $APPLIX_HOME/applix "$@"

The libapplix-extralib.so.1 contains similar wrappers for the getresuid()
and getresuid(), which is now contained in libc, but was not in the
libc.so.3. Someday I'll put them into one .so :-) Note, that I'm not
even sure, the stdiocompat() is invoked by the rtld, or it is just content
with finding a symbol named __stderrp. Thankfully, applix does not seem
to cause libm to complaint to stderr :-)

This is, of course, awfully hackish and is needed, because GTk is not
linked into the Applix staticly. The hack allows to use a recent GTk
(gtk-1.2.10_8 at the moment) -- and _share it with other_ applications.
Yes, I am aware, that some things may continue to not work in a subtle
manner, but for now it works, and my dad can enter his numbers into the
spreadsheets...

Can The Right Way(TM), please, be introduced? Is not it ridiculous,
that we can run the Linux binaries, but not our own -- of earlier
revisions?

	-mi

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211180506.gAI56skX071027>