aboutsummaryrefslogtreecommitdiff
path: root/notes/prefix_support.txt
blob: 9311172c17969f98529a8bf08c93ad7286894c42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

Supporting prefixed installation, such as in /usr/local in SLUL?

* Should it affect the search path of libraries themselves?
    - ?
* Should it affect the search path when doing I/O within a library?
    - Yes, but this would work by passing some I/O object from the main
      command to the library.
* Should it affect `giveme`s in the main command?
    - Yes.

Ways to implement this:

* Can rpath be used? Can the loader read the rpath and pick it up and use
  it for looking in <rpath>/etc, for example /usr/local/etc.
    - Note that ~/.local is different. If installed there, you'd want to
      load configuration from ~/.config (but you probably always want to
      load it from there anyway).
* Can the path of the executable be used?
    - No, that could be a security issue (libraries could be picked up
      from a downloads directory for example).
* Can the path be embedded in a custom ELF attribute? For example in
  the program header ("PT_SLUL_INSTPATH") or in the dynamic segment
  ("DT_SLUL_INSTPATH").
    - Probably only worse than rpath, if rpath can do this.