[MacPorts] #61868: libusb @1.0.24: error: compiler with C11 support is required to build libusb

MacPorts noreply at macports.org
Thu Dec 24 00:24:48 UTC 2020


#61868: libusb @1.0.24: error: compiler with C11 support is required to build
libusb
-----------------------------------+-----------------------
  Reporter:  dgonyier              |      Owner:  michaelld
      Type:  defect                |     Status:  reopened
  Priority:  Normal                |  Milestone:
 Component:  ports                 |    Version:  2.6.4
Resolution:                        |   Keywords:
      Port:  libusb, libusb-devel  |
-----------------------------------+-----------------------

Comment (by michaelld):

 `Houston, we have a problem!` ... with `libusb` 1.0.24 on older OSX that
 is ... here's my findings from OSX 10.5.8 PPC ... will be roughly the same
 with any older OSX version:

 1) `libusb` 1.0.24 requires C11 / GNU11 for the C standard. 1.0.23 did
 not. Here is the commit between 1.0.23 and 1.0.24:
 https://github.com/libusb/libusb/commit/9a1bc8cafb904c20a869c74ad6d657686a1c4bb1

 2) IOKit on older OSX uses `#pragma` that requires Apple extension to GCC
 via apple-gcc-4.2 or the GCC that came with Xcode for this OSX, or Clang
 parsing; see e.g.:
 https://github.com/libusb/libusb/commit/9a1bc8cafb904c20a869c74ad6d657686a1c4bb1

 3) GCC provides PPC support, while for Clang it is just whatever compiler
 came with Xcode from Apple; modern Clang does not yet support PPC & may
 never do so.

 Combining: To get C11 / GNU11 support required by (1), we require a
 reasonably recent vanilla GCC per (3), but that GCC will not provide the
 `#pragma` required by IOKit per (2). We cannot modify the system framework
 header directly to fix the issue as suggested in (2).

 ... but ... maybe we could provide the fixed header in the legacy support
 headers and make sure it is searched before the IOKit one ... maybe? hmmmm
 ... that's worth a try IMHO; might work. I can't think of another option
 here beyond capping `libusb` to 1.0.23 for the affected systems. What do
 you think @kencu ?

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


More information about the macports-tickets mailing list