| 11 Oct 2025 |
Anders | I am trying to build relibc using nix to be able to cross compile redox os with nix again. But I run into this problem x86_64-linux-gnu-gcc: command not found How do I solve it? I am not trying to cross compile | 11:21:28 |
K900 | There's no general answer for this question | 11:22:00 |
K900 | You need to look at the build system | 11:22:09 |
K900 | And figure out what it's expecting and why | 11:22:13 |
Anders | ifeq ($(TARGET),x86_64-unknown-linux-gnu)
export CC=x86_64-linux-gnu-gcc
export LD=x86_64-linux-gnu-ld
export AR=x86_64-linux-gnu-ar
export NM=x86_64-linux-gnu-nm
export OBJCOPY=objcopy
export CPPFLAGS=
LD_SO_PATH=lib/ld64.so.1
endif
| 11:45:21 |
K900 | Yeah that looks immediately wrong, at least LDSOPATH | 11:51:21 |
K900 | Yeah that looks immediately wrong, at least LD_SO_PATH | 11:51:25 |
Anders | Well it works on other systems apparently. Is there not any simple way to get nix to create an env where these commands are specified? | 12:02:31 |
K900 | Honestly, I'm sorry if it comes off as harsh, but you're clearly out of your depth here | 12:04:28 |
K900 | Maybe try packaging something less weird first | 12:04:39 |
Anders | If you have nothing helpful to say it is better to not say it | 12:05:25 |
K900 | The thing is, you're expecting people to feed you answers | 12:06:16 |
K900 | To questions that generally indicate that you don't understand the build system | 12:06:46 |
K900 | And like, we can't do your homework for you, | 12:06:59 |
K900 | * And like, we can't do your homework for you | 12:07:02 |
Anders | I don't care. If you don't want to help. Just simply don't. No need to be rude. | 12:08:10 |
K900 | I do care, because this is not the kind of behavior we want to encourage in this community | 12:08:32 |
Anders | I got it working now | 12:44:25 |
Artturin | In reply to @anders:sorby.xyz
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
export CC=x86_64-linux-gnu-gcc
export LD=x86_64-linux-gnu-ld
export AR=x86_64-linux-gnu-ar
export NM=x86_64-linux-gnu-nm
export OBJCOPY=objcopy
export CPPFLAGS=
LD_SO_PATH=lib/ld64.so.1
endif
In nixpkgs the compiler for build isn't prefixed, neither during native or cross-compilation
You should remove those lines or substituteInPlace them | 12:55:57 |
Anders | I don't want to break support for other systems. What is the recommended way of doing this in nix? substituteInPlace | 13:01:27 |
Alyssa Ross | are they not overridable on the make command line? | 13:09:37 |
Alyssa Ross | i.e. makeFlags | 13:09:44 |
Alyssa Ross | make variables usually are | 13:10:05 |
Anders | Yes, but I think it is cleanest to use substituteInPlace in this case | 13:18:17 |
Alyssa Ross | I don't agree at all. The Make command line is an actual API designed for doing exactly this. | 13:20:35 |
Anders | Ok, you seem to be right. It was much simpler and cleaner. | 13:23:39 |
matthewcroughan | https://hercules-ci.com/accounts/github/MatthewCroughan/derivations/%2Fnix%2Fstore%2Fdywy5i6pv2l7rs2a6dh357whnhvnmvkl-audit-aarch64-unknown-linux-musl-4.1.2-unstable-2025-09-06.drv/log?via-job=f8d88c3e-3806-4bc0-bdca-0c7ea05b7c67 | 13:51:53 |
matthewcroughan | This failure always seems to happen on audit nowadays | 13:52:02 |
matthewcroughan | https://github.com/MatthewCroughan/nixos-musl/tree/refactor | 13:52:15 |
matthewcroughan | I'm building a flake here to track musl/llvm native and cross | 13:52:24 |