From owner-freebsd-arch Mon Jan 22 10: 3:23 2001 Delivered-To: freebsd-arch@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id F2A7037B401 for ; Mon, 22 Jan 2001 10:03:03 -0800 (PST) Received: from hamlet.nectar.com (hamlet.nectar.com [10.0.1.102]) by gw.nectar.com (Postfix) with ESMTP id 4A667193E4; Mon, 22 Jan 2001 12:03:02 -0600 (CST) Received: (from nectar@localhost) by hamlet.nectar.com (8.11.1/8.9.3) id f0MI32M93719; Mon, 22 Jan 2001 12:03:02 -0600 (CST) (envelope-from nectar@spawn.nectar.com) Date: Mon, 22 Jan 2001 12:03:02 -0600 From: "Jacques A. Vidrine" To: Daniel Eischen Cc: arch@freebsd.org, jdp@polstra.com Subject: other approach for hiding names (was Re: Request For Review: libc/libc_r changes to allow -lc_r) Message-ID: <20010122120302.A93660@hamlet.nectar.com> References: <20010120153158.A88123@hamlet.nectar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from eischen@vigrid.com on Sat, Jan 20, 2001 at 05:26:26PM -0500 X-Url: http://www.nectar.com/ Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [I cc'd: jdp directly because he's the person most knowledgeable about linker issues with which I've corresponded. Hope you don't mind, John!] On Sat, Jan 20, 2001 at 05:26:26PM -0500, Daniel Eischen wrote: > Sorry, I don't think that's going to work, especially for > sigaction, flock, and kevent. These cannot be #define'd to > there underscore(_) equivalents because it would also redefine > struct sigaction, struct flock, and struct kevent. I'm beginning to think that the pre-processor is the wrong tool for the job. It can't tell a function or object declaration from other tokens. Is there somewhere in the build process that we could insert a tool that does something like the following? for each externally visible symbol: skip symbol if it is reserved (e.g. '_[A-Z_]') skip symbol if it is not on the ISO C name list [1] if the symbol is defined in this module: rename 'symbol' to '__symbol' add weak reference for 'symbol' -> '__symbol' else (the symbol is an undefined reference): rename 'symbol' to '__symbol' If we had such a thing, then we wouldn't have to phuk around with the preprocessor and maul the source tree. All there would be to maintain would be a list of symbols that we want to be left unmangled (or the converse -- I'm not sure which serves better). Cheers, -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org [1] Actually this list would probably be all ISO C names + other symbols that require special handling for threads. Or whatever. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message