nnn 5.2 started to use optimized lockless implementation using atomic operations on 64-bit unsigned long long int (introduced in 7ce4913). This however causes build failure on architectures without such support (ie ARMv6 or lower):
/usr/bin/ld: /home/users/builder/tmp/cck52Np2.o: in function `du_walk_dir.constprop.0':
nnn.c:(.text+0x2148): undefined reference to `__atomic_fetch_or_8'
/usr/bin/ld: /home/users/builder/tmp/cck52Np2.o: in function `dentfill.constprop.0':
nnn.c:(.text+0xb1ac): undefined reference to `__atomic_fetch_or_8'
/usr/bin/ld: nnn.c:(.text+0xb414): undefined reference to `__atomic_fetch_or_8'
Linking libatomic fixes the issue. Some possibilities to fix it:
- User sets
LDLIBS=-latomic env var before running make
- New option
O_LIBATOMIC? for adding -latomic which user would have to set
- Trying to detect automatically if atomics work:
ifneq ($(shell echo "int main(){unsigned long long t;__atomic_fetch_or(&t, 0, __ATOMIC_RELAXED);}"|$(CC) -x c - -o /dev/null 2> /dev/null && echo 1),1)
LDLIBS += -latomic
endif
I'm fine with either solution including first one, which does not require any action from nnn and in such case feel free to close the ticket.
nnn 5.2 started to use optimized lockless implementation using atomic operations on 64-bit unsigned long long int (introduced in 7ce4913). This however causes build failure on architectures without such support (ie ARMv6 or lower):
Linking libatomic fixes the issue. Some possibilities to fix it:
LDLIBS=-latomicenv var before runningmakeO_LIBATOMIC? for adding-latomicwhich user would have to setI'm fine with either solution including first one, which does not require any action from nnn and in such case feel free to close the ticket.