Hi People I am trying to build a piece of software from source in this case aide 0.13.1 using this config line ./configure --with-zlib --with-selinux. The configure step completes but there is a Warning that concerns me. This is taken from config.log configure:9809: checking for mhash_get_block_size in -lmhash configure:9844: gcc -o conftest -g -O2 -static -static conftest.c -lmhash -lz >&5 /usr/bin/ld: cannot find -lmhash collect2: ld returned 1 exit status The machine I am trying to do this build on is Cent0S 5 with the latest updates. It didn't originally have gcc installed so I have installed that and mhash and mhash-devel are also installed. I know I can ignore the warning and just carry on, or that there are already aide RPMS. But I am doing this as an exercise for myself as I want to up skill in RPM creation. So if anyone can offer incite into why this is happening it would be appreciated. rpm -qa | grep gcc libgcc-4.1.2-14.el5 gcc-4.1.2-14.el5 rpm -qa | grep mhash mhash-0.9.9-1.el5.centos mhash-devel-0.9.9-1.el5.centos Please let me know any other information that would be useful, have a nice day :)
On Wed, Jan 09, 2008 at 02:00:13PM +1300, Clint Dilks alleged:> Hi People > > I am trying to build a piece of software from source in this case aide > 0.13.1 using this config line ./configure --with-zlib --with-selinux. > The configure step completes but there is a Warning that concerns me. > This is taken from config.log > > configure:9809: checking for mhash_get_block_size in -lmhash > configure:9844: gcc -o conftest -g -O2 -static -static conftest.c > -lmhash -lz >&5 > /usr/bin/ld: cannot find -lmhash > collect2: ld returned 1 exit statusThe '-static' means that the linker needs to find a static library archive to create a static executable. That means it wants to find /usr/lib/libmhash.a. Without the '-static', it would look for the shared library, libmhash.so. The mhash-devel package doesn't contain libmhash.a, so your test linking fails. It has been fedora/upstream policy for while to discourage the packaging of static archive files. I'm sure the Fedora wiki has a page explaining why, but I'm too lazy to find it right now. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20080108/6a3e50f4/attachment-0003.sig>
Garrick Staples wrote:> On Wed, Jan 09, 2008 at 02:00:13PM +1300, Clint Dilks alleged: > >> Hi People >> >> I am trying to build a piece of software from source in this case aide >> 0.13.1 using this config line ./configure --with-zlib --with-selinux. >> The configure step completes but there is a Warning that concerns me. >> This is taken from config.log >> >> configure:9809: checking for mhash_get_block_size in -lmhash >> configure:9844: gcc -o conftest -g -O2 -static -static conftest.c >> -lmhash -lz >&5 >> /usr/bin/ld: cannot find -lmhash >> collect2: ld returned 1 exit status >> > > The '-static' means that the linker needs to find a static library archive to > create a static executable. That means it wants to find /usr/lib/libmhash.a. > Without the '-static', it would look for the shared library, libmhash.so. > > The mhash-devel package doesn't contain libmhash.a, so your test linking fails. > > It has been fedora/upstream policy for while to discourage the packaging of > static archive files. I'm sure the Fedora wiki has a page explaining why, but > I'm too lazy to find it right now. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >Thanks, that was it. :) For those who might be interested this is link from Fedora Wiki that offers some incite http://fedoraproject.org/wiki/PackagingDrafts/StaticLinkage?highlight=%28Static%29 http://fedoraproject.org/wiki/PackagingDrafts/StaticLibraryChanges?highlight=%28Static%29
Garrick Staples wrote:> On Wed, Jan 09, 2008 at 02:00:13PM +1300, Clint Dilks alleged: > >> *snip* >> > > The '-static' means that the linker needs to find a static library archive to > create a static executable. That means it wants to find /usr/lib/libmhash.a. > Without the '-static', it would look for the shared library, libmhash.so. > > The mhash-devel package doesn't contain libmhash.a, so your test linking fails. > > It has been fedora/upstream policy for while to discourage the packaging of > static archive files. I'm sure the Fedora wiki has a page explaining why, but > I'm too lazy to find it right now.I don't know what reasons the wiki gives, but if a bug (security or other) exists in a library and you statically link against it, then when that bug is fixed - you have to rebuild all apps that linked against the static lib or they will continue to contain the bug even, even when the library is updated. With shared libraries, that isn't an issue. With shared libraries, updating the library is all you need to do. zlib I believe was a real world example of this - some years ago (red hat 5 ??), zlib was found to have a bug that could potentially be exploited. A lot of apps linked against the static library. Even after zlib had been updated, those apps were still vulnerable until they were recompiled.