This patch series is an attempt to solve the problem that Darwin has no
/usr/include/elf.h. I'm sure that other non-Linux but POSIX-compatible operating
systems have no /usr/include/elf.h, so it should not only increase portability
for Mac OS but also for *BSD.

I think there are various ways to implement an solution, this one is based on a
newly created elf-h-compat package that uses autoconf to check if there's
already a elf.h present and if yes, it does nothing on "make install".
Otherwise, an own copy of elf.h that is sufficient to compile the kernel and
module-init-tools is installed, which results in sysroot-host/include/elf.h.

The rest of the patches just add the dependencies and set the CFLAGS.

Some words on alternatives: I played a bit with libelf to provide the required
headers, but they don't have elf.h and even a compat-elf.h that includes gelf.h
doesn't bring all required defines. On the other side building libelf just to
get a few definitions is overkill.

Modifying the kernel build system to use its own copy of elf.h (basically
<linux/elf.h>) isn't easy either and will not help module-init-tools (didn't
check kmod).

Using the elf.h from the cross-toolchain would involve bringing the include path
of the cross toolchain in the include path of the host which I'm sure will
generate more problems.

Of course I'm open for alternatives, but discussion without suggesting a
solution doesn't work in most Open Source projects. ;-)


-- 
ptxdist mailing list
[email protected]

Reply via email to