mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Bernhard Walle <bernhard@bwalle.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] Fix missing elf.h on Darwin
Date: Sun, 22 Jan 2012 12:43:12 +0100	[thread overview]
Message-ID: <1327232595-25378-1-git-send-email-bernhard@bwalle.de> (raw)

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
ptxdist@pengutronix.de

             reply	other threads:[~2012-01-22 11:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-22 11:43 Bernhard Walle [this message]
2012-01-22 11:43 ` [ptxdist] [PATCH 1/3] Add host-elf-h-compat package Bernhard Walle
2012-01-24  7:53   ` Michael Olbrich
2012-01-22 11:43 ` [ptxdist] [PATCH 2/3] kernel: Use host-elf-h-compat Bernhard Walle
2012-01-24  9:43   ` Michael Olbrich
2012-01-22 11:43 ` [ptxdist] [PATCH 3/3] module-init-tools: Depend on HOST_ELF_H_COMPAT Bernhard Walle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327232595-25378-1-git-send-email-bernhard@bwalle.de \
    --to=bernhard@bwalle.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox