Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Sep 1998 00:57:16 -0600
From:      Warner Losh <imp@village.org>
To:        asami@FreeBSD.ORG (Satoshi Asami)
Cc:        ports@FreeBSD.ORG, jdp@FreeBSD.ORG
Subject:   Re: SOCKS port inspires question... 
Message-ID:  <199809230657.AAA18463@harmony.village.org>
In-Reply-To: Your message of "Tue, 22 Sep 1998 22:56:27 PDT." <199809230556.WAA11381@silvia.hip.berkeley.edu> 
References:  <199809230556.WAA11381@silvia.hip.berkeley.edu>  

next in thread | previous in thread | raw e-mail | index | archive | help
: The guidelines are in:
: http://www.freebsd.org/~asami/elf-guidelines.txt

These guidelines say nothing about how to detect elf vs aout at
compile time, which was what I was asking about.

I could do something gross like:

.if ${PORTOBJECTFORMAT} == "elf"
	CFLAGS += -DELF_FORMAT
.else
	CFLAGS += -DAOUT_FORMAT
.endif

and test for ELF_FORMAT or AOUT_FORMAT in the code.  I was hoping for
something better, but will use that as a fallback.

In message <199809230556.WAA11381@silvia.hip.berkeley.edu> Satoshi
Asami writes: 
: I'm not sure what exactly is the problem here, but the ELF library
: should be called libfoo.so.M and the a.out version libfoo.so.M.N.
: Maybe you can use "objformat" to find out the system's version and
: just load the appropriate file (and set the path, etc.).

OK.  Right now the socks library is installed as libsocks5_sh.so, with
no version number.  That's why things are different.  It has been this
way for a very long time.  It isn't so much a library as it is a
shared object to be loaded before libc via the LD_PRELOAD mechanism.
I think that's why it doesn't have a version number on it, because a
version number would be irrelevant in all cases.

Also, objformat is insufficient because that tells the default format
of the system, and not the format of the executable you wish to run
with runsocks.

runsocks ftp prep.ai.mit.edu

should, imho, use the aout libsocks5_sh.so when `which ftp` is in
a.out format, reguardless of the output of objformat.  This is
important for legacy applications which are dynamically linked, but
which don't have socks support compiled in.  Until they are updated to
elf by the vendor, they must co-exist with the current scheme.

It sounds like I need to change the aout version of this port to
generate libsocks5_sh.so.1.0 and the elf version to generate
libsocks5_sh.so.1, rather than what is traditionally done (which is a
simple libsocks5_sh.so).  This would be enough to differentiate
between the two on a mixed system, and some smarts would need to be
added to runsocks.

Warner

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



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