Subject: bug#30785: Man pages truncated, repeated

From: Danny Milosavljevic <[email-masked]>
Date: Mon, 14 Jan 2019 22:42:49 +0100

Hi Pierre,
Hi Ludo,

On Mon, 14 Jan 2019 21:27:35 +0100
Ludovic Courtès <[email-masked]> wrote:

> The ‘set_current_prefix’ logic is extremely fragile; it should readlink
> from /proc/self/exe on GNU/Linux.
> 
> But in our case, no relocation happens, so we can just patch it to do:
> 
>   void set_current_prefix (void)
>   {
>     curr_prefix = "/gnu/store/…";
>   }

I agree.

However, in this case the question is why is it picking up all that stuff anyway.

The relocation is only used in the case of the groff-local localcharset.c being
used.
It's only a fallback that is used if glibc < 2.1.  I've checked the guix build
logs, the glibc version is newer and also found by the 'configure phase of groff.

I can't tell about groff-minimal because the build log as given by
"guix build --log-file groff-minimal"
(https://ci.guix.info/log/mpjn4jfx5i8jxblfj538n22hv56rdnhw-groff-minimal-1.22.3)
has 0 Bytes.

Anyway, a simple way to disable this weird relocation business would be to remove:

./src/libs/libgroff/Makefile.sub:             -DENABLE_RELOCATABLE=1 \

However, it would be preferrable to find out why ./src/libs/gnulib/lib/localcharset.c
(the only user of it) is used at all.  It really shouldn't be.