ramkrishanbhatt / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

mod_wsgi 2.4c1 fails to link universal on Mac OS X Leopard Server #141

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
$ ./configure 
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.9
checking for python... /usr/bin/python
configure: creating ./config.status
config.status: creating Makefile

$ make
/usr/sbin/apxs -c 
-I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 
-DNDEBUG -
DMACOSX -DENABLE_DTRACE  -Wc,'-arch ppc7400' -Wc,'-arch ppc64' -Wc,'-arch i386' 
-Wc,'-arch x86_64' mod_wsgi.c 
-Wl,-F/System/Library/Frameworks -Wl,-framework -Wl,Python -Wl,-u 
-Wl,_PyMac_Error -Wl,-framework -Wl,Python -
Wl,-arch -Wl,ppc7400 -Wl,-arch -Wl,ppc64 -Wl,-arch -Wl,i386 -Wl,-arch 
-Wl,x86_64 -Wl,-ldl
/usr/share/apr-1/build-1/libtool --silent --mode=compile gcc    -DDARWIN 
-DSIGPROCMASK_SETS_THREAD_MASK -
no-cpp-precomp  -I/usr/include/apache2  -I/usr/include/apr-1   
-I/usr/include/apr-1  -arch ppc7400 -arch ppc64 -
arch i386 -arch x86_64 
-I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 
-DNDEBUG 
-DMACOSX -DENABLE_DTRACE  -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
/usr/share/apr-1/build-1/libtool --silent --mode=link gcc -o mod_wsgi.la  
-rpath /usr/libexec/apache2 -module -
avoid-version    mod_wsgi.lo -Wl,-F/System/Library/Frameworks -Wl,-framework 
-Wl,Python -Wl,-u -Wl,_PyMac_Error -
Wl,-framework -Wl,Python -Wl,-arch -Wl,ppc7400 -Wl,-arch -Wl,ppc64 -Wl,-arch 
-Wl,i386 -Wl,-arch -Wl,x86_64 -
Wl,-ldl
ld warning: in /usr/lib/gcc/i686-apple-darwin9/4.0.1/libgcc.a, file is not of 
required architecture

Below is a diff of the makefiles for 2.3 and 2.4c1

-LDFLAGS =  -arch ppc7400 -arch ppc64 -arch i386 -arch x86_64 
-Wl,-F/System/Library/Frameworks -framework 
Python -u _PyMac_Error -framework Python
-LDLIBS = -ldl
+LDFLAGS = -Wl,-F/System/Library/Frameworks -Wl,-framework -Wl,Python -Wl,-u 
-Wl,_PyMac_Error -Wl,-framework 
-Wl,Python -Wl,-arch -Wl,ppc7400 -Wl,-arch -Wl,ppc64 -Wl,-arch -Wl,i386 
-Wl,-arch -Wl,x86_64
+LDLIBS = -Wl,-ldl

Original issue reported on code.google.com by roy.jean...@gmail.com on 4 Apr 2009 at 7:51

GoogleCodeExporter commented 8 years ago
The message:

  ld warning: in /usr/lib/gcc/i686-apple-darwin9/4.0.1/libgcc.a, file is not of required architecture

is a waning message, it doesn't stop it working.

Original comment by Graham.Dumpleton@gmail.com on 4 Apr 2009 at 9:08

GoogleCodeExporter commented 8 years ago
BTW, the linking of that library appears to be done internal to the compiler, 
or maybe in libtool or apxs. Either 
way, have no way to remove it from the link line and thus get rid of the 
warning.

Also be aware that 2.4c1 is a release candidate of 2.4 and not actual 2.4 final 
version.

Original comment by Graham.Dumpleton@gmail.com on 4 Apr 2009 at 9:42

GoogleCodeExporter commented 8 years ago
Perhaps I wasn't clear. The "warning" really is an error in the sense that the 
produced .so will only contain one 
architecture instead of being universal. This in turn means that you won't be 
able to run Apache 2 in 32-bit 
mode or 64-bit mode depending on which architecture was left out.

So yeah, it does stop it from working. For example, in my specific case, I need 
to run Apache 2 in 32-bit mode, 
but the produced mod_wsgi.so library only contains an x86_64 slice.

Original comment by roy.jean...@gmail.com on 4 Apr 2009 at 10:03

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I should also add that the problem is not that internal GCC static library per 
se. The problem appears to be the 
Makefile passing invalid or bad flags to the linker. This is a regression from 
the 2.3 Makefile.

Original comment by roy.jean...@gmail.com on 4 Apr 2009 at 10:05

GoogleCodeExporter commented 8 years ago
Okay. The issue is:

$ file .libs/mod_wsgi.so 
.libs/mod_wsgi.so: Mach-O 64-bit bundle x86_64

Only x86_64.

Original comment by Graham.Dumpleton@gmail.com on 4 Apr 2009 at 10:15

GoogleCodeExporter commented 8 years ago
That's indeed the issue. But I've also seen it produce a .so with only i386. It 
may be sensitive to the order of the 
arguments passed to the linker or some other factor. This "quirk" is however 
largely irrelevant to the issue.

Original comment by roy.jean...@gmail.com on 4 Apr 2009 at 10:20

GoogleCodeExporter commented 8 years ago
The problem is 'apxs'. The behaviour of the tool change in Apache 2.3. I was 
trying to make the mod_wsgi 
configure script work for both, but although it works for Apache 2.3, it has 
broken it for older Apache versions. I 
am going to have to revert the change and try and deal with Apache 2.3 later 
when it actually gets closer to 
actually being released. It is possible that they may realise they have changed 
the apxs behaviour and put it back 
to how it was.

Original comment by Graham.Dumpleton@gmail.com on 4 Apr 2009 at 10:57

GoogleCodeExporter commented 8 years ago
Try mod_wsgi-2.4c2 instead.

Original comment by Graham.Dumpleton@gmail.com on 4 Apr 2009 at 11:16

GoogleCodeExporter commented 8 years ago

Original comment by Graham.Dumpleton@gmail.com on 4 Apr 2009 at 11:18

GoogleCodeExporter commented 8 years ago
Version 2.4 of mod_wsgi now released.

Original comment by Graham.Dumpleton@gmail.com on 11 Apr 2009 at 10:25