Date: Wed, 9 Sep 1998 23:57:51 -0700 (PDT) From: asami@cs.berkeley.edu (Satoshi Asami) To: ports@FreeBSD.ORG Cc: committers@FreeBSD.ORG, current@FreeBSD.ORG Subject: ELF transition for ports Message-ID: <199809100657.XAA10293@silvia.hip.berkeley.edu>
next in thread | raw e-mail | index | archive | help
Hello everyone, Here is the guidelines for converting ports to ELF, and to use ports in the post-ELF world. You will need the latest bsd.port.mk (1.287 or 1.227.2.51) to use the converted ports. (Note that -stable users should also get the new bsd.port.mk if you want to use the latest ports.) Please be patient while we fix the ports tree to work on both a.out and ELF. Please report any breakages to the ports list. Thanks. Satoshi (and the great ELF team) ------- (1) Aout libraries should be moved out of /usr/local/lib and friends to an "aout" subdirectory. If you don't move them out of the way, elf ports will happily overwrite aout libraries. The "move-aout-libs" target in the -current src/Makefile (called from "aout-to-elf") will do this for you. It will only move aout libs so it is safe to call it on a system with both elf and aout libs in the standard directories. (2) The ports tree will build packages in the format the machine is in. This means aout for 2.2-stable and aout or elf for 3.0-current depending on what `objformat` returns. Also, once users convert to elf with (1) (i.e., move aout libraries to a subdirectory), building aout libraries will be unsupported. (It may still work if they know what they are doing, but they are on their own.) (3) bsd.port.mk will set PORTOBJFORMAT to "aout" or "elf" and export it in the environments CONFIGURE_ENV and MAKE_ENV. (It's always going to be "aout" in -stable). It is also passed to PLIST_SUB as "PORTOBJFORMAT=${PORTOBJFORMAT}". (See (6) below.) The variable is set using this line: PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout Ports' make processes are patched to use this variable to decide what to do. In particular, there shall be no minor number in an elf lib. Also, assuming "cc -shared" is used rather than "ld" directly, the only difference is that they need to add "-Wl,-soname,foo.so.3" on the command line. Also, they will have to install a symlink "libfoo.so" -> "libfoo.so.3". (4) For aout libs, all minor numbers shall be zero. That means many ports (those with a non-zero minor) will have to have their major number bumped by one. There seem to be about 80 of them that need to be fixed: ## grep 'lib.*\.so\..*\..*' */*/pkg/PLIST > t ## cat t | sed -e 's/:.*//' | uniq | wc 143 143 3622 ## grep -v '\.0$' t | sed -e 's/:.*//' | uniq | wc 80 80 2019 ^^ (These are the ones that don't end with ".0".) All port Makefiles are edited to remove minor numbers from LIB_DEPENDS, and also to have the regexp support removed. (E.g., "foo\\.1\\.\\(33|40\\)" -> "foo.2". They will be matched using "grep -wF". (5) pkg/PLIST should contain the short (elf) shlib names. bsd.port.mk will add ".0" to the end of shlib lines if PORTOBJFORMAT==aout in generate-plist. (6) The ldconfig line in Makefiles should read: ${SETENV} OBJFORMAT=${PORTOBJFORMAT} /sbin/ldconfig -m .... and in pkg/PLIST: @exec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -m ... @unexec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -R 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?199809100657.XAA10293>