!OqhvaDMJdKYUicLDiE:nixos.org

Nixpkgs Stdenv

230 Members
75 Servers

Load older messages


SenderMessageTime
15 Nov 2024
@p14:matrix.orgp14How do you define "proper sysroot" and how does it help if the compiler can look somewhere you don't want it to look?12:03:18
@emilazy:matrix.orgemilyreally though there's so many ways for impurities to leak in outside of the sandbox12:03:20
@p14:matrix.orgp14fair.12:03:29
@emilazy:matrix.orgemily
In reply to @p14:matrix.org
How do you define "proper sysroot" and how does it help if the compiler can look somewhere you don't want it to look?
it's not going to look outside of the sysroot if we provide one
12:03:36
@emilazy:matrix.orgemily but there were complications with it needing to be / for something something something 12:03:47
@emilazy:matrix.orgemilyI forget, it was a few weeks ago12:03:51
@emilazy:matrix.orgemily if you mean -I/usr/include, uhh 12:03:57
@emilazy:matrix.orgemily well (a) that's your fault for passing that and (b) we have a joke of a cc command-line parser in the wrappers to try and filter those out 12:04:14
@emilazy:matrix.orgemilywhich ALSO broke Darwin and I had to change it12:04:21
@emilazy:matrix.orgemily (because on Darwin it's relative to the SDKROOT, so e.g. -L/usr/lib/swift is benign) 12:04:38
@p14:matrix.orgp14I was under the impression the compiler driver searched usr lib of its own volition12:04:41
@emilazy:matrix.orgemily it searches <sysroot>/lib 12:04:53
@p14:matrix.orgp14https://github.com/llvm/llvm-project/blob/d7b669b3a30345cfcdb2fde2af6f48aa4b94845d/clang/lib/Driver/ToolChains/Gnu.cpp#L2930 Oh, right.12:05:11
@p14:matrix.orgp14And, we're not passing sysroot then I take it.12:05:22
@emilazy:matrix.orgemily like I said apparently it has to be / but I forget why 12:05:36
@emilazy:matrix.orgemily(on Linux)12:05:39
@p14:matrix.orgp14that sounds odd, what's the point in having a sysroot parameter if that was true?12:05:53
@emilazy:matrix.orgemily it was an arcane reason. ask trofi :) 12:06:07
@emilazy:matrix.orgemily
In reply to @emilazy:matrix.org
(because on Darwin it's relative to the SDKROOT, so e.g. -L/usr/lib/swift is benign)
one possible path I've considered is making this behaviour configurable for all platforms. we pass -treat-all-those-user-specified-paths-as-sysroot-relative-even-though-this-isnt-darwin -sysroot /directory/tree/with/empty/stub/include/and/libs/directories in the wrapper
12:06:18
@emilazy:matrix.orgemily then we're safe from /usr/lib and don't need the broken purity hack CLI parsing in the wrapper 12:06:32
@emilazy:matrix.orgemilymight work. dunno.12:06:39
@emilazy:matrix.orgemily anyway, I think passing -nostdlibinc for non-Darwin targets in the wrapper is the conservative option for now, but we should definitely flag up to the relevant people that it no longer appears necessary for libc++ 12:07:50
@p14:matrix.orgp14 Bah, pkgsStatic.pkgsLLVM.hello-cpp.stdenv.cc/bin/x86_64-unknown-linux-musl-clang doesn't work, because it fails to find ld. -ld-path=x86_64-unknown-linux-musl-ld fixes it. 12:09:09
@p14:matrix.orgp14 * Bah, pkgsStatic.pkgsLLVM.hello-cpp.stdenv.cc/bin/x86_64-unknown-linux-musl-clang doesn't work, because it fails to find ld. --ld-path=x86_64-unknown-linux-musl-ld fixes it. 12:09:17
@p14:matrix.orgp14"Bah", because, I expected it to already look for the triple-prefixed ld... 12:09:31
@emilazy:matrix.orgemily pkgsStatic.pkgsLLVM even does something sensible? 12:09:36
@emilazy:matrix.orgemily
In reply to @p14:matrix.org
"Bah", because, I expected it to already look for the triple-prefixed ld...
wanna revive the "prefix all compilers" PRs? 😆
12:09:45
@p14:matrix.orgp14Looks like it does, sort of? :)12:09:48
@emilazy:matrix.orgemily
In reply to @trofi:matrix.org
At least on linux the attempt to use non-standard sysroot broke DT_RUNPATH lookups for libraries not explicitly mentioned in the linking process: https://github.com/NixOS/nixpkgs/pull/213185. Transitive libraries are searched in sysroot only and things break.
p14: here's a pointer to the previous discussion
12:10:44
@emilazy:matrix.orgemilywith the conclusion of basically "we should add more knobs upstream and then twiddle only the ones we need"12:11:08

Show newer messages


Back to Room ListRoom Version: 9