From owner-freebsd-ports Tue Sep 22 23:57:15 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA22121 for freebsd-ports-outgoing; Tue, 22 Sep 1998 23:57:15 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id XAA22110; Tue, 22 Sep 1998 23:57:07 -0700 (PDT) (envelope-from imp@village.org) Received: from harmony [10.0.0.6] by rover.village.org with esmtp (Exim 1.71 #1) id 0zLirD-0000q8-00; Wed, 23 Sep 1998 00:56:59 -0600 Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.1/8.8.3) with ESMTP id AAA18463; Wed, 23 Sep 1998 00:57:16 -0600 (MDT) Message-Id: <199809230657.AAA18463@harmony.village.org> To: asami@FreeBSD.ORG (Satoshi Asami) Subject: Re: SOCKS port inspires question... Cc: ports@FreeBSD.ORG, jdp@FreeBSD.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> Date: Wed, 23 Sep 1998 00:57:16 -0600 From: Warner Losh Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org : 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