Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 567680 - app-antivirus/clamav-0.99: links to libclamunrar.so.6 from earlier installed version
Summary: app-antivirus/clamav-0.99: links to libclamunrar.so.6 from earlier installed ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Antivirus Team
URL: https://bugzilla.clamav.net/show_bug....
Whiteboard:
Keywords:
: 571542 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-06 22:00 UTC by Michał Górny
Modified: 2020-02-05 22:46 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
app-antivirus:clamav-0.99:20151204-162511.log (app-antivirus:clamav-0.99:20151204-162511.log,872.20 KB, text/plain)
2015-12-06 22:04 UTC, Michał Górny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-12-06 22:00:40 UTC
After upgrading, Portage preserves:

>>> package: app-antivirus/clamav-0.99
 *  - /usr/lib64/libclamunrar.so.6
 *  - /usr/lib64/libclamunrar.so.6.1.26
 *      used by /usr/lib64/libclamunrar_iface.so.7.1.1 (app-antivirus/clamav-0.99)

which kinda means the new build linked to the old installed library rather than newly-built libclamunrar.so.7.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-12-06 22:04:34 UTC
Created attachment 418688 [details]
app-antivirus:clamav-0.99:20151204-162511.log
Comment 2 Thomas Raschbacher gentoo-dev 2015-12-17 18:59:35 UTC
hmm that seems pretty annoying .. do you have any idea yet why it would do it / how to fix it?
Comment 3 Thomas Raschbacher gentoo-dev 2015-12-17 19:15:04 UTC
I am tempted to put a dep on it like !<app-antivirus/clamav-0.99 but I'm not sure that is a good idea .. 
It does work as expected though if one uninstalls clamav first and then re-installs..
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-12-17 19:28:30 UTC
That should be !! actually. I'll try to look into the code later if I find time.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-12-18 16:19:45 UTC
I don't see anything obviously wrong with that code. It has:

  libclamunrar_iface_la_LIBADD = libclamunrar.la

so it should be able to use the newly built library...

@toolchain, any idea what could be happening here?
Comment 6 SpanKY gentoo-dev 2015-12-18 17:23:24 UTC
the relink install phase favored / over $D:

libtool: relink: x86_64-pc-linux-gnu-gcc-5.2.0 -shared  -fPIC -DPIC  .libs/unrar_iface.o   -L/usr/lib64 -L/tmp/portage/app-antivirus/clamav-0.99/image//usr/lib64 -lclamunrar -lpcre -ldl  -march=k8-sse3 -mcx16 -msahf -O2 -Wl,--version-script -Wl,../libclamunrar_iface/libclamunrar_iface.map -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu   -Wl,-soname -Wl,libclamunrar_iface.so.7 -o .libs/libclamunrar_iface.so.7.1.1

solution: use `elibtoolize --reverse-deps` in src_prepare
Comment 7 Thomas Raschbacher gentoo-dev 2015-12-19 12:54:00 UTC
Thanks.

I shall give this a quick test-run later and commit it -- although it'll probably be tomorrow earliest as I am going to be out most of the rest of the day.
If someone wants to do this and revbump feel free.
Comment 8 Thomas Raschbacher gentoo-dev 2015-12-20 18:12:10 UTC
for some reason this is not really fixing the issue for me.

even when running elibtoolize i still get this:

/usr/lib64/libclamunrar.so
/usr/lib64/libclamunrar.so.6
/usr/lib64/libclamunrar.so.6.1.26
/usr/lib64/libclamunrar.so.7
/usr/lib64/libclamunrar.so.7.1.1
/usr/lib64/libclamunrar_iface.so
/usr/lib64/libclamunrar_iface.so.7
/usr/lib64/libclamunrar_iface.so.7.1.1

and this:

# ldd /usr/lib64/libclamunrar_iface.so.7.1.1 
	linux-vdso.so.1 (0x000003db68b69000)
	libclamunrar.so.6 => /usr/lib64/libclamunrar.so.6 (0x000003db68538000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x000003db682f4000)
	libdl.so.2 => /lib64/libdl.so.2 (0x000003db680f0000)
	libc.so.6 => /lib64/libc.so.6 (0x000003db67d43000)
	/lib64/ld-linux-x86-64.so.2 (0x000003db68949000)


any ideas on how to really sort this one (except uninstalling earlier clamav first?)
Comment 9 Thomas Raschbacher gentoo-dev 2015-12-30 10:07:25 UTC
added !!<app-antivirus/clamav-0.99 dep for now to avoid problems of people upgrading.
Comment 10 Alex Legler (RETIRED) archtester gentoo-dev Security 2016-01-11 12:46:38 UTC
*** Bug 571542 has been marked as a duplicate of this bug. ***
Comment 11 Thomas Raschbacher gentoo-dev 2016-01-29 20:49:34 UTC
closing this as the block circumvents the problem and I don't have the time to look into this further. if anyone had a patch feel free to re-open it.
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-03-01 18:39:39 UTC
I traced where it's coming from:

clamav-0.98.7:
LDFLAGS = -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed

clamav-0.99:
LDFLAGS = -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -L/usr/lib64 -lpcre

# /usr/bin/pcre-config --libs
-L/usr/lib64 -lpcre

This is still with elibtoolize --reverse:
>>> Preparing source in /dev/shm/portage/app-antivirus/clamav-0.99/work/clamav-0.99 ...
 * Running elibtoolize in: clamav-0.99/
 *   Applying target-nm/2.4.2 patch ...
 * Running elibtoolize in: clamav-0.99/config/
 *   Applying portage/1.2.0 patch ...
 *   Applying sed/1.5.6 patch ...
 *   Applying as-needed/2.4.2 patch ...
 * Running elibtoolize in: clamav-0.99/libclamav/c++/
 *   Applying target-nm/2.4.2 patch ...
 * Running elibtoolize in: clamav-0.99/libclamav/c++/config/
 *   Applying portage/1.2.0 patch ...
 *   Applying sed/1.5.6 patch ...
 *   Applying as-needed/2.4.2 patch ...
 * Running elibtoolize in: clamav-0.99/libclamav/c++/llvm/
 *   Applying target-nm/2.4.2 patch ...
 * Running elibtoolize in: clamav-0.99/libclamav/c++/llvm/autoconf/
 *   Applying install-sh/1.5.4 patch ...
 *   Applying portage/1.5.10 patch ...
 *   Applying max_cmd_len/1.5.20 patch ...
 *   Applying sed/1.5.6 patch ...
 *   Applying as-needed/1.5 patch ...
 *   Applying fix-relink/1.5.0 patch ...
 * Running elibtoolize in: clamav-0.99/win32/3rdparty/zlib/
>>> Source prepared.

Notice that fix-relink did not get applied to config/ltmain.sh.

I'm looking at why
Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-03-01 18:40:44 UTC
I do see an automagic dependency on pcre as well, in 0.98.7-r1 it didn't turn on, it 0.99 it did; and isn't specified in the ebuilds at all.
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-03-01 18:47:32 UTC
@vapier:
should PCRE be including -L/usr/lib64 in the pcre-config --libs output?
(dev-libs/libpcre-8.37-r2)
# pcre-config  --libs
-L/usr/lib64 -lpcre

As a comparison xml2-config --libs does NOT add it:
# xml2-config  --libs
-lxml2 -lz -lm -ldl
Comment 15 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-03-09 23:55:44 UTC
@vapier, reping for comment 14
Comment 16 Anthony Basile gentoo-dev 2016-05-15 01:50:06 UTC
(In reply to Robin Johnson from comment #14)
> @vapier:
> should PCRE be including -L/usr/lib64 in the pcre-config --libs output?
> (dev-libs/libpcre-8.37-r2)
> # pcre-config  --libs
> -L/usr/lib64 -lpcre
> 
> As a comparison xml2-config --libs does NOT add it:
> # xml2-config  --libs
> -lxml2 -lz -lm -ldl

For pkgconfig at least, --libs is suppose to give all the link flags.  An example of this is QtXml where

    pkg-config --libs QtXml

gives '-L/usr/lib64/qt4 -lQtXml -lQtCore'.  Still -L/usr/lib64 looks wrong.
Comment 17 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-05-15 08:10:08 UTC
As a side note, pkg-config strips default libdir from output (i.e. if -L/usr/lib64 is in .pc file, you won't see it).
Comment 18 Thomas Raschbacher gentoo-dev 2016-05-23 11:53:23 UTC
I shall look into the pcre dep as well thanks for pointing that out.
But I still havenT' found a good way around the hard block of <clamav-0.99 yet ..
Comment 19 SpanKY gentoo-dev 2016-05-23 18:01:54 UTC
(In reply to Robin Johnson from comment #14)

ideally all xxx-config scripts would omit system -L paths.  however, this is already fixed by using libpcre's pkg-config file instead.  so if you converted the build to querying pkg-config for pcre deps, that path would go away.

(as Michał said)
Comment 20 Thomas Raschbacher gentoo-dev 2016-05-23 20:49:45 UTC
@vapier I'm not entirely sure what you mean. do you mean patch autoconf/make?
Comment 21 SpanKY gentoo-dev 2016-05-23 21:10:41 UTC
(In reply to Thomas Raschbacher from comment #20)

yes.  look at m4/reorganization/libs/pcre.m4.  you'll want to gut most of that module and replace it with a call to PKG_CHECK_MODULES.  you'll want to check with upstream to see if they care ... if they do, you can start with a call to PKG_CHECK_MODULES before falling back to all the hacky tool/config script parsing.
Comment 22 Thomas Raschbacher gentoo-dev 2016-05-23 21:35:05 UTC
Thanks @vapier .
I just commited the pcre dep + a note about the hardblock in the ebuild for now
Comment 23 Thomas Raschbacher gentoo-dev 2018-04-20 06:26:33 UTC
forgot to close this bug it seems...
Comment 24 Michael Orlitzky gentoo-dev 2020-02-05 22:46:33 UTC
I just found this bug after seeing the hard block in the ebuild. Reported upstream at: https://bugzilla.clamav.net/show_bug.cgi?id=12484

(I think we can remove the hard block now, the 0.99 versions are all gone.)