Re: On upgrading elftoolchain in src/

Robert Elz <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
    Date:        Wed, 24 Mar 2021 08:42:37 +0000
    From:        [email protected]
    Message-ID:  <[email protected]>

  | 1. Install <elfdefinitions.h> into /usr/include, per the patch
  |    linked to earlier.

Seems reasonable.  I would suggest just elf.h but we seem to have a
lot of those already, so I won't.

  | (Would /usr/include/sys be a better location?).

see #3 below.

  | 2. Change $NBSRC userspace code that only needs the file format related
  |    types and constants to use the newly installed <elfdefinitions.h>,
  |    instead of <sys/exec_elf.h>.

Fine.

  | 3. Then perhaps change <sys/exec_elf.h> to use <elfdefinitions.h> for
  |    the file format related symbols,

Only if <elfdefinitions.h> is really <sys/elfdefinitions.h>

The kernel build needs to be self-contained, it should not reference
anything that is from /usr/include (outside /usr/include/sys).

You can have a userland <elfdefinitions.h> that non-kernel sources use,
which then uses #include <sys/elfdefinitions.h> to get the definitions
shared with the kernel (along with anything else that might be useful
to userland which the kernel does not need).

  | Do you foresee any issues with implementing this plan?

I don't, but someone who works in this are may (my reply is partly
because sometimes people don't reply to a simple question, but if someone
has given the wrong answer, then they will speak up!)

kre
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.