-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Failed to build with --with-cxx-main=g++-9.2.0 #83878
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
Comments
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 I suppose simply PS: as a workaround, |
See also https://bugs.python.org/issue23644 |
I think in this case the error is more trivial: simply Indeed, there are much gcc-only options in the compilation of
|
_testembed is build by Makefile: Programs/_testembed: Programs/_testembed.o with: MAINCC= $(CC) I'm not sure how g++ landed in LINKCC or MAINCC. |
This issue is unrelated and has been fixed. |
The problem is here: Programs/_testembed.o: $(srcdir)/Programs/_testembed.c
I replaced |
Mmmmhhhh... wait a moment. It seems the behavior is intended: https://bugs.python.org/issue1324762 I quote: The patch contains the following changes: Honestly I have _no idea_ why this change was made. Unluckily, the link to the discussion is broken. |
What seems to be, at least, the conclusion of the thread: https://mail.python.org/archives/list/python-dev@python.org/thread/YXMD5EIHAODRZGTQ3HU74OPGEBAVCSK6/ |
Okay... if I have understood well, the problem is with C++ Extensions. Some questions:
|
Furthermore, I have not understood a think: if I understood well, --with-cxx-main is used on _some_ platforms that have problems with C++ extensions. What platforms? Is there somewhere a unit test for testing if Python compiled on one of these platforms with -with-cxx-main=<some_c++_compiler> works, and if a C++ extension works with this build? |
This seems like a duplicate of https://bugs.python.org/issue35912 |
I marked bpo-35912 as a duplicate of this issue (which has a longer history). |
I agree with Pablo Galindo Salgado: https://bugs.python.org/issue35912#msg334942 The "quick and dirty" solution is to change MAINCC to CC, for _testembed.c AND python.c (g++ fails with both). After that, _testembed.c and python.c should be changed so they can be compiled with a c++ compiler, and a system test should be added. Anyway, I found the original patch: In the original patch, the README contained detailed information. I think these informations could be restored, maybe in ./configure --help Anyway, I have a question. In README, it's stated: There are platforms that do not require you to build Python All x86 platforms? Also x86-64? And what does it means "Linux with ELF"? It means that Linux has shared libraries or that Python is compiled with --enable-shared? And what it means gcc 3 and 4? It means gcc 3+? |
This was already fixed in #93744. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: