Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938472 - sci-libs/libcerf-1.17 installs pkg-config file with mismatched libdir (seen with sci-visualization/gnuplot-6.0.1)
Summary: sci-libs/libcerf-1.17 installs pkg-config file with mismatched libdir (seen w...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: pkg-config_mismatched-libdir
  Show dependency tree
 
Reported: 2024-08-24 20:20 UTC by Toralf Förster
Modified: 2024-08-26 22:05 UTC (History)
1 user (show)

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


Attachments
emerge-info.txt (emerge-info.txt,18.47 KB, text/plain)
2024-08-24 20:20 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,91.85 KB, text/plain)
2024-08-24 20:20 UTC, Toralf Förster
Details
environment (environment,127.37 KB, text/plain)
2024-08-24 20:20 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,1.22 KB, application/x-xz)
2024-08-24 20:20 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,37.64 KB, application/x-xz)
2024-08-24 20:20 UTC, Toralf Förster
Details
logs.tar.xz (logs.tar.xz,18.29 KB, application/x-xz)
2024-08-24 20:20 UTC, Toralf Förster
Details
qlist-info.txt (qlist-info.txt,194.17 KB, text/plain)
2024-08-24 20:20 UTC, Toralf Förster
Details
sci-visualization:gnuplot-6.0.1:20240824-200207.log (sci-visualization:gnuplot-6.0.1:20240824-200207.log,32.88 KB, text/plain)
2024-08-24 20:20 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,39.41 KB, application/x-xz)
2024-08-24 20:20 UTC, Toralf Förster
Details
var.tmp.clang.tar.xz (var.tmp.clang.tar.xz,3.06 KB, application/x-xz)
2024-08-24 20:20 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2024-08-24 20:20:35 UTC
too long lines were shrinked:

clang -DHAVE_CONFIG_H -I. -I..  -I../term -I../term -DBINDIR=\"/usr/bin\" -DX11_DRIVER_DIR=\"/usr/libexec/gnuplot/6.0\" -DQT_DRIVER_DIR=\"/usr/libexec/gnuplot/6.0\" -DGNUPLOT_SHARE_DIR=\"/usr/share/gnuplot/6.0\" -DGNUPLOT_PS_DIR=\"/usr/share/gnuplot/6.0/PostScript\" -DGNUPLOT_JS_DIR=\"/usr/share/gnu
clang -DHAVE_CONFIG_H -I. -I..  -I../term -I../term -DBINDIR=\"/usr/bin\" -DX11_DRIVER_DIR=\"/usr/libexec/gnuplot/6.0\" -DQT_DRIVER_DIR=\"/usr/libexec/gnuplot/6.0\" -DGNUPLOT_SHARE_DIR=\"/usr/share/gnuplot/6.0\" -DGNUPLOT_PS_DIR=\"/usr/share/gnuplot/6.0/PostScript\" -DGNUPLOT_JS_DIR=\"/usr/share/gnu
In file included from axis.c:33:
In file included from ./axis.h:40:
In file included from ./gadgets.h:38:
In file included from ./term_api.h:39:
./stdfn.h:63:8: error: conflicting types for 'memcpy'
   63 | char * memcpy(char *, char *, size_t);
      |        ^

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 23.0_llvm_systemd-20240823-074159

  The attached etc.portage.tar.xz has all details.
  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-13 *
clang/llvm (if any):
clang version 18.1.8+libcxx
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/18/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
/usr/lib/llvm/18
18.1.8+libcxx
Python 3.12.5
Available Rust versions:
  [1]   rust-bin-1.80.1 *
The Glorious Glasgow Haskell Compilation System, version 9.0.2
php cli (if any):
go version go1.23.0 linux/amd64

  HEAD of ::gentoo
commit 5fcec5478f309c05dea2bb61dbc945f44c3188e3
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Sat Aug 24 19:33:59 2024 +0000

    2024-08-24 19:33:59 UTC

emerge -qpvO =sci-visualization/gnuplot-6.0.1
[ebuild  N    ] sci-visualization/gnuplot-6.0.1  USE="X examples gd libcerf metafont metapost readline regis -amos (-aqua) -bitmap -cairo -doc -gpic -latex -libcaca -lua -qt5 -tgif -wxwidgets" LUA_SINGLE_TARGET="lua5-1 -lua5-3 -lua5-4"
Comment 1 Toralf Förster gentoo-dev 2024-08-24 20:20:36 UTC
Created attachment 901169 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2024-08-24 20:20:37 UTC
Created attachment 901170 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2024-08-24 20:20:38 UTC
Created attachment 901171 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2024-08-24 20:20:39 UTC
Created attachment 901172 [details]
etc.clang.tar.xz
Comment 5 Toralf Förster gentoo-dev 2024-08-24 20:20:40 UTC
Created attachment 901173 [details]
etc.portage.tar.xz
Comment 6 Toralf Förster gentoo-dev 2024-08-24 20:20:41 UTC
Created attachment 901174 [details]
logs.tar.xz
Comment 7 Toralf Förster gentoo-dev 2024-08-24 20:20:42 UTC
Created attachment 901175 [details]
qlist-info.txt
Comment 8 Toralf Förster gentoo-dev 2024-08-24 20:20:43 UTC
Created attachment 901176 [details]
sci-visualization:gnuplot-6.0.1:20240824-200207.log
Comment 9 Toralf Förster gentoo-dev 2024-08-24 20:20:44 UTC
Created attachment 901177 [details]
temp.tar.xz
Comment 10 Toralf Förster gentoo-dev 2024-08-24 20:20:45 UTC
Created attachment 901178 [details]
var.tmp.clang.tar.xz
Comment 11 Ulrich Müller gentoo-dev 2024-08-24 22:44:43 UTC
(In reply to Toralf Förster from comment #8)
> Created attachment 901176 [details]
> sci-visualization:gnuplot-6.0.1:20240824-200207.log

Something went very wrong earlier, during configure:

checking for atexit... no
checking for memcpy... no
checking for memmove... no
checking for memset... no
[... about 40 other functions not found ...]

AFAICS these are checked with a vanilla AC_CHECK_FUNCS in configure.ac.

Then there is this in config.log (line 3704 and following):

configure:11444: checking for atexit
configure:11444: clang -o conftest -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int    -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -L/usr/lib -lcerf conftest.c  >&5
ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/Scrt1.o is incompatible with elf32-i386
ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/crti.o is incompatible with elf32-i386
ld.lld: error: /usr/lib/llvm/18/bin/../../../../lib/clang/18/lib/linux/clang_rt.crtbegin-x86_64.o is incompatible with elf32-i386
ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libcerf.so is incompatible with elf32-i386
ld.lld: error: /var/tmp/portage/sci-visualization/gnuplot-6.0.1/temp/conftest-e06c33.o is incompatible with elf32-i386
ld.lld: error: /usr/lib/llvm/18/bin/../../../../lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a(absvdi2.c.o) is incompatible with elf32-i386
ld.lld: error: /usr/lib/llvm/18/bin/../../../../lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a(absvsi2.c.o) is incompatible with elf32-i386
ld.lld: error: /usr/lib/llvm/18/bin/../../../../lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a(absvti2.c.o) is incompatible with elf32-i386

Not sure what is happening there. Looks like it's trying to link 32 bit with 64 bit binaries?

I cannot reproduce the problem (with clang/llvm and the exact same set of USE flags).
Comment 12 Ulrich Müller gentoo-dev 2024-08-24 22:49:53 UTC
This seems suspicious:

$ pkg-config --libs libcerf
-L/usr/lib -lcerf

Does the package build for you with USE="-libcerf"?
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-25 18:18:37 UTC
You need to use lld (-fuse-ld=lld). lld rejects objects of the wrong type, while bfd just warns about it. I do have a patch locally to make bfd error out on it if you want it.
Comment 14 Ulrich Müller gentoo-dev 2024-08-26 21:58:01 UTC
(In reply to Sam James from comment #13)
> You need to use lld (-fuse-ld=lld).

Thanks, I can reproduce the problem now. (I had LD="ld.lld" but apparently it wasn't enough.)

Tweaking libcerf.pc for the correct libdir fixes the problem:

--- /usr/lib64/pkgconfig/libcerf.pc~  2024-08-26 23:45:30.000000000 +0200
+++ /usr/lib64/pkgconfig/libcerf.pc   2024-08-26 23:52:16.300509288 +0200
@@ -1,6 +1,6 @@
 prefix=/usr
 exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=${prefix}/lib64
 includedir=${prefix}/include
 
 Name: libcerf
Comment 15 Ulrich Müller gentoo-dev 2024-08-26 22:05:19 UTC
The problem is with sci-libs/libcerf, therefore reassigning to sci.

Patch is available upstream:
https://jugit.fz-juelich.de/mlz/libcerf/-/commit/db4497bdf63fb14973169e7e661be2477c174cdb