This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年06月21日 18:38 by lemburg, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| setup.py.patch | ronaldoussoren, 2010年07月24日 12:10 | review | ||
| Messages (10) | |||
|---|---|---|---|
| msg108295 - (view) | Author: Marc-Andre Lemburg (lemburg) * (Python committer) | Date: 2010年06月21日 18:38 | |
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 #9046: Python 2.7rc2 doesn't build on Mac OS X 10.3. The two issues could also be connected. |
|||
| msg108296 - (view) | Author: Marc-Andre Lemburg (lemburg) * (Python committer) | Date: 2010年06月21日 18:39 | |
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. |
|||
| msg108356 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2010年06月22日 10:17 | |
Sigh. -isysroot was added to CPPFLAGS because Python wouldn't build as a universal binary anymore due a fix for issue 1628484. (According to the SVN log for r80187). I'll see what can be done to avoid adding -isysroot twice to the compiler flags. |
|||
| msg108786 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2010年06月27日 12:54 | |
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. |
|||
| msg111465 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2010年07月24日 12:10 | |
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 $(LDFLAGS) to $(LDSHARED) when LDFLAGS is set in the environment. Line from the makefile: $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build; 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. |
|||
| msg113163 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2010年08月07日 10:16 | |
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. |
|||
| msg119212 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2010年10月20日 14:59 | |
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. |
|||
| msg119654 - (view) | Author: Marc-Andre Lemburg (lemburg) * (Python committer) | Date: 2010年10月26日 22:06 | |
Ronald Oussoren wrote: > > Ronald Oussoren <ronaldoussoren@mac.com> added the comment: > > 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. I'll give this a try tomorrow. |
|||
| msg122061 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2010年11月22日 02:02 | |
Can this be closed now? |
|||
| msg131123 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2011年03月16日 14:51 | |
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. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:02 | admin | set | github: 53293 |
| 2011年03月16日 14:51:00 | ronaldoussoren | set | status: open -> closed nosy: lemburg, ronaldoussoren, tarek, ned.deily, eric.araujo messages: + msg131123 resolution: works for me type: compile error stage: resolved |
| 2010年11月22日 02:02:42 | ned.deily | set | nosy:
+ ned.deily messages: + msg122061 |
| 2010年10月26日 22:06:40 | lemburg | set | messages: + msg119654 |
| 2010年10月20日 14:59:24 | ronaldoussoren | set | messages: + msg119212 |
| 2010年08月21日 22:37:44 | eric.araujo | set | nosy:
+ eric.araujo |
| 2010年08月07日 10:16:19 | ronaldoussoren | set | messages: + msg113163 |
| 2010年07月24日 12:10:53 | ronaldoussoren | set | files:
+ setup.py.patch nosy: + tarek messages: + msg111465 keywords: + patch |
| 2010年06月27日 12:54:23 | ronaldoussoren | set | messages: + msg108786 |
| 2010年06月22日 10:17:51 | ronaldoussoren | set | messages: + msg108356 |
| 2010年06月21日 18:39:33 | lemburg | set | messages: + msg108296 |
| 2010年06月21日 18:38:12 | lemburg | create | |