Subject: bug#22258: libtool should skip .la files it cannot read

From: Basin Ilya <[email-masked]>
Date: Mon, 28 Dec 2015 15:48:49 +0300

libtool behavior differs from GNU linker (ld) behavior

When a .so file exists in library path, but ld fails to open it due to
file permissions, it silently skips it and tries next directory.
Libtool fails with: "is not a valid libtool archive"

    [git@dioptase ~]$ ls -l
/opt/oracle/product/12.1.0.2/OraClient12c_Home1/lib/libexpat.*
    -rw-------. 1 oracle oracle 617772 Nov  8  2011
/opt/oracle/product/12.1.0.2/OraClient12c_Home1/lib/libexpat.a
    -rw-------. 1 oracle oracle    793 Nov  8  2011
/opt/oracle/product/12.1.0.2/OraClient12c_Home1/lib/libexpat.la
    -rw-------. 1 oracle oracle 408282 Nov  8  2011
/opt/oracle/product/12.1.0.2/OraClient12c_Home1/lib/libexpat.so
    -rw-------. 1 oracle oracle 408282 Nov  8  2011
/opt/oracle/product/12.1.0.2/OraClient12c_Home1/lib/libexpat.so.1
    -rw-------. 1 oracle oracle 408282 Nov  8  2011
/opt/oracle/product/12.1.0.2/OraClient12c_Home1/lib/libexpat.so.1.5.2
    [git@dioptase ~]$ echo 'int main(int argc, char *argv[]) { return 0;
}' >test.c
    [git@dioptase ~]$ gcc -c test.c
    [git@dioptase ~]$ gcc
-L/opt/oracle/product/12.1.0.2/OraClient12c_Home1/lib -lexpat -o test test.o
    [git@dioptase ~]$ libtool --tag=CC --mode=link gcc
-L/opt/oracle/product/12.1.0.2/OraClient12c_Home1/lib -lexpat -o test test.o
    libtool: link:
`/opt/oracle/product/12.1.0.2/OraClient12c_Home1/lib/libexpat.la' is not
a valid libtool archive

libtool version 2.4.6

-- 

--------------------------------------------------------------------------------
Kind regards,
Ilya Basin
software engineer
Reksoft

Skype: basin_ilya
phone +7(812)324-24-40*553