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.
#!/bin/sh set -e PROGNAME=${0##*/} : ${CORES:=1} COMMON_FLAGS="-Wall -Wextra -Wformat=2 \ -Wstringop-overflow=4 \ -Wshadow=global -Wredundant-decls \ -Wunused \ -Wunused-parameter \ -fsanitize=signed-integer-overflow \ -fsanitize-undefined-trap-on-error \ -fstack-protector-strong -fno-common \ -fstack-clash-protection \ -ftrapv \ -funsigned-char \ -fvar-tracking-assignments \ -ggdb" CFLAGS="$COMMON_FLAGS -Og \ -Wmissing-prototypes \ -Wold-style-definition \ -Wstrict-prototypes \ -Wold-style-declaration \ -Wformat=2 -D_FORTIFY_SOURCE=2" CXXFLAGS="$COMMON_FLAGS -Og \ -fcheck-new \ -Wredundant-decls \ -std=c++98 -pedantic -Wformat=2 -D_FORTIFY_SOURCE=2" export CFLAGS CXXFLAGS if [ $# -gt 1 ]; then echo "$PROGNAME: error: expected 0 or 1 arguments, got $#" >&2 exit 1 fi if [ -n "$1" ]; then if expr "$1" - 0 >/dev/null 2>&1; then CORES=$1 else echo "$PROGNAME: usage error: argument \"$1\" should be number of" \ "cores" >&2 exit 2 fi fi if ! test -f ./test-groff.in; then echo "$PROGNAME: error: ./test-groff.in not found" >&2 exit 3 fi set -x if [ -n "$IN_TREE" ] then test -f Makefile && make distclean else test -d ./build && (cd build && make distclean) test -d build && rm -r build fi if [ -z "$IN_TREE" ] then ./bootstrap && \ mkdir build && \ cd build && \ ../configure && make -j $CORES && \ make check else ./bootstrap && \ ./configure && \ make -j $CORES && \ make check fi # vim:set ai et sw=4 ts=4 tw=80:
signature.asc
Description: PGP signature