New submission from Marco Sulla <[email protected]>:
I tried to compile Python 3.9 with:
CC=gcc-9.2.0 ./configure --enable-optimizations --with-lto
--with-cxx-main=g++-9.2.0
make -j 2
I got this error:
g++-9.2.0 -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99
-Wextra -Wno-unused-result -Wno-unused-parameter
-Wno-missing-field-initializers -Werror=implicit-function-declaration
-fvisibility=hidden -fprofile-generate -I./Include/internal -I. -I./Include
-DPy_BUILD_CORE -o Programs/_testembed.o ./Programs/_testembed.c
cc1plus: warning: ‘-Werror=’ argument ‘-Werror=implicit-function-declaration’
is not valid for C++
cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not
for C++
sed -e "s,@EXENAME@,/usr/local/bin/python3.9," < ./Misc/python-config.in
>python-config.py
LC_ALL=C sed -e 's,\$(\([A-Za-z0-9_]*\)),\$\{\1\},g' < Misc/python-config.sh
>python-config
gcc-9.2.0 -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3
-Wall -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g
-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter
-Wno-missing-field-initializers -Werror=implicit-function-declaration
-fvisibility=hidden -fprofile-generate -I./Include/internal -I. -I./Include
-DPy_BUILD_CORE \
-DGITVERSION="\"`LC_ALL=C git --git-dir ./.git rev-parse --short HEAD`\""
\
-DGITTAG="\"`LC_ALL=C git --git-dir ./.git describe --all --always
--dirty`\"" \
-DGITBRANCH="\"`LC_ALL=C git --git-dir ./.git name-rev --name-only
HEAD`\"" \
-o Modules/getbuildinfo.o ./Modules/getbuildinfo.c
In file included from ./Include/internal/pycore_atomic.h:15,
from ./Include/internal/pycore_gil.h:11,
from ./Include/internal/pycore_pystate.h:11,
from ./Programs/_testembed.c:10:
/usr/local/lib/gcc/x86_64-pc-linux-gnu/9.2.0/include/stdatomic.h:40:9: error:
‘_Atomic’ does not name a type
I suppose simply `Programs/_testembed.c` is a C source file and must not be
compiled with g++
PS: as a workaround, `--with-cxx-main=gcc-9.2.0` works, but probably it's not
optimal.
----------
components: Build
messages: 362313
nosy: Marco Sulla
priority: normal
severity: normal
status: open
title: Failed to build with --with-cxx-main=g++-9.2.0
type: enhancement
versions: Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39697>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com