Bug 243872 - net/asterisk-chan_sccp: fix build on big-endian architectures with clang
Summary: net/asterisk-chan_sccp: fix build on big-endian architectures with clang
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Piotr Kubaj
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-04 13:31 UTC by Piotr Kubaj
Modified: 2020-02-09 21:35 UTC (History)
1 user (show)

See Also:
ddegroot: maintainer-feedback+
ddegroot: maintainer-feedback+


Attachments
patch (1.03 KB, patch)
2020-02-04 13:31 UTC, Piotr Kubaj
ddegroot: maintainer-approval+
Details | Diff
Patch to try out (1.16 KB, patch)
2020-02-05 21:51 UTC, Diederik de Groot
ddegroot: maintainer-approval-
Details | Diff
The patch as applied upstream to chan-sccp (7.66 KB, patch)
2020-02-08 01:40 UTC, Diederik de Groot
ddegroot: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2020-02-04 13:31:36 UTC
Created attachment 211343 [details]
patch

FreeBSD doesn't have __bswap_16() and __bswap_32(). Use bswap16() and bswap32() instead.
Comment 1 Diederik de Groot 2020-02-05 04:55:03 UTC
@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.
Comment 2 Diederik de Groot 2020-02-05 21:51:24 UTC
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.
Comment 3 Diederik de Groot 2020-02-08 01:31:03 UTC
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
Comment 4 Diederik de Groot 2020-02-08 01:40:19 UTC
Created attachment 211461 [details]
The patch as applied upstream to chan-sccp

this is the patch i have committed upstream to remedy the situation.
Comment 5 commit-hook freebsd_committer 2020-02-09 21:35:00 UTC
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