-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Python 2.7rc2 includes -isysroot twice on each gcc command line #53293
Comments
|
A typical build line looks like this: gcc-4.0 -c -fno-strict-aliasing -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -isysroot /Developer/SDKs/MacOSX10.4u.sdk -DPy_BUILD_CORE -o Python/codecs.o Python/codecs.c With older Xcode releases, the above is known not to work at all: gcc simply gives up and raises an error. With the latest Xcode available for 10.3 (last release + all patches), gcc accepts the extra options, but it's not clear whether the resulting code will work... mostly due to bpo-9046: Python 2.7rc2 doesn't build on Mac OS X 10.3. The two issues could also be connected. |
|
Note that the duplicate insertion of -isysroot happens because CPPFLAGS was changed to include this extra option. Since PY_CFLAGS includes both CFLAGS and CPPFLAGS, you get the duplicate occurrence. In Python 2.6, the extra option did appear in CPPFLAGS. |
|
Sigh. -isysroot was added to CPPFLAGS because Python wouldn't build as a universal binary anymore due a fix for bpo-1628484. (According to the SVN log for r80187). I'll see what can be done to avoid adding -isysroot twice to the compiler flags. |
|
Marc-Andre: is this still relevant or did the fix for SDK support enough to fix the build. BTW. Is this for OSX 10.4 instead of 10.3? AFAIK the compiler on 10.3 doesn't support SDKs at all. |
|
The root cause of having the flags twice is that the Makefile explicitly sets LDFLAGS in the environment before when running setup.py, and that distutils appens the value of Line from the makefile: And in Lib/distutils/ccompiler.py (in customize_compiler): if 'LDFLAGS' in os.environ:
ldshared = ldshared + ' ' + os.environ['LDFLAGS']A quick workaround to remove the duplicate flags is to explictly remove the related values from os.environ before calling main in setup.py: # --install-platlib
if __name__ == '__main__':
import os
del os.environ['LDFLAGS']
main()I've attached a patch that implements this behavior. I'm not 100% sure this is the right solution because sysconfig._parse_makefile also looks at the environment and it may be better to remove the code from ccompiler.customize_compiler instead. |
|
The patch is not sufficient to fix this issue. One problem is that the configure script also using CFLAGS and CPPFLAGS, which results in duplicate -isysroot flags when the compiler is used by configure. Fixing this properly is annoyingly hard, I'll have to write down a dataflow graph to find a way to set -isysroot and the -arch flags in the minimal amount of locations to get the right behavior and to get rid of duplicate flags. |
|
Marc-Andre: does the current HEAD of the 2.7 and 3.2 branches work for you? The build still has duplicate flags, but that doesn't seem to cause problems on my machines. If it also doesn't cause problems on your machines I'd prefer to close this issue as won't fixed because cleaning up the duplicate flags is non-trivial. |
|
Ronald Oussoren wrote:
I'll give this a try tomorrow. |
|
Can this be closed now? |
|
This is no longer a problem on any machine I have access to, I'm therefore closing this issue. Please reopen if you still have problems on your machine, if you do so include detailed information about: OSX release, system architecture (ppc, i386), Xcode release used. |
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: