Closed jleightcap closed 3 months ago
2024-06-06 update:
./configure
arguments towards cross-compiling: turns out it's just a Python script, and needed custom configurePlatforms
env.gcc
: but there's potential to do this cleaner (believe env
is a anti-pattern.)
gcc
but prefixed name e.g. aarch64-linux-unknown-gnu-gcc
meta
field for librandombytes2024-06-10 update see: https://github.com/jleightcap/nixpkgs/tree/fern/librandombytes
clangStdenv
: figured out how to override the stdenv
when building, clang:x86>x86 worknativeBuildInputs
versus buildInputs
file $BINARY
shows unstripped: file showing not stripped does not mean it has debug symbols. https://stackoverflow.com/a/3284123-Q...
CFLAGS actually necessary? it appears in the script to find a compiler, but we're not sure if it needs to actually be appliedpassthru.updateScript
(sic): since this is distributed as a tarballmeta.license
etc.file
output was misleading, gdb
was correct: strip was being called on both binaries and the library .soCFLAGS
-Q...
argument-O2
, -fPIC
, -fstack-protector
, etc.)-fwrapv
: this is flag that librandombytes explicitly sets, why is it not visible in the nixpkgs flags? this is a special case: -fnostrict-overflow
is set, meaning:
-fstrict-overflow
This option implies -fno-wrapv -fno-wrapv-pointer and when negated implies -fwrapv -fwrapv-pointer.
-O2
being used when librandombytes requires -O1
?
env.NIX_CFLAGS_COMPILE = "-O1"
: this does add that flag, but in addition to -O2
. And because -O2
is a super-set of -O1
flags, these used in combination are effectively just -O2
. we need a way of disabling, or otherwise overwriting, the default optimization level that Nix uses.for posterity: we moved tracking our day-to-day packaging progress into a group kanban board for the time being. all related packages for this issue have nixpkgs PRs in review.
thanks for the reviews @wegank!
nixpkgs PRs:
librandombytes
https://github.com/NixOS/nixpkgs/pull/317781libcpucycles
https://github.com/NixOS/nixpkgs/pull/319608lib25519
https://github.com/NixOS/nixpkgs/pull/319618