Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 775878 - dev-db/libdbi-drivers-0.9.0-r1[postgres] error: /usr/lib64/postgresql-13/lib64: read: Is a directory when using slibtool
Summary: dev-db/libdbi-drivers-0.9.0-r1[postgres] error: /usr/lib64/postgresql-13/lib6...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: slibtool
  Show dependency tree
 
Reported: 2021-03-13 22:07 UTC by Alessandro Barbieri
Modified: 2021-03-19 21:43 UTC (History)
2 users (show)

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


Attachments
libdbi-drivers-0.9.0-r1:20210313-104912.log (libdbi-drivers-0.9.0-r1:20210313-104912.log,36.50 KB, text/plain)
2021-03-13 22:08 UTC, Alessandro Barbieri
Details
Patch to fix the pgsql linker path. (libdbi-drivers-0.9.0-pgsql-fix.patch,532 bytes, patch)
2021-03-19 16:15 UTC, orbea
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Barbieri 2021-03-13 22:07:53 UTC
slibtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc  -std=gnu99 -Os -pipe -march=native -Os -pipe -march=native -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -module -avoid-version /usr/lib64/postgresql-13/lib64 -lpq -no-undefined -ldbi -L/usr/lib64 -Wl,-O1 -Wl,--as-needed -o libdbdpgsql.la -rpath /usr/lib64/dbd dbd_pgsql.lo  
slibtool: link: ar crs .libs/libdbdpgsql.a .libs/dbd_pgsql.o
slibtool: link: x86_64-pc-linux-gnu-gcc .libs/dbd_pgsql.o -std=gnu99 -Os -pipe -march=native -Os -pipe -march=native -Wimplicit-function-declaration -Wno-error=implicit-function-declaration /usr/lib64/postgresql-13/lib64 -lpq -ldbi -L/usr/lib64 -Wl,-O1 -Wl,--as-needed -shared -fPIC -Wl,--no-undefined -o .libs/libdbdpgsql.so
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: /usr/lib64/postgresql-13/lib64: read: Is a directory
collect2: error: ld returned 1 exit status
slibtool: exec error upon slbt_exec_link_create_library(), line 1446: (see child process error messages).
slibtool: < returned to > slbt_exec_link(), line 1836.
make[3]: *** [Makefile:477: libdbdpgsql.la] Error 2
make[3]: Leaving directory '/var/tmp/portage/dev-db/libdbi-drivers-0.9.0-r1/work/libdbi-drivers-0.9.0/drivers/pgsql'
make[2]: *** [Makefile:404: all-recursive] Error 1
make[2]: Leaving directory '/var/tmp/portage/dev-db/libdbi-drivers-0.9.0-r1/work/libdbi-drivers-0.9.0/drivers'
make[1]: *** [Makefile:457: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/dev-db/libdbi-drivers-0.9.0-r1/work/libdbi-drivers-0.9.0'
make: *** [Makefile:387: all] Error 2
 * ERROR: dev-db/libdbi-drivers-0.9.0-r1::gentoo failed (compile phase):
 *   emake failed
Comment 1 Alessandro Barbieri 2021-03-13 22:08:11 UTC
Created attachment 691245 [details]
libdbi-drivers-0.9.0-r1:20210313-104912.log

buildlog
Comment 2 orbea 2021-03-19 16:15:22 UTC
Created attachment 692451 [details, diff]
Patch to fix the pgsql linker path.

The problem occurs because they find the postgresql linker path with pg_config. 

$ pg_config --libdir
/usr/lib64/postgresql-13/lib64

But then miss the required -L so that they pass the file directly to the compiler which obviously does not work.

rdlibtool: link: gcc .libs/dbd_pgsql.o -std=gnu99 /usr/lib64/postgresql-13/lib64 -lpq -L/usr/lib64 -ldbi -shared -fPIC -Wl,--no-undefined -o .libs/libdbdpgsql.so
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: read in flex scanner failed

Simply adding the missing -L solves this and I guess this is another thing GNU libtool silently filters out...
Comment 3 Larry the Git Cow gentoo-dev 2021-03-19 21:43:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a11066e80787923436d8389fd0aca711f69ecf6

commit 6a11066e80787923436d8389fd0aca711f69ecf6
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-03-19 21:43:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-03-19 21:43:23 +0000

    dev-db/libdbi-drivers: fix build with slibtool
    
    Closes: https://bugs.gentoo.org/775878
    Signed-off-by: Sam James <sam@gentoo.org>

 .../libdbi-drivers-0.9.0-slibtool-libdir.patch      | 21 +++++++++++++++++++++
 .../libdbi-drivers/libdbi-drivers-0.9.0-r1.ebuild   |  1 +
 2 files changed, 22 insertions(+)