[MacPorts] #63164: py-libxml2 icu cctools - FAT libraries built on i386 Mac OS X Tiger fail to run

MacPorts noreply at macports.org
Fri Jul 9 06:19:27 UTC 2021


#63164: py-libxml2 icu cctools - FAT libraries built on i386 Mac OS X Tiger fail to
run
-------------------------+--------------------
  Reporter:  bradleyCPA  |      Owner:  (none)
      Type:  defect      |     Status:  new
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:              |
-------------------------+--------------------

Comment (by bradleyCPA):

 Consider:
 {{{
 #include <math.h>
 #include <stdio.h>

 int main() {
     unsigned int pagesize = 4096;
     fprintf(stdout, "%u %f %u %u\n", pagesize, log2(pagesize), (unsigned
 int) log2(pagesize), lround(log2(pagesize)));
 }
 }}}
 which on my mac os x tiger system gives:
 {{{
 4096 12.000000 11 12
 }}}
 as it pertains to the get_default_align() function misc/lipo.c in cctools
 archive
 {{{
 /*
  * get_default_align() returns the default segment alignment for the
 specified
  * cputype and cpusubtype, as an exponent of a power of 2; e.g., a segment
  * alignment of 0x4000 will be described as 14. If the default alignment
 is not
  * known it will return 0.
  */
 static
 uint32_t
 get_default_align(
 cpu_type_t cputype,
 cpu_subtype_t cpusubtype)
 {
     const char* arch_name = get_arch_name_from_types(cputype, cpusubtype);
     if (arch_name != NULL) {
         struct arch_flag arch_flag;
         if (get_arch_from_flag((char*)arch_name, &arch_flag)) {
             uint32_t pagesize = get_segalign_from_flag(&arch_flag);
             return (uint32_t)(log2(pagesize));
         }
     }

     return 0;
 }
 }}}
 This explains to me why the alignment is being chosen as 2048. Seems bug.

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


More information about the macports-tickets mailing list