Cannot build lnav on aarch64
lnav version v0.9.0 is the latest
Describe the bug
I'm trying to integrate lnav with a Cardano node Docker image. The build is based on Nix and it works just fine on x86_64. On aarch64 I have no luck ...
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for aarch64-unknown-linux-gnu-gcc... aarch64-unknown-linux-gnu-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether aarch64-unknown-linux-gnu-gcc accepts -g... yes
checking for aarch64-unknown-linux-gnu-gcc option to accept ISO C89... none needed
checking whether aarch64-unknown-linux-gnu-gcc understands -c and -o together... yes
checking dependency style of aarch64-unknown-linux-gnu-gcc... gcc3
checking whether the C compiler works... no
configure: error: in `/tmp/nix-build-lnav-0.9.0.drv-0':
configure: error: C compiler cannot create executables
To Reproduce
{
# Pinned packages with Niv
sources ? import ../sources.nix,
haskellNix ? import sources.haskellNix {},
nixpkgsSrc ? haskellNix.sources.nixpkgs-2009,
nixpkgsArgs ? haskellNix.nixpkgsArgs,
pkgs ? import nixpkgsSrc nixpkgsArgs,
}:
pkgs.stdenv.mkDerivation {
pname = "lnav";
version = "0.9.0";
src = builtins.fetchGit {
url = "https://github.com/tstack/lnav";
rev = "0e1eb418c89440b8c4e65dd27f7fb3b2fe984255";
};
buildInputs = [
pkgs.autoconf
pkgs.automake
pkgs.curl
pkgs.libarchive
pkgs.libzip
pkgs.ncurses
pkgs.pcre-cpp
pkgs.readline
pkgs.sqlite
];
builder = ./builder.sh;
}
Can you try the v0.10.0-beta or the top-of-tree? Can you also attach the config.log from the build directory, that should give more information about the failure.
config-head.log config-0.10.0-beta1.log
It seems to fail like this ...
configure:6314: checking whether the C compiler works
configure:6336: aarch64-unknown-linux-gnu-gcc -g -O2 conftest.c >&5
/nix/store/ca148jcwpzjqyasyaqf9l81sndxwgbqn-binutils-2.35.1/bin/ld: cannot find crt1.o: No such file or directory
/nix/store/ca148jcwpzjqyasyaqf9l81sndxwgbqn-binutils-2.35.1/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
in both cases.
Here is the shell.nix that I use. I tried several versions of gcc from here
{
pkgs ? import <nixpkgs> {}
}:
let
version = "0.10.0-beta1";
in
pkgs.mkShell {
buildInputs = [
pkgs.autoconf
pkgs.automake
pkgs.curl
pkgs.gccStdenv
pkgs.libarchive
pkgs.libzip
pkgs.ncurses
pkgs.pcre-cpp
pkgs.readline
pkgs.sqlite
];
shellHook = ''
TARGET_DIR="$(pwd)/target"
rm -rf $TARGET_DIR
if [ ! -d $TARGET_DIR/gitsrc ]; then
mkdir -p $TARGET_DIR
git clone --depth 1 --branch "v${version}" https://github.com/tstack/lnav $TARGET_DIR/gitsrc
fi
cd $TARGET_DIR/gitsrc
./autogen.sh
./configure --prefix=$TARGET_DIR
make
make install
sudo rm -f /usr/local/bin/lnav
sudo cp $TARGET_DIR/bin/lnav /usr/local/bin
'';
}
Any news ? Currently getting this issue on Nixos 21.11
out-of-date