Opened 3 weeks ago

Last modified 3 weeks ago

#71120 new defect

m4: configure: error: Cannot find a type to use in place of socklen_t

Reported by: tomasstolker (Tomas Stolker) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.10.2
Keywords: arm64 Cc:
Port: m4

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I got the following error when trying to install m4 on Mac Sequoia 15.0.1:

--->  Computing dependencies for m4
--->  Fetching archive for m4
--->  Attempting to fetch m4-1.4.19_1.darwin_24.arm64.tbz2 from https://packages.macports.org/m4
--->  Attempting to fetch m4-1.4.19_1.darwin_24.arm64.tbz2 from https://fra.de.packages.macports.org/m4
--->  Attempting to fetch m4-1.4.19_1.darwin_24.arm64.tbz2 from https://mse.uk.packages.macports.org/m4
--->  Configuring m4
Error: Failed to configure m4: consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19/config.log
Error: Failed to configure m4: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port m4 failed

Any suggestions on how to fix the issue?

Attachments (2)

main.log (307.2 KB) - added by tomasstolker (Tomas Stolker) 3 weeks ago.
config.log (3.1 MB) - added by tomasstolker (Tomas Stolker) 3 weeks ago.

Change History (7)

comment:1 Changed 3 weeks ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Port: m4 added

Please attach the main.log and config.log files.

Changed 3 weeks ago by tomasstolker (Tomas Stolker)

Attachment: main.log added

Changed 3 weeks ago by tomasstolker (Tomas Stolker)

Attachment: config.log added

comment:2 Changed 3 weeks ago by tomasstolker (Tomas Stolker)

Hereby the log files!

comment:3 Changed 3 weeks ago by ryandesign (Ryan Carsten Schmidt)

Keywords: arm64 added
Summary: Failed to configure m4 on Mac Sequoiam4: configure: error: Cannot find a type to use in place of socklen_t

The main.log says the problem is:

:info:configure checking for socklen_t... no
:info:configure checking for socklen_t equivalent... configure: error: Cannot find a type to use in place of socklen_t

The config.log says the reason for that is:

configure:57981: checking for socklen_t
configure:57981: /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
In file included from conftest.c:526:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/sys/types.h:81:
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(
      | ^

This looks like #62991 (and the same issue for grep in #64135) which were both fixed but the fix was only for when the universal variant is used. Your log shows you are not using the universal variant. However I do see this in your main.log:

:debug:sysinfo macOS 15.0.1 (darwin/24.0.0) arch i386

Are you on an Intel Mac or an Apple Silicon Mac? This line indicates MacPorts thinks you are on an Intel Mac, but the log shows you are trying to build m4 for Apple Silicon (arm64).

If you're on an Intel Mac, you won't be able to run arm64 software at all, so I assume you're on an Apple Silicon Mac. In that case, this problem is typically caused by running the Intel version of MacPorts, which happens automatically if you're running an Intel shell, which happens automatically if you're running an Intel terminal program. The solution is to use an Apple Silicon terminal program, like the one Apple includes with macOS at /Applications/Utilities/Terminal.app.

If you're already using Apple Terminal or a third-party terminal that is compiled for Apple Silicon, then go to the Finder, click the terminal program's icon, choose Get Info from the File menu, and see if the Open in Rosetta checkbox is checked. If it is, uncheck it, then close and reopen the terminal program.

Last edited 3 weeks ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 Changed 3 weeks ago by ryandesign (Ryan Carsten Schmidt)

This might be solved by [eee437c415b4e1d17eeb57fecff633f1d3846ffd/macports-base] which will be included in a future version of MacPorts.

comment:5 Changed 3 weeks ago by tomasstolker (Tomas Stolker)

Thanks a lot for looking into this and your feedback! I am indeed using Apple Silicon and had launched the Terminal with the Rosetta checkbox ticked. Running the Terminal without Rosetta solved the issue :-). Thanks again!

Note: See TracTickets for help on using tickets.