-
Change Request
-
Resolution: Unresolved
-
Trivial
-
None
-
None
-
Debian Wheezy, gcc 8.2
When compiling Zabbix with gcc -flto compilation breaks due to using wrong ranlib executable name. ranlib is a essenital part of LTO compilation process. Starting with gcc 4.9, LTO compilation requires to use gcc-specific versions of ar, nm and ranlib: gcc-ar, gcc-nm and gcc-ranlib. In packaged gcc versions of the most Linux distributions ranlib and gcc-ranlib usually are the same. But in the cross compilation toolchains they are not. So there is a need to tell the configure process that we are not going to use deault ranlib.
Passing specific ranlib to configure (RANLIB=/some/path/to/ranlib ./configure ...) doesn't affect the value of RANLIB variable in the generated Makefiles. It always equals just "ranlib". The only way to use a specific version of ranlib is to when using make: make RANLIB=/some/path/to/ranlib.
The reason of such configure behavior is at the line 1606 of configure.ac (as in 3.4.11 tarball version):
RANLIB="ranlib"
It means that generated configure will be in all the cases set RANLIB variable to be equal just "ranlib".
As Zabbix is a Libtoolized project, libtool by default checks the presence of ranlib and sets RANLIB variable according to result. It checks the environmental variable RANLIB which may be passed to configure. I don't see any reason why there is a need to hardcode ranlib executable name.
Removing that line and then executing autoreconf -fi allows to configure correctly set RANLIB variable and as result LTO compilation succeeds.