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
Created attachment 691245 [details] libdbi-drivers-0.9.0-r1:20210313-104912.log buildlog
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...
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(+)