Works on Ubuntu Linux with apache2. This page is a collection of random thoughts. Read it all, if you want to reproduce this.
The apache daemon loads shared libraries with
RTLD_GLOBAL. That means, that
the global universe variable is shared between modules. Therefore only one
global variable (not hashtable) universe exists and the modules share the
libMulleObjC-standalone.so loaded by the first extension.
Care must be taken, that classes have differing names.
How to reproduce
Build as explained in
Memo: Apache/Libtool/ObjCthen also build the second example in src2 likewise. Also install the
Feature: Named Universes
This is done in by specifying
Tweaks used to build the first universe
-DSTANDALONE=ON, so that MulleObjC gets build as a shared library, but not the constituent static libraries.
- Specified a craftinfo for MulleObjC so that
OTHER_CFLAGSis set to
- Otherwise do as explained way below, and don't forget to copy the .so file.
Tweaks used to build the second universe
- remove the old stuff with
mulle-sde clean all
- Specified a craftinfo for MulleObjC so that OTHER_CFLAGS is set to
-fobjc-universename="vfl1849"(a different universename)
- Change the soname of the standalone library to
- rename built standalone library to
libMulleObjC2-standalone.soand copy it to
- Go into src2 and make and make install
mulle-sde environment list
This makes it not feasible to link ObjC code statically into a Libtooling environment such as an apache module. But linking a shared library to a C apache module is not a problem.
Build MulleObjC with STANDALONE.
Note: use tweak idea above
mulle-sde -v craft buildorder --release -- -DSTANDALONE=ON
sudo cp -a ../dependency/lib/libMulleObjC-standalone.so /usr/lib
Since we are going to install into
LD_RUN_PATH seems pointless.
Now build and install the module:
sudo make install
sudo apache2ctl restart
LD_LIBRARY_PATH would be pointless, because the apache daemon doesn't seem to pick it up. Or we would have to edit
This is a partial mulle-sde project.
Now you can let mulle-sde fetch the required dependencies and build the project for you:
mulle-sde craft buildorder
Venture into the
src directory and run
Read mulle_objc_example.c for more information.
apache2 contains configuration files that need to be added after
sudo make install
How to debug inside the apache.
$ sudo -s
# . /etc/apache2/envvars
# MULLE_SDE_TRACE_UNIVERSE=YES \
gdb> set verbose on
gdb> run -X