[MacPorts] #51451: gnutls @3.4.12: build fails on 10.6, undefined symbol strndup.

MacPorts noreply at macports.org
Sat May 28 05:50:41 PDT 2016


#51451: gnutls @3.4.12: build fails on 10.6, undefined symbol strndup.
-----------------------+----------------------
  Reporter:  devans@…  |      Owner:  mps@…
      Type:  defect    |     Status:  reopened
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  gnutls    |
-----------------------+----------------------

Comment (by help@…):

 Compilation is broken on OSX 10.10 when macosx_deployment_target is set to
 10.6 (reason being weak-linking):
 {{{
 :info:build pkcs11/pkcs11-mock.c:29:15: error: static declaration of
 'strndup' follows non-static declaration
 :info:build static char * strndup (char const *s, size_t n);
 :info:build               ^
 :info:build /usr/include/string.h:132:7: note: previous declaration is
 here
 :info:build char    *strndup(const char *, size_t)
 __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
 :info:build          ^
 :info:build pkcs11/pkcs11-mock.c:30:15: error: static declaration of
 'strnlen' follows non-static declaration
 :info:build static size_t strnlen (const char *string, size_t maxlen);
 :info:build               ^
 :info:build /usr/include/string.h:133:10: note: previous declaration is
 here
 :info:build size_t   strnlen(const char *, size_t)
 __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
 :info:build          ^
 :info:build pkcs11/pkcs11-mock.c:33:1: error: static declaration of
 'strnlen' follows non-static declaration
 :info:build strnlen (const char *string, size_t maxlen)
 :info:build ^
 :info:build /usr/include/string.h:133:10: note: previous declaration is
 here
 :info:build size_t   strnlen(const char *, size_t)
 __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
 :info:build          ^
 :info:build pkcs11/pkcs11-mock.c:40:1: error: static declaration of
 'strndup' follows non-static declaration
 :info:build strndup (char const *s, size_t n)
 :info:build ^
 :info:build /usr/include/string.h:132:7: note: previous declaration is
 here
 :info:build char    *strndup(const char *, size_t)
 __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
 :info:build          ^
 :info:build 4 errors generated.
 }}}
 I suggest alternative fix (attached) which is less pretty (uses #defines)
 but seems to work.

-- 
Ticket URL: <https://trac.macports.org/ticket/51451#comment:17>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list