[MacPorts] #68144: libextractor @1.11: fails to build on Rosetta: Undefined symbols: "_LE_le16toh"
MacPorts
noreply at macports.org
Sat Mar 29 18:02:33 UTC 2025
#68144: libextractor @1.11: fails to build on Rosetta: Undefined symbols:
"_LE_le16toh"
---------------------------+-------------------------------------------
Reporter: barracuda156 | Owner: ryandesign
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.8.1
Resolution: | Keywords: powerpc, rosetta, snowleopard
Port: libextractor |
---------------------------+-------------------------------------------
Comment (by barracuda156):
Replying to [comment:5 ryandesign]:
> I updated libextractor to 1.13 but I don't think a lot changed between
1.11 and 1.13 so this bug probably didn't get fixed.
Indeed that specific header is broken, and you were right, that specific
code does nothing:
{{{
#ifndef __BYTE_ORDER
#ifdef _BYTE_ORDER
#define __BYTE_ORDER _BYTE_ORDER
#else
#ifdef BYTE_ORDER
#define __BYTE_ORDER BYTE_ORDER
#endif
#endif
#endif
#ifndef __BIG_ENDIAN
#ifdef _BIG_ENDIAN
#define __BIG_ENDIAN _BIG_ENDIAN
#else
#ifdef BIG_ENDIAN
#define __BIG_ENDIAN BIG_ENDIAN
#endif
#endif
#endif
#ifndef __LITTLE_ENDIAN
#ifdef _LITTLE_ENDIAN
#define __LITTLE_ENDIAN _LITTLE_ENDIAN
#else
#ifdef LITTLE_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#endif
#endif
#endif
}}}
Since neither is defined, none of the two cases below are applied, and
then symbols cannot possibly be found since they do not exist.
Your patch perhaps did not work because it assumes a modern compiler,
while gcc-4.2 does not define `__ORDER_BIG_ENDIAN__` and friends.
I fixed that issue now, so that Big endian case is triggered, and got a
different error:
{{{
/bin/sh ../../libtool --tag=CC --mode=link /usr/bin/gcc-4.2 -std=gnu99
-pipe -Os -arch ppc -export-dynamic -avoid-version -module -no-undefined
-export-symbols-regex "(EXTRACTOR|pl)_[a-zA-Z0-9_]*_......."
-Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport
-arch ppc -o libextractor_archive.la -rpath /opt/local/lib/libextractor
archive_extractor.lo -larchive
Undefined symbols:
"___bswap_16", referenced from:
_EXTRACTOR_s3m_extract_method in s3m_extractor.o
_EXTRACTOR_s3m_extract_method in s3m_extractor.o
_EXTRACTOR_s3m_extract_method in s3m_extractor.o
_EXTRACTOR_s3m_extract_method in s3m_extractor.o
_EXTRACTOR_s3m_extract_method in s3m_extractor.o
_EXTRACTOR_s3m_extract_method in s3m_extractor.o
_EXTRACTOR_s3m_extract_method in s3m_extractor.o
ld: symbol(s) not found
}}}
Unsurprisingly, since nothing at all defines `bswap_*` macros either.
Wonder how this amazing code even works elsewhere LOL
Should be fixable if all this mess is replaced with macros from `libkern`.
--
Ticket URL: <https://trac.macports.org/ticket/68144#comment:8>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list