Opened 3 years ago

Closed 10 months ago

#64197 closed defect (fixed)

nvi @1.81.6_6 build failure: implicit declaration of function 'conv_enc'

Reported by: rdprdprdp (Richard Palmer) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: catalina bigsur monterey Cc: bK4gYuRo, srirangav (Sriranga Veeraraghavan)
Port: nvi

Description (last modified by rdprdprdp (Richard Palmer))

Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled:

/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_editors_nvi/nvi/main.log

Attachments (3)

log (287.2 KB) - added by rdprdprdp (Richard Palmer) 3 years ago.
Build log of nvi;.
Portfile (1.6 KB) - added by bK4gYuRo 17 months ago.
modified portfile
patch-configure.diff (395 bytes) - added by bK4gYuRo 17 months ago.
patch configure for Ventura

Download all attachments as: .zip

Change History (11)

Changed 3 years ago by rdprdprdp (Richard Palmer)

Attachment: log added

Build log of nvi;.

comment:1 Changed 3 years ago by rdprdprdp (Richard Palmer)

Description: modified (diff)

comment:2 Changed 3 years ago by jmroot (Joshua Root)

Keywords: catalina bigsur monterey added
Milestone: MacPorts Future
Summary: port nvi does not buildnvi @1.81.6_6 build failure: implicit declaration of function 'conv_enc'

comment:3 Changed 17 months ago by bK4gYuRo

'conv_enc' problem can be circumvented (I don't claim 'fixed') by using -Wno-implicit-function-declaration as homebrew does in its formula for nvi in https://github.com/Homebrew/homebrew-core/blob/03953b73769b91e3fe2f8bdb8291d42107eb34f6/Formula/nvi.rb

When I got past this problem, I faced another one, with linking.

Apparently, libtool needs this variable to be able to link nvi:

# Flag that allows shared libraries with undefined symbols to be built.
allow_undefined_flag="\${wl}-undefined \${wl}dynamic_lookup"

Unfortunately, configure leaves this variable unset on any macOS above 10.*:

    darwin* | rhapsody*)
      case $host_os in
        rhapsody* | darwin1.[012])
         allow_undefined_flag='${wl}-undefined ${wl}suppress'
         ;;
       *) # Darwin 1.3 on
         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
         else
           case ${MACOSX_DEPLOYMENT_TARGET} in
             10.[012])
               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
               ;;
             10.*)
               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
               ;;
           esac
         fi
         ;;
      esac

So my crude fix for Ventura was a patch for configure. Build succeeded and I got a usable (in my limited testing) binary.

I am attaching my modified portfile and patch of configure

Changed 17 months ago by bK4gYuRo

Attachment: Portfile added

modified portfile

Changed 17 months ago by bK4gYuRo

Attachment: patch-configure.diff added

patch configure for Ventura

comment:4 Changed 17 months ago by bK4gYuRo

Cc: bK4gYuRo added

comment:5 Changed 17 months ago by kencu (Ken)

Second part of that looks like a slightly different version of the libtool issue we’ve had to patch on a number of ports, eg

https://github.com/macports/macports-ports/blob/baf9f73fd0e567bd20fd55aed08a643a03f89dd7/x11/blackbox/files/dynamic_lookup-11.patch

comment:6 in reply to:  3 Changed 17 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to bK4gYuRo:

'conv_enc' problem can be circumvented (I don't claim 'fixed') by using -Wno-implicit-function-declaration as homebrew does

These errors need to be fixed properly, not suppressed; see WimplicitFunctionDeclaration.

I'll see if I can do something to fix this port.

comment:7 in reply to:  5 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

Second part of that looks like a slightly different version of the libtool issue we’ve had to patch on a number of ports, eg

https://github.com/macports/macports-ports/blob/baf9f73fd0e567bd20fd55aed08a643a03f89dd7/x11/blackbox/files/dynamic_lookup-11.patch

That's an outdated version of the patch that didn't properly handle the case where the deployment target is not set on PowerPC Mac OS X 10.3 and 10.4 (which, granted, should not occur in MacPorts, but I like using the most correct patch anyway). This is the correct current version:

https://github.com/macports/macports-ports/blob/16e3be56c3e3ea515bac7fd7f18177063564b03a/archivers/dar/files/dynamic_lookup-11.patch

Read my comments in the bug report whose URL is at the top of that patch if you want to understand its logic.

comment:8 Changed 10 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: srirangav added
Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.