Search code examples
luacentos7haproxyarm64

Error while compiling HAProxy from source


I got this error while trying to compile the HAProxy 2.2 with LUA version 5.3. I'm on trying to do it on CentOS7(arm64).

[root@08d17a479616 haproxy-2.2.22]# make TARGET=linux-glibc USE_PCRE=1 USE_PCRE_JIT=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_TPROXY=1 USE_REGPARM=1 USE_LUA=1 USE_THREAD=1 USE_TFO=1
  CC      src/version.o
  LD      haproxy
/usr/bin/ld: cannot find -latomic
collect2: error: ld returned 1 exit status

More logs;

attempt to open //usr/aarch64-redhat-linux/lib64/libatomic.so failed
attempt to open //usr/aarch64-redhat-linux/lib64/libatomic.a failed
attempt to open //usr/lib64/libatomic.so failed
attempt to open //usr/lib64/libatomic.a failed
attempt to open //usr/local/lib64/libatomic.so failed
attempt to open //usr/local/lib64/libatomic.a failed
attempt to open //lib64/libatomic.so failed
attempt to open //lib64/libatomic.a failed
attempt to open //usr/aarch64-redhat-linux/lib/libatomic.so failed
attempt to open //usr/aarch64-redhat-linux/lib/libatomic.a failed
attempt to open //usr/local/lib/libatomic.so failed
attempt to open //usr/local/lib/libatomic.a failed
attempt to open //lib/libatomic.so failed
attempt to open //lib/libatomic.a failed
attempt to open //usr/lib/libatomic.so failed
attempt to open //usr/lib/libatomic.a failed
ld: cannot find -latomic
[root@08d17a479616 haproxy-2.2.22]#

What I've tried until now is to create a symlink to the libatomic.so with this

ln -s /usr/lib64/libatomic.so.1.2.0 /usr/lib/libatomic.so

And installed the missing GNU library from here with the steps outline in the article.

Install CentOS SCLo RH repository:yum install centos-release-scl-rh
Install devtoolset-7-libatomic-devel rpm package:
# yum install devtoolset-7-libatomic-devel

What should I do to resolve it ?


Solution

  • Fixed by installing this package and it goes through to a new error, which I've outlitned in this question. New question: New questions

    To apply the fix for CentOS7 arm, use this link and the instructions on how to install the package. Package Link

    Install systemd-devel rpm package:  yum install systemd-devel