Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./configure and make failed on macOS Monterey #99337

Closed
addlistener opened this issue Nov 10, 2022 · 12 comments
Closed

./configure and make failed on macOS Monterey #99337

addlistener opened this issue Nov 10, 2022 · 12 comments
Labels
OS-mac type-bug An unexpected behavior, bug, or error

Comments

@addlistener
Copy link

addlistener commented Nov 10, 2022

Bug report

When using ./configure it let me file a bug report

./configure                                                                                                                                         ✔ │ 23:31:36 

checking build system type... x86_64-apple-darwin21.4.0
checking host system type... x86_64-apple-darwin21.4.0
checking for python3.10... python3.10
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "darwin"
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for a sed that does not truncate output... /usr/bin/sed
checking for --with-cxx-main=<compiler>... no
checking for g++... no
configure:

  By default, distutils will build C++ extension modules with "g++".
  If this is not intended, then set CXX on the configure command line.

checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report

When I used brew install gcc-11 & CC=gcc-11 ./configure the configure passed but the make failed.

Which I believe the GNU gcc is missing the HAVE_BUILTIN_AVAILABLE macro?

make                                                                                                                                     ✔ │ 1m 20s  │ 23:35:40 

gcc-11 -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal  -I. -I./Include    -DPy_BUILD_CORE -o Programs/python.o ./Programs/python.c
gcc-11 -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal  -I. -I./Include    -DPy_BUILD_CORE -o Parser/token.o Parser/token.c

....
--- a lot of normal logs ---
....

gcc-11 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal  -I. -I./Include    -DPy_BUILD_CORE_BUILTIN  -DPy_BUILD_CORE_BUILTIN -I./Include/internal -c ./Modules/posixmodule.c -o Modules/posixmodule.o
./Modules/posixmodule.c: In function 'utime_dir_fd':
./Modules/posixmodule.c:5165:9: error: 'HAVE_UTIMENSAT_RUNTIME' undeclared (first use in this function); did you mean 'HAVE_FACCESSAT_RUNTIME'?
 5165 |     if (HAVE_UTIMENSAT_RUNTIME) {
      |         ^~~~~~~~~~~~~~~~~~~~~~
      |         HAVE_FACCESSAT_RUNTIME
./Modules/posixmodule.c:5165:9: note: each undeclared identifier is reported only once for each function it appears in
./Modules/posixmodule.c: In function 'utime_fd':
./Modules/posixmodule.c:5201:9: error: 'HAVE_FUTIMENS_RUNTIME' undeclared (first use in this function); did you mean 'HAVE_RENAMEAT_RUNTIME'?
 5201 |     if (HAVE_FUTIMENS_RUNTIME) {
      |         ^~~~~~~~~~~~~~~~~~~~~
      |         HAVE_RENAMEAT_RUNTIME
./Modules/posixmodule.c: In function 'utime_nofollow_symlinks':
./Modules/posixmodule.c:5242:9: error: 'HAVE_UTIMENSAT_RUNTIME' undeclared (first use in this function); did you mean 'HAVE_FACCESSAT_RUNTIME'?
 5242 |     if (HAVE_UTIMENSAT_RUNTIME) {
      |         ^~~~~~~~~~~~~~~~~~~~~~
      |         HAVE_FACCESSAT_RUNTIME
./Modules/posixmodule.c: In function 'utime_default':
./Modules/posixmodule.c:5274:9: error: 'HAVE_UTIMENSAT_RUNTIME' undeclared (first use in this function); did you mean 'HAVE_FACCESSAT_RUNTIME'?
 5274 |     if (HAVE_UTIMENSAT_RUNTIME) {
      |         ^~~~~~~~~~~~~~~~~~~~~~
      |         HAVE_FACCESSAT_RUNTIME
./Modules/posixmodule.c: In function 'os_preadv_impl':
./Modules/posixmodule.c:9706: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
 9706 | #pragma clang diagnostic push
      |
./Modules/posixmodule.c:9707: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
 9707 | #pragma clang diagnostic ignored "-Wunguarded-availability"
      |
./Modules/posixmodule.c:9708: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
 9708 | #pragma clang diagnostic ignored "-Wunguarded-availability-new"
      |
./Modules/posixmodule.c:9718: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
 9718 | #pragma clang diagnostic pop
      |
./Modules/posixmodule.c: In function 'os_pwritev_impl':
./Modules/posixmodule.c:10346: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
10346 | #pragma clang diagnostic push
      |
./Modules/posixmodule.c:10347: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
10347 | #pragma clang diagnostic ignored "-Wunguarded-availability"
      |
./Modules/posixmodule.c:10348: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
10348 | #pragma clang diagnostic ignored "-Wunguarded-availability-new"
      |
./Modules/posixmodule.c:10359: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
10359 | #pragma clang diagnostic pop
      |
./Modules/posixmodule.c: In function 'probe_futimens':
./Modules/posixmodule.c:15466:23: error: 'HAVE_FUTIMENS_RUNTIME' undeclared (first use in this function); did you mean 'HAVE_RENAMEAT_RUNTIME'?
15466 | PROBE(probe_futimens, HAVE_FUTIMENS_RUNTIME)
      |                       ^~~~~~~~~~~~~~~~~~~~~
./Modules/posixmodule.c:15410:11: note: in definition of macro 'PROBE'
15410 |       if (test) {        \
      |           ^~~~
./Modules/posixmodule.c: In function 'probe_utimensat':
./Modules/posixmodule.c:15470:24: error: 'HAVE_UTIMENSAT_RUNTIME' undeclared (first use in this function); did you mean 'HAVE_FACCESSAT_RUNTIME'?
15470 | PROBE(probe_utimensat, HAVE_UTIMENSAT_RUNTIME)
      |                        ^~~~~~~~~~~~~~~~~~~~~~
./Modules/posixmodule.c:15410:11: note: in definition of macro 'PROBE'
15410 |       if (test) {        \
      |           ^~~~
./Modules/posixmodule.c: In function 'posixmodule_exec':
./Modules/posixmodule.c:15623:9: error: 'HAVE_PWRITEV_RUNTIME' undeclared (first use in this function); did you mean 'HAVE_OPENAT_RUNTIME'?
15623 |     if (HAVE_PWRITEV_RUNTIME) {} else {
      |         ^~~~~~~~~~~~~~~~~~~~
      |         HAVE_OPENAT_RUNTIME
./Modules/posixmodule.c: In function 'probe_utimensat':
./Modules/posixmodule.c:15415:4: warning: control reaches end of non-void function [-Wreturn-type]
15415 |    }
      |    ^
./Modules/posixmodule.c:15470:1: note: in expansion of macro 'PROBE'
15470 | PROBE(probe_utimensat, HAVE_UTIMENSAT_RUNTIME)
      | ^~~~~
./Modules/posixmodule.c: In function 'probe_futimens':
./Modules/posixmodule.c:15415:4: warning: control reaches end of non-void function [-Wreturn-type]
15415 |    }
      |    ^
./Modules/posixmodule.c:15466:1: note: in expansion of macro 'PROBE'
15466 | PROBE(probe_futimens, HAVE_FUTIMENS_RUNTIME)
      | ^~~~~
./Modules/posixmodule.c: In function 'utime_nofollow_symlinks':
./Modules/posixmodule.c:5264:1: warning: control reaches end of non-void function [-Wreturn-type]
 5264 | }
      | ^
./Modules/posixmodule.c: In function 'utime_dir_fd':
./Modules/posixmodule.c:5187:1: warning: control reaches end of non-void function [-Wreturn-type]
 5187 | }
      | ^
./Modules/posixmodule.c: In function 'utime_fd':
./Modules/posixmodule.c:5225:1: warning: control reaches end of non-void function [-Wreturn-type]
 5225 | }
      | ^
./Modules/posixmodule.c: In function 'utime_default':
./Modules/posixmodule.c:5294:1: warning: control reaches end of non-void function [-Wreturn-type]
 5294 | }
      | ^
make: *** [Modules/posixmodule.o] Error 1

Your environment

  • CPython versions tested on: 3.10.0
  • Operating system and architecture: Darwin 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 x86_64

image

gcc -v                                                                                                                                   ✔ │ 3m 14s  │ 23:50:52 
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

gcc-11 -v                                                                                                                                           ✔ │ 23:50:54 
Using built-in specs.
COLLECT_GCC=gcc-11
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc@11/11.3.0/bin/../libexec/gcc/x86_64-apple-darwin21/11/lto-wrapper
Target: x86_64-apple-darwin21
Configured with: ../configure --prefix=/usr/local/opt/gcc@11 --libdir=/usr/local/opt/gcc@11/lib/gcc/11 --disable-nls --enable-checking=release --with-gcc-major-version-only --enable-languages=c,c++,objc,obj-c++,fortran,d --program-suffix=-11 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-zstd=/usr/local/opt/zstd --with-pkgversion='Homebrew GCC 11.3.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --enable-libphobos --build=x86_64-apple-darwin21 --with-system-zlib --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (Homebrew GCC 11.3.0)

Linked PRs

@addlistener addlistener added the type-bug An unexpected behavior, bug, or error label Nov 10, 2022
@ronaldoussoren
Copy link
Contributor

A quick workaround is to use the system compiler (e.g. /usr/bin/clang) instead of homebrew GCC to perform the build.

@ronaldoussoren
Copy link
Contributor

Looks like this is a fairly shallow issue, a number of macros include HAVE_UTIMENSAT_RUNTIME are not defined when compiling on macOS with a compiler that doesn't have __builtin_available.

I'm currently installing homebrew and gcc-11 in a VM to create a fix for this.

@ronaldoussoren
Copy link
Contributor

"brew install gcc-11" didn't work for me, I used "brew install gcc" instead and that installed gcc-12. That results in a compile error in pylifecycle.c due to the expansion of _Py_COMP_DIAG_PUSH on line 101. Moving those lines a bit earlier fixes that (will become a bit clearer when I create a PR)

@ronaldoussoren
Copy link
Contributor

@jchnxu : W.r.t. the first error (internal configure error for the platform triplet, please file a bug report): Could you upload the configure log (config.log)? That can help us find the issue as configure should just work with Apple's compiler tools.

@ronaldoussoren
Copy link
Contributor

ronaldoussoren commented Nov 14, 2022

I've created a PR for the problems with GCC-12 that I found. It is a draft for now for two reasons:

  1. I'm not entirely happy with some code duplication in the _ctypes changes
  2. There's no news entry yet

UPDATE: Said PR is now ready for review.

@ronaldoussoren
Copy link
Contributor

@jchnxu : W.r.t. the first error (internal configure error for the platform triplet, please file a bug report): Could you upload the configure log (config.log)? That can help us find the issue as configure should just work with Apple's compiler tools.

I noticed the same error in a CI build while working on my PR, but don't get this error while building in VM with Xcode 13.4 (same clang version as in this issue) or Xcode 14 (clang 14.0).

@addlistener
Copy link
Author

A quick workaround is to use the system compiler (e.g. /usr/bin/clang) instead of homebrew GCC to perform the build.

It's the same

CC="clang" ./configure                                                                   
checking for git... found
checking build system type... x86_64-apple-darwin21.4.0
checking host system type... x86_64-apple-darwin21.4.0
checking for python3.8... python3.8
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for a sed that does not truncate output... /usr/bin/sed
checking for --with-cxx-main=<compiler>... no
checking for clang++... no
configure:

  By default, distutils will build C++ extension modules with "clang++".
  If this is not intended, then set CXX on the configure command line.

checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report

@jchnxu : W.r.t. the first error (internal configure error for the platform triplet, please file a bug report): Could you upload the configure log (config.log)? That can help us find the issue as configure should just work with Apple's compiler tools.

I didn't spot it. Can you tell me the location?

drwxr-xr-x   34 meme  staff   1.1K Nov 17 13:53 .
drwxr-xr-x    4 meme  staff   128B Nov 10 18:19 ..
-rw-r--r--    1 meme  staff    40B Nov 10 18:30 .git
-rw-r--r--    1 meme  staff   772B Nov 10 18:31 .gitattributes
drwxr-xr-x    8 meme  staff   256B Nov 10 18:31 .github
-rw-r--r--    1 meme  staff   1.6K Nov 10 18:31 .gitignore
-rw-r--r--    1 meme  staff   6.4K Nov 10 18:31 .travis.yml
drwxr-xr-x   29 meme  staff   928B Nov 10 18:31 Doc
drwxr-xr-x    3 meme  staff    96B Nov 10 18:31 Grammar
drwxr-xr-x  103 meme  staff   3.2K Nov 10 18:31 Include
-rw-r--r--    1 meme  staff    12K Nov 10 18:31 LICENSE
drwxr-xr-x  204 meme  staff   6.4K Nov 10 18:31 Lib
drwxr-xr-x   11 meme  staff   352B Nov 10 18:31 Mac
-rw-r--r--    1 meme  staff    61K Nov 10 18:31 Makefile.pre.in
drwxr-xr-x   24 meme  staff   768B Nov 10 18:31 Misc
drwxr-xr-x  129 meme  staff   4.0K Nov 10 18:31 Modules
drwxr-xr-x   52 meme  staff   1.6K Nov 10 18:31 Objects
drwxr-xr-x   41 meme  staff   1.3K Nov 10 18:31 PC
drwxr-xr-x  108 meme  staff   3.4K Nov 10 18:31 PCbuild
drwxr-xr-x   24 meme  staff   768B Nov 10 18:31 Parser
drwxr-xr-x    6 meme  staff   192B Nov 10 18:31 Programs
drwxr-xr-x   75 meme  staff   2.3K Nov 10 18:31 Python
-rw-r--r--    1 meme  staff   9.3K Nov 10 18:31 README.rst
drwxr-xr-x   24 meme  staff   768B Nov 10 18:31 Tools
-rw-r--r--    1 meme  staff    11K Nov 10 18:31 aclocal.m4
-rwxr-xr-x    1 meme  staff    43K Nov 10 18:31 config.guess
-rw-r--r--    1 meme  staff    12K Nov 17 13:53 config.log
-rwxr-xr-x    1 meme  staff    35K Nov 10 18:31 config.sub
-rwxr-xr-x    1 meme  staff   483K Nov 10 18:31 configure
-rw-r--r--    1 meme  staff   160K Nov 10 18:31 configure.ac
-rwxr-xr-x    1 meme  staff   7.0K Nov 10 18:31 install-sh
drwxr-xr-x    3 meme  staff    96B Nov 10 18:31 m4
-rw-r--r--    1 meme  staff    42K Nov 10 18:31 pyconfig.h.in
-rw-r--r--    1 meme  staff   100K Nov 10 18:31 setup.py

@ronaldoussoren
Copy link
Contributor

It's the 8th line from the bottom, 'config.log'.

@addlistener
Copy link
Author

addlistener commented Nov 17, 2022

Forgive me for ignoring it. Here it is

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by python configure 3.8, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = jiachenalcomMBP
uname -m = x86_64
uname -r = 21.4.0
uname -s = Darwin
uname -v = Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
	 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64
Kernel configured for up to 16 processors.
8 processors are physically available.
16 processors are logically available.
Processor type: x86_64h (Intel x86-64h Haswell)
Processors active: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Primary memory available: 64.00 gigabytes
Default processor set: 725 tasks, 4749 threads, 16 processors
Load average: 2.06, Mach factor: 13.92
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Users/jace/hacking/pyrun/venv/bin
PATH: /Users/jace/.cabal/bin
PATH: /Users/jace/.ghcup/bin
PATH: /Users/jace/.pyenv/shims
PATH: /usr/local/opt/mysql@5.6/bin
PATH: /Users/jace/.sdkman/candidates/java/current/bin
PATH: /Users/jace/.sdkman/candidates/gradle/current/bin
PATH: /Library/Frameworks/Python.framework/Versions/2.7/bin
PATH: /opt/local/bin
PATH: /opt/local/sbin
PATH: /Users/jace/.nvm/versions/node/v16.16.0/bin
PATH: /Users/jace/.yarn/bin
PATH: /usr/local/mysql/bin
PATH: /usr/local/bin
PATH: /Users/jace/.local/bin
PATH: /usr/local/opt/mysql@5.6/bin
PATH: ~/Development/gradle-2.4/bin
PATH: /Users/jace/hacking/emsdk
PATH: /Users/jace/hacking/emsdk/upstream/emscripten
PATH: /Users/jace/hacking/emsdk/node/14.15.5_64bit/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/share/dotnet
PATH: ~/.dotnet/tools
PATH: /Library/Apple/usr/bin
PATH: /Library/Frameworks/Mono.framework/Versions/Current/Commands
PATH: /Users/jace/.cargo/bin
PATH: /Users/jace/.fig/bin
PATH: /Users/jace/.local/bin
PATH: /Users/jace/hacking/flutter/bin
PATH: /Users/jace/Development/opt/apache-maven/bin
PATH: /Users/jace/.config/yarn/global/node_modules/.bin
PATH: /usr/local/smlnj-110.75/bin
PATH: /usr/local/go/bin
PATH: /Users/jace/Development/gocode/bin
PATH: /usr/local/Cellar/cassandra/3.11.6/bin
PATH: /usr/local/mysql/bin/


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2727: checking for git
configure:2743: found /usr/local/bin/git
configure:2755: result: found
configure:2814: checking build system type
configure:2828: result: x86_64-apple-darwin21.4.0
configure:2848: checking host system type
configure:2861: result: x86_64-apple-darwin21.4.0
configure:2891: checking for python3.8
configure:2907: found /Users/jace/.pyenv/shims/python3.8
configure:2918: result: python3.8
configure:3012: checking for --enable-universalsdk
configure:3059: result: no
configure:3082: checking for --with-universal-archs
configure:3097: result: no
configure:3253: checking MACHDEP
configure:3459: checking for --without-gcc
configure:3482: result: no
configure:3485: checking for --with-icc
configure:3505: result: no
configure:3629: checking for gcc
configure:3656: result: clang
configure:3885: checking for C compiler version
configure:3894: clang --version >&5
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure:3905: $? = 0
configure:3894: clang -v >&5
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure:3905: $? = 0
configure:3894: clang -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3905: $? = 1
configure:3894: clang -qversion >&5
clang: error: unknown argument '-qversion'; did you mean '--version'?
clang: error: no input files
configure:3905: $? = 1
configure:3925: checking whether the C compiler works
configure:3947: clang    conftest.c  >&5
configure:3951: $? = 0
configure:3999: result: yes
configure:4002: checking for C compiler default output file name
configure:4004: result: a.out
configure:4010: checking for suffix of executables
configure:4017: clang -o conftest    conftest.c  >&5
configure:4021: $? = 0
configure:4043: result: 
configure:4065: checking whether we are cross compiling
configure:4073: clang -o conftest    conftest.c  >&5
configure:4077: $? = 0
configure:4084: ./conftest
configure:4088: $? = 0
configure:4103: result: no
configure:4108: checking for suffix of object files
configure:4130: clang -c   conftest.c >&5
configure:4134: $? = 0
configure:4155: result: o
configure:4159: checking whether we are using the GNU C compiler
configure:4178: clang -c   conftest.c >&5
configure:4178: $? = 0
configure:4187: result: yes
configure:4196: checking whether clang accepts -g
configure:4216: clang -c -g  conftest.c >&5
configure:4216: $? = 0
configure:4257: result: yes
configure:4274: checking for clang option to accept ISO C89
configure:4337: clang  -c   conftest.c >&5
configure:4337: $? = 0
configure:4350: result: none needed
configure:4375: checking how to run the C preprocessor
configure:4406: clang -E  conftest.c
configure:4406: $? = 0
configure:4420: clang -E  conftest.c
conftest.c:11:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
configure:4420: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _DARWIN_C_SOURCE 1
| #define _PYTHONFRAMEWORK ""
| #define _XOPEN_SOURCE 700
| #define _XOPEN_SOURCE_EXTENDED 1
| #define _POSIX_C_SOURCE 200809L
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:4445: result: clang -E
configure:4465: clang -E  conftest.c
configure:4465: $? = 0
configure:4479: clang -E  conftest.c
conftest.c:11:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
configure:4479: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _DARWIN_C_SOURCE 1
| #define _PYTHONFRAMEWORK ""
| #define _XOPEN_SOURCE 700
| #define _XOPEN_SOURCE_EXTENDED 1
| #define _POSIX_C_SOURCE 200809L
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:4507: checking for grep that handles long lines and -e
configure:4565: result: /usr/bin/grep
configure:4570: checking for a sed that does not truncate output
configure:4634: result: /usr/bin/sed
configure:4642: checking for --with-cxx-main=<compiler>
configure:4668: result: no
configure:4917: checking for clang++
configure:4950: result: no
configure:5186:

  By default, distutils will build C++ extension modules with "clang++".
  If this is not intended, then set CXX on the configure command line.
  
configure:5198: checking for the platform triplet based on compiler characteristics
configure:5346: result: darwin
configure:5356: error: internal configure error for the platform triplet, please file a bug report

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-apple-darwin21.4.0
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=set
ac_cv_env_CC_value=clang
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_MACHDEP_set=
ac_cv_env_MACHDEP_value=
ac_cv_env_PKG_CONFIG_LIBDIR_set=
ac_cv_env_PKG_CONFIG_LIBDIR_value=
ac_cv_env_PKG_CONFIG_PATH_set=
ac_cv_env_PKG_CONFIG_PATH_value=
ac_cv_env_PKG_CONFIG_set=
ac_cv_env_PKG_CONFIG_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-apple-darwin21.4.0
ac_cv_objext=o
ac_cv_path_GREP=/usr/bin/grep
ac_cv_path_SED=/usr/bin/sed
ac_cv_prog_CPP='clang -E'
ac_cv_prog_HAS_GIT=found
ac_cv_prog_PYTHON_FOR_REGEN=python3.8
ac_cv_prog_ac_ct_CC=clang
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ABIFLAGS=''
AR=''
ARCH_RUN_32BIT=''
ARFLAGS=''
BASECFLAGS=''
BASECPPFLAGS=''
BLDLIBRARY=''
BLDSHARED=''
BUILDEXEEXT=''
CC='clang'
CCSHARED=''
CFLAGS=''
CFLAGSFORSHARED=''
CFLAGS_ALIASING=''
CFLAGS_NODIST=''
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=''
CONFIG_ARGS=' '\''CC=clang'\'''
CPP='clang -E'
CPPFLAGS=''
CXX='clang++'
DEFS=''
DEF_MAKE_ALL_RULE=''
DEF_MAKE_RULE=''
DFLAGS=''
DLINCLDIR=''
DLLLIBRARY=''
DTRACE=''
DTRACE_HEADERS=''
DTRACE_OBJS=''
DYNLOADFILE=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
ENSUREPIP=''
EXEEXT=''
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
EXT_SUFFIX=''
FRAMEWORKALTINSTALLFIRST=''
FRAMEWORKALTINSTALLLAST=''
FRAMEWORKINSTALLAPPSPREFIX=''
FRAMEWORKINSTALLFIRST=''
FRAMEWORKINSTALLLAST=''
FRAMEWORKPYTHONW=''
FRAMEWORKUNIXTOOLSPREFIX='/usr/local'
GITBRANCH='git -C $(srcdir) name-rev --name-only HEAD'
GITTAG='git -C $(srcdir) describe --all --always --dirty'
GITVERSION='git -C $(srcdir) rev-parse --short HEAD'
GNULD=''
GREP='/usr/bin/grep'
HAS_GIT='found'
HAVE_GETHOSTBYNAME=''
HAVE_GETHOSTBYNAME_R=''
HAVE_GETHOSTBYNAME_R_3_ARG=''
HAVE_GETHOSTBYNAME_R_5_ARG=''
HAVE_GETHOSTBYNAME_R_6_ARG=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
INSTSONAME=''
LDCXXSHARED=''
LDFLAGS=''
LDLAST=''
LDLIBRARY=''
LDLIBRARYDIR=''
LDSHARED=''
LDVERSION=''
LIBC=''
LIBFFI_INCLUDEDIR=''
LIBM=''
LIBOBJS=''
LIBPL=''
LIBRARY=''
LIBS=''
LIBTOOL_CRUFT=''
LINKCC=''
LINKFORSHARED=''
LIPO_32BIT_FLAGS=''
LLVM_PROFDATA=''
LLVM_PROF_ERR=''
LLVM_PROF_FILE=''
LLVM_PROF_FOUND=''
LLVM_PROF_MERGER=''
LN=''
LTLIBOBJS=''
MACHDEP='darwin'
MACHDEP_OBJS=''
MAINCC='$(CC)'
MKDIR_P=''
MULTIARCH='x86_64-apple-darwin21.4.0'
MULTIARCH_CPPFLAGS=''
NO_AS_NEEDED=''
OBJEXT='o'
OPENSSL_INCLUDES=''
OPENSSL_LDFLAGS=''
OPENSSL_LIBS=''
OPT=''
OTHER_LIBTOOL_OPT=''
PACKAGE_BUGREPORT='https://bugs.python.org/'
PACKAGE_NAME='python'
PACKAGE_STRING='python 3.8'
PACKAGE_TARNAME='python'
PACKAGE_URL=''
PACKAGE_VERSION='3.8'
PATH_SEPARATOR=':'
PGO_PROF_GEN_FLAG=''
PGO_PROF_USE_FLAG=''
PKG_CONFIG=''
PKG_CONFIG_LIBDIR=''
PKG_CONFIG_PATH=''
PLATFORM_TRIPLET='darwin'
PY3LIBRARY=''
PYTHONFRAMEWORK=''
PYTHONFRAMEWORKDIR='no-framework'
PYTHONFRAMEWORKIDENTIFIER='org.python.python'
PYTHONFRAMEWORKINSTALLDIR=''
PYTHONFRAMEWORKPREFIX=''
PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
PYTHON_FOR_REGEN='python3.8'
PY_ENABLE_SHARED=''
READELF=''
RUNSHARED=''
SED='/usr/bin/sed'
SHELL='/bin/sh'
SHLIBS=''
SHLIB_SUFFIX=''
SOABI=''
SOVERSION='1.0'
SRCDIRS=''
TCLTK_INCLUDES=''
TCLTK_LIBS=''
THREADHEADERS=''
TRUE=''
UNIVERSALSDK=''
UNIVERSAL_ARCH_FLAGS=''
VERSION='3.8'
_PYTHON_HOST_PLATFORM=''
ac_ct_AR=''
ac_ct_CC='clang'
ac_ct_CXX=''
ac_ct_READELF=''
bindir='${exec_prefix}/bin'
build='x86_64-apple-darwin21.4.0'
build_alias=''
build_cpu='x86_64'
build_os='darwin21.4.0'
build_vendor='apple'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-apple-darwin21.4.0'
host_alias=''
host_cpu='x86_64'
host_os='darwin21.4.0'
host_vendor='apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target=''
target_alias=''
target_cpu=''
target_os=''
target_vendor=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define _GNU_SOURCE 1
#define _NETBSD_SOURCE 1
#define __BSD_VISIBLE 1
#define _DARWIN_C_SOURCE 1
#define _PYTHONFRAMEWORK ""
#define _XOPEN_SOURCE 700
#define _XOPEN_SOURCE_EXTENDED 1
#define _POSIX_C_SOURCE 200809L

configure: exit 1

@ronaldoussoren
Copy link
Contributor

Which version of Python are you trying to build? Given the config.log it is a version of Python 3.8, but doesn't mention the micro release.

I cannot reproduce the issue with the latest 3.8 version, but can do so using an older micro version (I checked with 3.8.0 and 3.8.4).

Also: Did you rebuild the configure script? The line number for checking for the platform triplet based on compiler characteristics does not match any of the 3.8 tags in the repository.

ronaldoussoren added a commit that referenced this issue Nov 21, 2022
Fix a number of compile errors with GCC-12 on macOS:

1. In pylifecycle.c the compile rejects _Pragma within a declaration
2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS
3. _ctypes assumed that __builtin_available is always present on macOS
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 21, 2022
Fix a number of compile errors with GCC-12 on macOS:

1. In pylifecycle.c the compile rejects _Pragma within a declaration
2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS
3. _ctypes assumed that __builtin_available is always present on macOS
(cherry picked from commit cdde29d)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
ronaldoussoren added a commit that referenced this issue Nov 21, 2022
…99638)

gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470)

Fix a number of compile errors with GCC-12 on macOS:

1. In pylifecycle.c the compile rejects _Pragma within a declaration
2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS
3. _ctypes assumed that __builtin_available is always present on macOS
(cherry picked from commit cdde29d)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
@ronaldoussoren
Copy link
Contributor

The GCC 12 build error will be fixed for 3.12 and 3.11, I've just merged my PRs for that. The automatic back port to 3.10 failed and I don't care enough about GCC to try to do a manual back port.

The configure error with clang is likely due to using a old version of Python 3.8, see my previous message.

I'm therefore closing this issue.

@addlistener
Copy link
Author

Caught up in other project these days. We eventually kinda moved to using scripts built by a mature 3rd party.

Thanks anyway. I don't care enough about GCC to try to do a manual back port. Totally agree there will be priority differences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-mac type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants