Created attachment 211343 [details] patch FreeBSD doesn't have __bswap_16() and __bswap_32(). Use bswap16() and bswap32() instead.
@piotr The __bswap_16 and __bswap_32 implementation is defined in the source just above your patch, can you help me figure out what we can do in the source files to fix the problem upstream.
Created attachment 211394 [details] Patch to try out Can you try out this patch and see if it works just as well. I would prefer using this and committing it upstream.
Instead of using bswap / byteswap.h we could just use /usr/include/endian.h (linux) or /usr/include/sys/endian.h (bsd). They have the same definitions for htole16/htole32/le16toh/le32toh which is what we need. I have made the change upstream and testing it right now. For the time being you can use the patch you provided
Created attachment 211461 [details] The patch as applied upstream to chan-sccp this is the patch i have committed upstream to remedy the situation.
A commit references this bug: Author: pkubaj Date: Sun Feb 9 21:34:33 UTC 2020 New revision: 525676 URL: https://svnweb.freebsd.org/changeset/ports/525676 Log: net/asterisk-chan_sccp: fix build on big-endian architectures with clang FreeBSD doesn't have __bswap_16() and __bswap_32(). Use bswap16() and bswap32() instead. PR: 243872 Approved by: ddegroot@talon.nl (maintainer) Changes: head/net/asterisk-chan_sccp/files/ head/net/asterisk-chan_sccp/files/patch-src_define.h