groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linking/compile error


From: G. Branden Robinson
Subject: Re: linking/compile error
Date: Wed, 7 Dec 2022 09:00:41 -0600

Hello Heinz,

At 2022-12-06T17:38:02+0100, Heinz-Jürgen Oertel wrote:
> after at least on year I  was in the need to compile and install groff
> on Tumbleweed.

That's openSUSE, for folks like me who didn't already know.

> I got:
> CXXLD    grodvi
> /usr/bin/ld: libgroff.a(libgroff_a-getopt.o): relocation R_X86_64_32
> against `.rodata.str1.1' can not be used when making a PIE object;
> recompile with -fPIE

This is a linker error[1] and suggests to me that the toolchain on your
system is misconfigured (or you have stale object files lying around,
but as you said below, you cleaned).  It might also be the case that you
have a stray CFLAGS variable in your environment that is passing
inappropriate options to the build.

A brute force approach would be to './configure' and/or 'make' with
'CFLAGS=-fPIE' and see if that fixes it, but I think there might be a
cleaner solution...

> The same error after a "git pull"  and "make clean" with current
> sources

When building groff from a Git checkout, you should use "make distclean"
instead of a regular "make clean".

Our INSTALL.extra file mentions this.

  5. You can remove the groff executables and other generated files from
     the source code directory by typing 'make clean'.  To also remove
     the files that 'configure' created (so you can compile groff for a
     different kind of computer or with different options to
     'configure'), type 'make distclean'.

You mentioned that it had been a year since you built groff.  It occurs
to me now that "make distclean" might also be good advice if the
toolchain on the system has changed, since theoretically defaults
regarding position-independent code (PIC) and position-independent
executables (PIE) might have changed.  You can likely rely on Autoconf
to detect and adapt to such changes, but "make clean" does not erase
what the "configure" script produces--and that script is what runs all
the Autoconf checks.

I'm not certain, but my guess is that any sort of ABI break could cause
problems like this, and some years ago, C++ on Linux was notorious for a
series of ABI breaks.  So much so that a crust of thick-walled
conservatism has formed over current practice, less due to sagacious
wisdom from experts than terror of disrupting a fragile status quo.[2]

Anyway, "make distclean", re-"./configure", and try again.

Alternatively, for your convenience I'm attaching the script I've been
using for years to do clean builds _all the time_.  It's called
"make-groff-fast" because I have another that runs "make distcheck",
which more than doubles the build time, and probably only a groff
maintainer would care to test a build from a distribution archive.[3]

Let me know if this works, or doesn't.

Regards,
Branden

[1] See Table 4.10 in the Linux AMD64 ABI specification.
    https://refspecs.linuxbase.org/elf/x86_64-abi-0.99.pdf

[2] 
https://thephd.dev/binary-banshees-digital-demons-abi-c-c++-help-me-god-please

[3] But I do, before pushing, every time, and it's saved me a few.

Attachment: make-groff-fast
Description: Text document

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]