
Does anybody know why I'm getting the following error when compiling an extension module with gcc and distutils? The compile line works fine when I run it by hand, but when distutils runs it I get the following error: gcc: cannot specify -o with -c or -S and multiple compilations error: command 'gcc' failed with exit status 1 Here's the line that causes the error: gcc -DNDEBUG -O3 -I/sw/globus/globus/include/gcc32dbgpthr -I/sw/include/python2.2 -c src/ftpControl_wrap.c -o build/temp.darwin-6.4-PowerMacintosh-2.2/ftpControl_wrap.o Any thoughts? thx, --keith

FYI, we finally figured this out sort of. The problem arises when a list containing only the empty string is passed into the extra_compile_args argument to Extension. This came up since we're getting some CFLAGS settings from the package we're wrapping. A simple check to ensure we have a real value for this solves the problem. I still have no clue why this happens though. Just thought I'd send out a response in case this bites anyone else. --keith On Wednesday, March 19, 2003, at 06:20 PM, Keith Jackson wrote:

On Tue, May 13, 2003 at 03:20:17PM -0700, Keith Jackson wrote:
At least on platforms that use unixccompiler.py, the contents of the extra_compile_args list ends up being passed to os.execvp(). An empty string therefore ends up looking like the shell invocation 'gcc --foo --bar --baz ""', and the zero-length string argument must mess things up. Protection against this might be added by dropping all empty strings from the list, but I don't think that's a good idea; if this was done, how would you supply an empty string when you really want to? --amk (www.amk.ca) "Mr. Holmes, they were the footprints of a gigantic hound!" -- Dr Mortimer, in "The Hound of the Baskervilles"

FYI, we finally figured this out sort of. The problem arises when a list containing only the empty string is passed into the extra_compile_args argument to Extension. This came up since we're getting some CFLAGS settings from the package we're wrapping. A simple check to ensure we have a real value for this solves the problem. I still have no clue why this happens though. Just thought I'd send out a response in case this bites anyone else. --keith On Wednesday, March 19, 2003, at 06:20 PM, Keith Jackson wrote:

On Tue, May 13, 2003 at 03:20:17PM -0700, Keith Jackson wrote:
At least on platforms that use unixccompiler.py, the contents of the extra_compile_args list ends up being passed to os.execvp(). An empty string therefore ends up looking like the shell invocation 'gcc --foo --bar --baz ""', and the zero-length string argument must mess things up. Protection against this might be added by dropping all empty strings from the list, but I don't think that's a good idea; if this was done, how would you supply an empty string when you really want to? --amk (www.amk.ca) "Mr. Holmes, they were the footprints of a gigantic hound!" -- Dr Mortimer, in "The Hound of the Baskervilles"
participants (2)
-
Andrew Kuchling
-
Keith Jackson