tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: nvi on MacOS

When an executable is built with all its dependent dynamic shared
   libraries, it is typically stripped with:
          % strip -u -r executable
which saves all undefined symbols (usually defined in the dynamic shared libraries) and all global symbols defined in the executable ref- erenced by the dynamic libraries (as marked by the static link editor when the executable was built). This is the maximum level of striping for an executable that will still allow the program to run correctly
   with its libraries.

On Feb 5, 2008, at 7:25 AM, Simon Burge wrote:

Chris Wareham wrote:

Simon Burge said on 5/2/08 02:32:
With editors/nvi (from pkgsrc-2007Q4) on MacOS 10.5.1 I get the

        mini:pkgsrc/editors/nvi 83% nvi
        dyld: Symbol not found: ___global_list
          Referenced from: /Volumes/NetBSD/pkg/lib/libvi.0.dylib
          Expected in: flat namespace

        Trace/BPT trap
        Exit 133

If I remove the strip option from the install command (or run nvi
directly from the work directory), nvi then appears to work normally.

Is the following an acceptable patch to fix this?

Index: Makefile
RCS file: /cvsroot/pkgsrc/editors/nvi/Makefile,v
retrieving revision 1.26
diff -d -p -u -r1.26 Makefile
--- Makefile    3 Nov 2007 13:23:53 -0000       1.26
+++ Makefile    5 Feb 2008 02:27:56 -0000
@@ -27,6 +27,7 @@ CONFIGURE_ENV+=               vi_cv_include_sys_selec
.elif ${OPSYS} == "Darwin"
CONFIGURE_ENV+=         vi_cv_sys5_pty=no
LDFLAGS+=               -flat_namespace

WRKSRC=                 ${WRKDIR}/${DISTNAME}/build.unix

Your problem with nvi sounds very similar to one I encountered yesterday with PostgreSQL 8.3. Strip is dangerous on Mac OS X (at least from 10.4
onwards) as it removes undefined symbols from shared libraries. I got
bitten by this trying to install PostgreSQL using "install-strip", and
ended up with complaints about missing symbols when I tried to
initialise the database. The details of the problem can be found here,
along with a possible solution:

I've confirmed that "strip -x" works for nvi as well.  Does this mean
the correct fix is to use "-x" instead of "-s" in the _STRIPFLAG_INSTALL
line in mk/platform/  Or even to never strip on MacOS?

Sizewise there's not much difference between unstripped, -s and -x:

-rwxr-xr-x  1 simonb  staff  34528 Feb  5 10:50 nvi*
-rwxr-xr-x  1 simonb  wheel  33060 Feb  5 13:28 nvis*
-rwxr-xr-x  1 simonb  wheel  33980 Feb  5 21:41 nvix*

but it looks like a good chunk of the code ended up in some funny
"dylib" file in .../pkg/lib.


William J. Coldwell (Cryo)
Custodial Engineer
Warped Communications, Inc.

Attachment: PGP.sig
Description: PGP signature

Home | Main Index | Thread Index | Old Index