Age | Commit message (Collapse) | Author | Files | Lines |
|
A bit more ifdef __APPLE__ testing was needed.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
|
|
- Implemented a special mapping function for /proc, to be
able to map the symlink at /proc/self/exe.
- This can be described as a countermeasure to side-effects of
mapping exec parameters: /proc/self/exe (as well as
/proc/<MY_PID>/exe, which is the same thing) need special care
if the binary was started by anything else than direct exec.
Examples:
a) if CPU transparency is used, the real /proc/self/exe points
to e.g. Qemu. Now SB2 can make it look like the link points
to the binary which is running under qemu.
b) if "ld.so-start" was used, the real /proc/self/exe points to
ld.so and not to the binary itself. Again, SB2 maps that
to a symlink which points to the correct binary.
Other related things:
- all mapping modes use this feature now
- Lua <=> C interface version had to be incremented
- Lua mapping code <=> mapping rules version had to be incremented
|
|
- Added a pathname cache/db, which keeps fd=>path mappings. Those
are needed for correct operation of openat() and friends.
- NOTE: This is an initial version; there are still features that
missing! To be extended later..
|
|
With this commit it is possible to instruct sb2 to load localization
files and message catalogs from specific path (for example under
target_root).
(Reviewed by Lauri T. Aarnio)
|
|
- The glob* functions used to be wrapped (the "pattern" parameter was
mapped by SB2), but that is a less-than-perfect solution because mapping
the pattern caused strange out-out-expectations results to be returned
(which caused problems with GNU Make, which uses glob() quite extensively).
The right thing to do is to include private implementations of the glob*
functions to SB2, so that the mapping happens at lower levels (e.g. in the
opendir() etc. functions used by glob).
- The replacements for glob() and glob64() were copied from glibc2.7. Some
minor modifications were needed to make them compile correctly in this
context.
- WARNING: Because the replacements were copied from glibc, and the interface to
the glob functions includes flags etc., SB2 is now somewhat bound to
glibc-based systems. The old less-than-perfect solution is still included
in the sources and can be enabled by defining SB2_WRAP_GLOB macro when
compiling, if SB2 needs to be used on a non-glibc host.
|
|
- Using libpthread unconditionally caused crashes (segfaults inside
libstdc++, etc). This changes the preload library to use functions from
the pthread library only if they are available, and removes automatic
loading of that library (Full explanation can be found from luaif.c)
|
|
sb2-show allows you to inspect how path/argv/envp mangling
would be done for a given binary. Patch by
lauri.t.aarnio@nokia.com, somewhat cleaned up by
lle@rahina.org.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
This is not tested properly on amd64 host, but does fix the obvious
problems.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Details:
- preload/interface.master defines all symbols (functions) that will
be exported from the library. That file is used to a) generate the C
files that contain interface functions and b) generate a list of
public symbols for ld.
- about 80% of the wrapper functions are now completely generated by
the generator (gen-interface.pl) based on interface.master. The rest
are "gates" to hand-written code (see the interface generator source
for instructions, and implementation of getcwd_gate() in libsb2.c
can be used as an example)
- lots of macros and definitions were moved from libsb2.c to libsb2.h
(a new file) which is used by both hand-written and generated code
- libsb2_init() was completely removed from libsb2.c. Function pointers
are only resolved when needed (previously all were resolved at init)
- the conditionally compiled strchrnul() was replaced by a simpler version
(and that is now used unconditionally!)
- Fixed coding style in exec*-functions (in libsb2.c) to be more consistent
with everything else
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Also pump the version
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Also puts back host-gcc link creation, it seems to be needed.
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
|
|
lua/ -> mapping/
lua/lua_bindings.c -> mapping/mapping.c
preload/sb_alien.c -> preload/sb_exec.c
|
|
|
|
|
|
|
|
|
|
|
|
sub-directories in obj-default
|
|
|
|
* cleanup top level Makefile by moving some stuff to Makefile.include
|
|
|
|
|
|
|
|
|
|
|