From: Thomas Adam Subject: Re: [WIP] landlock for got-portable To: Omar Polo Cc: Thomas Adam , gameoftrees@openbsd.org Date: Sun, 26 Sep 2021 00:28:38 +0100 On Sat, Sep 25, 2021 at 06:52:11PM +0200, Omar Polo wrote: > However, I don't see any -Wl,-rpath,... when compiling got, neither on > OpenBSD nor on linux. It's something we'd ned to add to LDFLAGS. > I was even thinking of trying to parse the elf header. On linux I > should find the current executable on /proc/self/exec, and from there > with helps from elf.h I should be able to understand if it's a static > executable or where are the needed libs. It could help when/if got and > the libexec helpers ends up being linked to different libraries. I > never did something like that but seems fun :) You could do, although there's probably no point as it's doable at runtime anyway. > Anyway, I don't know much of how linking works, so I have no idea of how > what I'll find in the elf header plays with rpath, LD_LIBRARY_PATH > and/or LD_PRELOAD. They're separate. > slightly OT, but if you find how to obtain a working linux/landlock.h > header on arch/void/alpine I'd be interested. Those distro ship linux > 5.14+ now, but their linux-headers package doesn't contain that header, > only /something/something/uapi/linux/landlock.h which can't be included > from the quick tests I did. > > fedora has a linux/landlock.h header. I don't know about other distros. I'm on Arch here and Debian elsewhere and none of the recent kernel versions at 5.14+ have a landlock.h file. I've sent an email to a few folks who might be able to help with this. Kindly, Thomas