[MacPorts] #70790: m4 build error on Sequoia

MacPorts noreply at macports.org
Thu Sep 19 01:01:55 UTC 2024


#70790: m4 build error on Sequoia
-----------------------+---------------------
  Reporter:  eschnett  |      Owner:  (none)
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:  2.10.1
Resolution:            |   Keywords:  Sequoia
      Port:  m4        |
-----------------------+---------------------

Old description:

> Building `m4` on Sequoia fails in the configure stage. The relevant lines
> are
> ```
> | #include <sys/types.h>
> |                    #include <sys/socket.h>
> |
> |                    int getpeername (int, void *, unsigned long int *);
> | int
> | main (void)
> | {
> | unsigned long int len;
> |                   getpeername (0, 0, &len);
> |   ;
> |   return 0;
> | }
> configure:58033: error: Cannot find a type to use in place of socklen_t
> ```
>
> I believe the reason is the following. The compiler is invoked with
> ```
> configure:58023: /usr/bin/clang -c -pipe -Os
> -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch
> arm64 -I/opt/local/include
> -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c
> >&5
> ```
> but the file `sys/socket.h` is not located in this sysroot. Instead, it
> is found at
> `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/socket.h`.

New description:

 Building `m4` on Sequoia fails in the configure stage. The relevant lines
 are
 {{{
 | #include <sys/types.h>
 |                    #include <sys/socket.h>
 |
 |                    int getpeername (int, void *, unsigned long int *);
 | int
 | main (void)
 | {
 | unsigned long int len;
 |                   getpeername (0, 0, &len);
 |   ;
 |   return 0;
 | }
 configure:58033: error: Cannot find a type to use in place of socklen_t
 }}}

 I believe the reason is the following. The compiler is invoked with
 {{{
 configure:58023: /usr/bin/clang -c -pipe -Os
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64
 -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c
 >&5
 }}}
 but the file `sys/socket.h` is not located in this sysroot. Instead, it is
 found at
 `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/socket.h`.

--

Comment (by jmroot):

 Something seems to be wrong with the SDK you have. On my system:
 {{{
 % ls -l
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/sys/socket.h
 -r--r--r--  1 root  wheel  32534 13 Aug 14:03
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/sys/socket.h
 }}}

 Your `machine/endian.h` also seems to be including `i386/endian.h` when
 building for arm:
 {{{
 configure:17916: /usr/bin/clang -o conftest -pipe -Os
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64
 -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
 -L/opt/local/lib -Wl,-headerpad_max_install_names
 -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
 -arch arm64 conftest.c  >&5
 In file included from conftest.c:155:
 In file included from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/stdlib.h:58:
 In file included from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/_stdlib.h:66:
 In file included from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/sys/wait.h:186:
 In file included from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/machine/endian.h:35:
 In file included from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/i386/endian.h:85:
 In file included from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/sys/_endian.h:131:
 In file included from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/libkern/_OSByteOrder.h:62:
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/libkern/arm/_OSByteOrder.h:50:1:
 error: redefinition of '_OSSwapInt16'
    50 | _OSSwapInt16(
       | ^
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/libkern/i386/_OSByteOrder.h:50:1:
 note: previous definition is here
    50 | _OSSwapInt16(
       | ^
 }}}

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


More information about the macports-tickets mailing list