Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 395433

Summary: dev-libs/libiconv - static archives (*.a) and libtool library files (*.la) do not belong in /
Product: Gentoo Linux Reporter: René Berber <r.berber>
Component: [OLD] Core systemAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: bsd+disabled, embedded, prefix
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
Log file of the build
emerge -pqv (of the full .ebuild path since it is masked)

Description René Berber 2011-12-21 00:12:41 UTC
The problem is observed using the crossdev emerge wrapper while trying to cross-build libiconv.

Short version:

# PORT_LOGDIR=/tmp x86_64-w64-mingw32-emerge -av
/usr/portage/dev-libs/libiconv/libiconv-1.14.ebuild
...
 * QA Notice: Excessive files found in the / partition
 *
/usr/x86_64-w64-mingw32/tmp/portage/dev-libs/libiconv-1.14/image/lib/libcharset.dll.a
 *
/usr/x86_64-w64-mingw32/tmp/portage/dev-libs/libiconv-1.14/image/lib/libiconv.dll.a

 * ERROR: dev-libs/libiconv-1.14 failed:
 *   static archives (*.a) and libtool library files (*.la) do not
belong in /
 *
 * Call stack:
 *   misc-functions.sh, line 992:  Called install_qa_check
 *   misc-functions.sh, line 546:  Called die

The messages are confused, first it complains about the .dll.a which are
then wrongly deleted, then it complains about .a and .la files.

There is no problem having .a, .dll.a, and .la files together, they are
different things used for different purpose (one is the real static
library, the other is just the symbol definitions used when linking to
the dynamic library).

For the long version see the attached log.

Reproducible: Always

Steps to Reproduce:
1. x86_64-w64-mingw32-emerge -av /usr/portage/dev-libs/libiconv/libiconv-1.14.ebuild

Actual Results:  
Build succeeds but emerge fails and doesn't install.

Expected Results:  
emerge should succeed.

There is no reason to count the libraries, or whatever is doing to reject that .dll.a files shouldn't be installed.
Comment 1 René Berber 2011-12-21 00:14:19 UTC
Created attachment 296505 [details]
emerge --info
Comment 2 René Berber 2011-12-21 00:15:00 UTC
Created attachment 296507 [details]
Log file of the build
Comment 3 René Berber 2011-12-21 00:16:17 UTC
Created attachment 296509 [details]
emerge -pqv (of the full .ebuild path since it is masked)
Comment 4 Zac Medico gentoo-dev 2011-12-21 02:42:40 UTC
(In reply to comment #0)
>  * ERROR: dev-libs/libiconv-1.14 failed:
>  *   static archives (*.a) and libtool library files (*.la) do not
> belong in /

The reason for this error is that Gentoo's policy is to install *.a and *.la in /usr/lib/ rather than /lib/.

> The messages are confused, first it complains about the .dll.a which are
> then wrongly deleted, then it complains about .a and .la files.
> 
> There is no problem having .a, .dll.a, and .la files together, they are
> different things used for different purpose (one is the real static
> library, the other is just the symbol definitions used when linking to
> the dynamic library).

Would it make any sense to re-locate them to /usr/lib/? If they really belong in /lib/, then we could provide a way to allow this in environments such as yours where it is appropriate. The code that would need to be modified is located in /usr/lib/portage/bin/misc-functions.sh.
Comment 5 René Berber 2011-12-21 03:22:04 UTC
(In reply to comment #4)
> The reason for this error is that Gentoo's policy is to install *.a and *.la in
> /usr/lib/ rather than /lib/.

The log at the end shows 2 things (line 2312 in the log):

1. The .a and .la files are installed to the temporary usr/lib;
2. The .dll.a files apparently where in lib, and they where deleted (I couldn't find them in the work directory); but see comments below.

> Would it make any sense to re-locate them to /usr/lib/? If they really belong
> in /lib/, then we could provide a way to allow this in environments such as
> yours where it is appropriate. The code that would need to be modified is
> located in /usr/lib/portage/bin/misc-functions.sh.

Configure has a "--prefix=/usr" (line 25 on the log), but...

Later (line 549) there is a "make install-lib libdir=\"$builddir/lib\" includedir=\"$builddir/lib\"" which appears to change things to lib, but I'm not sure if this is an intermediary step.

The .dll.a file (line 2167) is installed in usr/lib, same for the static libraries.

Looking at what the QA message is complaining: libcharset.dll.a the log at line 2167 shows it was installed to the correct directory, i.e.

"
libtool: install: /usr/bin/install -c -m 644 .libs/libcharset.dll.a /usr/x86_64-w64-mingw32/tmp/portage/dev-libs/libiconv-1.14/image//usr/lib/libcharset.dll.a
libtool: install: base_file=`basename libcharset.la`
"

So the message at the end makes no sense to me.  That's why it looks like a bug, not a new feature that needs to be supported (for the package I was trying to build).
Comment 6 Zac Medico gentoo-dev 2011-12-21 03:34:40 UTC
(In reply to comment #5)
> 2. The .dll.a files apparently where in lib, and they where deleted (I couldn't
> find them in the work directory); but see comments below.

I don't know how they could have been deleted. The code that triggers the message calls die immediately after it finds them, and it doesn't remove them:

# Make sure people don't store libtool files or static libs in /lib
f=$(ls "${ED}"lib*/*.{a,la} 2>/dev/null)
if [[ -n ${f} ]] ; then
	vecho -ne '\n'
	eqawarn "QA Notice: Excessive files found in the / partition"
	eqawarn "${f}"
	vecho -ne '\n'
	die "static archives (*.a) and libtool library files (*.la) do not belong in /"
fi
Comment 7 René Berber 2011-12-21 18:34:38 UTC
(In reply to comment #6)
> I don't know how they could have been deleted. The code that triggers the
> message calls die immediately after it finds them, and it doesn't remove them:

My mistake, they are there, not deleted.  I was probably looking at the wrong place.

Back to the problem, as I said in the log line 2167 the installation of those files is made to usr/lib... unless the double slash has side effects I don't know about (i.e. //usr/lib is treated as /lib).

I don't see anything else in the log.

Testing by hand the install command works as expected.

No idea how those files ended in lib instead of usr/lib.
Comment 8 SpanKY gentoo-dev 2011-12-22 00:37:10 UTC
not sure if this is a larger problem with static-only targets (such as mint or mingw (ignoring dll's which are not a tree-wide solution)), or if this could be fixed with the simple:

-       # Move static libs and creates ldscripts into /usr/lib
-       dodir /$(get_libdir)
-       mv "${D}"/usr/$(get_libdir)/lib{iconv,charset}*$(get_libname)* "${D}/$(get_libdir)" || die
-       gen_usr_ldscript libiconv$(get_libname)
-       gen_usr_ldscript libcharset$(get_libname)
+       gen_usr_ldscript -a iconv charset
Comment 9 Alexis Ballier gentoo-dev 2013-08-26 21:49:16 UTC
(In reply to SpanKY from comment #8)
> not sure if this is a larger problem with static-only targets (such as mint
> or mingw (ignoring dll's which are not a tree-wide solution)), or if this
> could be fixed with the simple:
> 
> -       # Move static libs and creates ldscripts into /usr/lib
> -       dodir /$(get_libdir)
> -       mv "${D}"/usr/$(get_libdir)/lib{iconv,charset}*$(get_libname)*
> "${D}/$(get_libdir)" || die
> -       gen_usr_ldscript libiconv$(get_libname)
> -       gen_usr_ldscript libcharset$(get_libname)
> +       gen_usr_ldscript -a iconv charset

this is what current ebuilds have and seem not to be an issue anymore -> closing