[MacPorts] #65945: jemalloc fails on 10.5.8: Undefined symbols: _malloc_default_purgeable_zone, __Unwind_Resume using a modified MacPorts setup on 10.5 that is defaulting to use gcc11

MacPorts noreply at macports.org
Sat Oct 15 05:51:32 UTC 2022


#65945: jemalloc fails on 10.5.8: Undefined symbols:
_malloc_default_purgeable_zone, __Unwind_Resume using a modified MacPorts
setup on 10.5 that is defaulting to use gcc11
---------------------------+-------------------------------------------
  Reporter:  barracuda156  |      Owner:  kencu
      Type:  defect        |     Status:  assigned
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:  2.7.2
Resolution:                |   Keywords:  powerpc, leopard, snowleopard
      Port:  jemalloc      |
---------------------------+-------------------------------------------

Comment (by barracuda156):

 Next bunch of errors on 10.5.8:
 {{{
 :info:build src/pages.c: In function 'pages_huge_impl':
 :info:build src/pages.c:498:16: error: variable 'm' has initializer but
 incomplete type
 :info:build   498 |         struct memcntl_mha m = {0};
 :info:build       |                ^~~~~~~~~~~
 :info:build src/pages.c:498:33: warning: excess elements in struct
 initializer
 :info:build   498 |         struct memcntl_mha m = {0};
 :info:build       |                                 ^
 :info:build src/pages.c:498:33: note: (near initialization for 'm')
 :info:build src/pages.c:498:28: error: storage size of 'm' isn't known
 :info:build   498 |         struct memcntl_mha m = {0};
 :info:build       |                            ^
 :info:build src/pages.c:499:21: error: 'MHA_MAPSIZE_VA' undeclared (first
 use in this function)
 :info:build   499 |         m.mha_cmd = MHA_MAPSIZE_VA;
 :info:build       |                     ^~~~~~~~~~~~~~
 :info:build src/pages.c:499:21: note: each undeclared identifier is
 reported only once for each function it appears in
 :info:build src/pages.c:501:17: warning: implicit declaration of function
 'memcntl'; did you mean 'fcntl'? [-Wimplicit-function-declaration]
 :info:build   501 |         return (memcntl(addr, size, MC_HAT_ADVISE,
 (caddr_t)&m, 0, 0) == 0);
 :info:build       |                 ^~~~~~~
 :info:build       |                 fcntl
 :info:build src/pages.c:501:37: error: 'MC_HAT_ADVISE' undeclared (first
 use in this function)
 :info:build   501 |         return (memcntl(addr, size, MC_HAT_ADVISE,
 (caddr_t)&m, 0, 0) == 0);
 :info:build       |                                     ^~~~~~~~~~~~~
 }}}

 Apparently the following macro detects availability wrongly:
 {{{
 ac_fn_c_check_func "$LINENO" "memcntl" "ac_cv_func_memcntl"
 if test "x$ac_cv_func_memcntl" = xyes; then :
   have_memcntl="1"
 else
   have_memcntl="0"
 fi

 if test "x$have_memcntl" = "x1" ; then

 $as_echo "#define JEMALLOC_HAVE_MEMCNTL  " >>confdefs.h

 fi
 }}}

 And this code breaks down:
 {{{
 static bool
 pages_huge_impl(void *addr, size_t size, bool aligned) {
         if (aligned) {
                 assert(HUGEPAGE_ADDR2BASE(addr) == addr);
                 assert(HUGEPAGE_CEILING(size) == size);
         }
 #if defined(JEMALLOC_HAVE_MADVISE_HUGE)
         return (madvise(addr, size, MADV_HUGEPAGE) != 0);
 #elif defined(JEMALLOC_HAVE_MEMCNTL) &&
         struct memcntl_mha m = {0};
         m.mha_cmd = MHA_MAPSIZE_VA;
         m.mha_pagesize = HUGEPAGE;
         return (memcntl(addr, size, MC_HAT_ADVISE, (caddr_t)&m, 0, 0) ==
 0);
 #else
         return true;
 #endif
 }
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/65945#comment:21>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list