Zyle Moore <[email protected]> writes:

That's great you got it working.

> 1. Add "/usr/local/lib" to a new file in /etc/ld.so.conf.d/usr-local.conf.

This is in my view an Ubuntu bug for not allowing the normal RPATH
mechanism, and given that they don't, that it wasn't documented well
enough that you noticed :-) But apparently adding /usr/local/lib to the
ld.so.conf is the plan.  I wonder what the docs said about how files in
/etc/ld.so.conf.d are ordered, both among themselves, and relative to
the built-in search path, but that's not about guile.

> After doing this, running `ldconfig` resulted in this error
> /sbin/ldconfig.real: /usr/local/lib/libguile-3.0.so.1.7.1-gdb.scm is not an
> ELF file - it has the wrong magic bytes at the start.
>
> 2. Remove libguile-3.0.so.1.7.1-gdb.scm from /usr/local/lib
>
> I'm not sure if this is Ubuntu special sauce, or if this file is ending up
> there incorrectly, but it really wants everything in all ld folders to be
> only ELF files. After doing these two steps after `sudo make install`,
> guile seems to be working now.

guile script that is helpful for running guile under gdb.  Read it!

I don't think there are any rules in the larger POSIX ecosystem about
not having files that aren't ELF libs in $prefix/lib.    I see this as a
self-inflicted wound by Ubuntu's ld.so.conf decision;  normally a file
in $prefix/lib is only even opened if there is a NEEDED/RPATH
combination that references it.

It may be that having .so in it somwehere is the issue.  There are
non-ELF files in lib mnormally.  FWIW on my system:

  $ ls -l /usr/pkg/guile/3.0/lib/
  total 4120
  drwxr-xr-x  3 root  wheel      512 Dec  6  2022 guile
  -rw-r--r--  1 root  wheel  2657138 Apr 26 05:46 libguile-3.0.a
  -rwxr-xr-x  1 root  wheel     1063 Apr 26 05:46 libguile-3.0.la
  lrwxr-xr-x  1 root  wheel       21 Apr 26 05:46 libguile-3.0.so -> 
libguile-3.0.so.1.7.1
  lrwxr-xr-x  1 root  wheel       21 Apr 26 05:46 libguile-3.0.so.1 -> 
libguile-3.0.so.1.7.1
  -rwxr-xr-x  1 root  wheel  1486880 Apr 26 05:46 libguile-3.0.so.1.7.1
  -rw-r--r--  1 root  wheel    17469 Apr 26 05:46 libguile-3.0.so.1.7.1-gdb.scm
  drwxr-xr-x  2 root  wheel      512 Apr 26 05:47 pkgconfig


> Below is the output of ldd and objdump for context
> ldd:
> zymus@abyss:~/src/guile-3.0.11$ ldd /usr/local/bin/guile
> linux-vdso.so.1 (0x00007ffc61064000)
> libguile-3.0.so.1 => /usr/local/lib/libguile-3.0.so.1 (0x00007aecfc4e7000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007aecfc200000)
> libgc.so.1 => /lib/x86_64-linux-gnu/libgc.so.1 (0x00007aecfc472000)
> libffi.so.8 => /lib/x86_64-linux-gnu/libffi.so.8 (0x00007aecfc465000)
> libunistring.so.5 => /usr/local/lib/libunistring.so.5 (0x00007aecfc017000)
> libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007aecfbf95000)
> libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007aecfc429000)
> libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007aecfbeae000)
> /lib64/ld-linux-x86-64.so.2 (0x00007aecfc64a000)
>
> objdump:
> zymus@abyss:~/src/guile-3.0.11$ objdump -x /usr/local/bin/guile | egrep
> NEEDED\|RPATH
>   NEEDED               libguile-3.0.so.1
>   NEEDED               libc.so.6

So missing RPATH as you already determined, but otherwise looks fine to
me.

Did guile insttall unistring, or did you have to build that too?



Reply via email to