Re: Commented: (MODPYTHON-65) 3.2 working version will not
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Re: Commented: (MODPYTHON-65) 3.2 working version will not




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: Commented: (MODPYTHON-65) 3.2 working version will not  
Jim Gallacher


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-22-05 10:46 PM

The patch causes no problems for me, but then I'm not using Mac OS X 

If there are no objections I'll apply the patch and commit.

Regards,
Jim

Graham Dumpleton (JIRA) wrote:
>     [ http://issues.apache.org/jira/brows...r />
_12316435 ]
>
> Graham Dumpleton commented on MODPYTHON-65:
> -------------------------------------------
>
> The problem here is that on Mac OS X, distutils compiles Python
> loadable modules in a way that expects all symbols to be resolvable
> at the time the module is created. That is, all symbols must be present
> in either the objects being linked into the module or in libraries which
> are explicitly linked with the module.
>
> In a scenario like mod_python where there will be undefined references
> to symbols which are only defined within the executable running the
> interpreter into which the module is loaded, this will fail.
>
> Previously this wasn't a problem because distutils wasn't used to
> create the module and instead the makefile use libtool to do it. One of
> the options to libtool was "--silent". This option (at least I think so, i
t may
> be a different option), would underneath pass appropriate options to
> the linker for a platform to disable undefined symbols causing an error.
>
> Since distutils is now used, there is going to have to be platform specifi
c
> hacks to add additional options to the link line when creating a module
> to add these platform specific options. This however is not as simple as
> defining extra_link_flags to the distutils extension object as they will o
nly
> be placed at the end. These magic options tend to be positional
> dependent and need to be included at a specific spot early in the
> link line. The distutils package does not give you this level of control
> through its public APIs and thus a hack is required which delves into
> its private parts. If distutils changes, like it did from 2.2 to 2.3, this
 hack
> will break and no longer work.
>
> This problem may affect other platforms besides MacOSX as there are
> other platforms that also require specific options to ignore undefined
> symbols.
>
> Anyway, the hack required to get this to work for Mac OS X with Python 2.3
> is as follows. If you know of a better way, by all means let me know. :-)
>
> Index: dist/setup.py.in
>  ========================================
===========================
> --- dist/setup.py.in    (revision 220194)
> +++ dist/setup.py.in    (working copy)
> @@ -85,7 +85,7 @@
>      """returns apache lib directory"""
>      apache_srcdir = getapache_srcdir()
>      if apache_srcdir is None:
> -        return ""
> +        return getapxs_option("LIBDIR")
>      else:
>          return os.path.join(apache_srcdir, "lib")
>
> @@ -153,6 +153,17 @@
>      scripts = []
>      data_files = []
>
> +import string
> +from distutils import sysconfig
> +
> +if sys.platform == "darwin":
> +    sysconfig._config_vars["LDSHARED"] = \
> +            string.replace(sysconfig.get_config_var("LDSHARED"), \
> +            " -bundle "," -bundle -flat_namespace -undefined suppress ")
> +    sysconfig._config_vars["BLDSHARED"] = \
> +            string.replace(sysconfig.get_config_var("BLDSHARED"), \
> +            " -bundle "," -bundle -flat_namespace -undefined suppress ")
> +
>  setup(name="mod_python",
>        version=VER,
>        description="Apache/Python Integration",
>
>
>
>
> 
>
> 
.darwin-7.7.0-Power_Macintosh-2.3/Users/grahamd/Workspaces/mod_python/src/co
nnobject.o build/temp.darwin-7.7.0-Power_Macintosh-2.3/Users/grahamd/Workspa
ces/mod_python/src/filterobject.o build/temp.darwin-7.7.0-Power_Macintosh-2.
3/Users/grahamd/Workspaces/
mod_python/src/hlist.o build/temp.darwin-7.7.0-Power_Macintosh-2.3/Users/gra
hamd/Workspaces/mod_python/src/hlistobject.o build/temp.darwin-7.7.0-Power_M
acintosh-2.3/Users/grahamd/Workspaces/mod_python/src/requestobject.o build/t
emp.darwin-7.7.0-Power_Maci
ntosh-2.3/Users/grahamd/Workspaces/mod_python/src/serverobject.o build/temp.
darwin-7.7.0-Power_Macintosh-2.3/Users/grahamd/Workspaces/m
od_python/src/tableobject.o build/temp.darwin-7.7.0-Power_Macintosh-2.3/User
s/grahamd/Work
spaces/mod_python/src/util.o -L -lapr-0 -laprutil-0 -o build/lib.darwin-7.7.0-Power_Macintos
h-2.3/mod_python_so.so[vbcol=seagreen] 
>
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:50 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register