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
_scproxy and Python Launcher fail to build wtih GNU gcc on macOS 10.13+ #70505
Comments
Changes to OS X 10.11 render GCC's Objective-C compiler useless. However, I want to compile the main part of Python in GCC (because my C++ / Fortran Cython modules use GCC). I tried to build Python (via MacPorts) using Clang for Objective-C and GCC for C/C++. The environment upon running ./configure included: CC='/Users/rpfische/macports/mpgompi-4.9.3/bin/gcc-mp-4.9' HOWEVER... the build still tried to use GCC to compile Objective-C, and failed miserably: :info:destroot /Users/rpfische/macports/mpgompi-4.9.3/bin/gcc-mp-4.9 -pipe -Os -arch x86_64 -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -o FileSettings.o -c ./FileSettings.m Log file attached. |
The build fails while building the "Python Launcher" application. This is an Objective-C project. If GCC doesn't support the system headers on OSX 10.11 there's nothing the Python project can do about that. |
I'm trying to compile the Objective-C portions of Python (the Python On Tue, Feb 9, 2016 at 6:39 AM, Ronald Oussoren <report@bugs.python.org>
|
The makefiles use CC throughout and don't look at and OBJC variable. Is that variable a standard way to specify an ObjC compiler in makefiles? Make's default ruleset for compiling .m files uses I wouldn't be opposed to a patch that makes it possible to specify an ObjC compiler, could you write such a patch? BTW. The patch should also update the autoconf script (use AC_PROG_OBJC). |
I believe that OBJC and OBJCFLAGS are standard for Autoconf/Automake: https://www.gnu.org/software/automake/manual/html_node/Objective-C-Support.html I wouldn't be opposed to a patch that makes it possible to specify an ObjC
Sorry, I don't do Autotools --- a software package that came to us directly |
3.4 only gets security fixes |
Could this be fixed on 3.5 and 3.6? On Fri, Feb 12, 2016 at 2:34 PM, Terry J. Reedy <report@bugs.python.org>
|
When you reply by email to an email, please snip off the quote, except for possible a line that you are responding to. The disposition of this issue for 3.5+ is up to Ned or Ronald. |
3.5 is and 3.6 will soon be on security fix only status. Robert, please verify that this is still an issue with 3.7 and the current build files. |
This is still an issue with the 3.7 and the master branches. The Objective-C portion of the build still fails with gcc 8.3.0 on OS X Mojave (14.x). Specifying OBJC and OBJC++ on the configure command line does nothing because there is nothing in the script using the options. |
Module/_scproxy.c compiles cleanly with clang 10.0.0 and fails with GNU gcc 8.3.0. Below is the relevant compiler error: building '_scproxy' extension
gcc-8 -Wno-unused-result -Wsign-compare -g -Og -Wall -pipe -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I../cpython/Include/internal -I../cpython/Include -IObjects -IPython -I. -I/usr/local/opt/zlib/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/ossp-uuid/1.6.2_2/include -I/usr/local/include -I/Users/jeff/sandbox/src/python3.7/cpython/Include -I/Users/jeff/sandbox/src/python3.7/build -c /Users/jeff/sandbox/src/python3.7/cpython/Modules/_scproxy.c -o build/temp.macosx-10.14-x86_64-3.8-pydebug/Users/jeff/sandbox/src/python3.7/cpython/Modules/_scproxy.o
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h:32,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:42,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferences.h:35,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/SystemConfiguration.framework/Headers/SystemConfiguration.h:126,
from /Users/jeff/sandbox/src/python3.7/cpython/Modules/_scproxy.c:6:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h:193:7:error: variably modified 'bytes' at file scope
char bytes[kAuthorizationExternalFormLength];
^~~~~
building 'zlib' extension |
THe _scproxy.c compile error is a separate issue. The problem arises in an Apple-supplied include file and there are many reports on the web of clang vs gcc differences like this. I'm not sure what we could or should do about it other than forcing _scproxy to always be compiled with clang or figure out a way to avoid use of that include file hierarchy. |
My mistake was not adding --enable-framework=${HOME}/sandbox/src/python3.7/inst to the configure script and then running make (I know... read the README file) gcc 8.3.0 doesn't like the Xcode system headers included by the .m files. I will dig into this now that I am using the proper build steps. As a side note, I find it counter-intuitive that Mac/Makefile only gets invoked by 'make install' to build the Objective-C source files. IMHO they should be built by "make" and then installed by "make install". Forcing a build and install in one step can be dangerous and accidentally leave the system in an undesirable state when the build process fails with a partial install. Also, --enable-framework should use a subpath of --prefix by default for the framework installation instead of defaulting to /Library/Frameworks regardless of the --prefix setting. |
I got it to build PythonLauncher using clang and everything else using gcc 8.3.0 by making a few configure script and makefile changes. Unfortunately, "make install" still fails because a python script that requires the unbuilt _scproxy module crashes. I'll work on fixing that next. |
I submitted a pull request that fixes both the PythonLauncher build issue and the _scproxy module build issue. They are related because _scproxy is required to install PythonLauncher. |
Any progress? |
I met this issue during I compile with gcc9 on my local mac machine. |
The progress was the PR. I just fixed the merge conflicts, I believe correctly. Please test and review. |
Thanks, Terry. I'll look at it shortly. |
Thanks everyone for their comments and reviews and a very big thank you to Jeffrey for working through the details and providing a solid PR. The change will appear in the 3.9.0b1 pre-release. |
This change broke the Python compilation on FreeBSD: Either revert it (and re-apply a fixed change after beta1), or fix it. I suggest to block Python 3.9 beta1 release until it's resolved. I consider that FreeBSD is a supported platform. |
Sorry about that! Looking now. |
I'm not sure yet exactly what the problem is but it's almost certainly a difference between GNU make and BSD make and something that needs to be checked on FreeBSD. With the 3.9.0b1 cutoff coming very soon, I likely won't be able to test on FreeBSD before then so I have reverted the change for now. Sigh! |
I tested manually and I confirm that FreeBSD builds again, thanks :-) |
Also there was FLAFS typo in this line, which is probably not needed at all: AC_SUBST(OBJCXX) was added, but there was no usage of @OBJCXX@ anywhere... |
Is this still a valid issue? @corona10? |
The original PR to add separate OBJC config variables was reverted due to the buildbot failures and was never reapplied. So I expect it is still an issue for those who want to try to build Python on macOS with gcc. It's not something we recommend and is perhaps of even less importance with the introduction of Apple Silicon Macs and their build dependencies on the Apple compiler tool chain. I don't have any immediate plans to pursue it so I'm deassigning myself if someone else wants to jump in. |
Also, the PR would need to be updated to deal with the subsequent changes to Modules/Setup et al to allow building of _scproxy without Distutils. |
I'm marking it as pending (close). If Dong-hee or anyone else want to pursue this, feel free to remove the label and pick up the loose ends. |
No-one has jumped in here. Closing this; feel free to reopen if you disagree. |
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: