Zlibc has been tested on three variants of Unix so far: Linux, SunOs, Solaris. On all three platforms, zlibc has been compiled using GNU make and gcc. However, porting it to other platforms should be straightforward as long as they verify both of the following conditions:
-nostdlib -shared
to
gcc in addition to the usual CFLAGS
. If your target platform
needs different flags to make shared libraries, change the definition of
the variable SHAREDCFLAGS
in the Makefile.
open("test", O_RDONLY)
directly,
sycall(SYS_open, "test", O_RDONLY)
is called.
If your target platform uses a different way to perform direct
system calls, you need to supply different definitions for the real_xxx
functions in direct_sys.h. This is the case for AIX.
LD_PRELOAD
variable to the object file to be used.
Unfortunately, I have found no way to achieve this on AIX. Any ideas
about how to do this are welcome.
Many platforms, including Solaris, provide several aliases for their
syscall stubs. It would be interesting to leave one of them alone, and
use it as a "direct syscall" stub, but unfortunately, it turns out that
in sometimes both stubs are used by the library! Thus, what would be an
advantage, becomes actually a disadvantage, because we will need to
override these aliases in addition to the canonical names. This is done
in altnames.c. Change it as needed. In order to know the names of
these aliases, try the following command: nm /lib/libc.so | grep
lstat
. This lists any library symbols with unlink
in their
name, which could be aliases.
If you have successfully ported zlibc to a new platform, could you drop me a note, so that I can include support for that platform in my next release. Thanks
Go to the first, previous, next, last section, table of contents.