Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 956487 - app-crypt/johntheripper-1.9.0 x86 build error with binutils-2.44 USE=hardened: ld: read-only segment has dynamic relocations
Summary: app-crypt/johntheripper-1.9.0 x86 build error with binutils-2.44 USE=hardened...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal
Assignee: Rick Farina (Zero_Chaos)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: binutils-2.41
  Show dependency tree
 
Reported: 2025-05-23 14:33 UTC by Alex Cannon
Modified: 2025-05-24 03:32 UTC (History)
1 user (show)

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


Attachments
Complete build log as created by emerge (john-build.log,10.61 KB, text/x-log)
2025-05-24 03:17 UTC, Alex Cannon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Cannon 2025-05-23 14:33:04 UTC
with USE=hardened on binutils-2.44, johntheripper-1.9.0 fails to build. This problem is happening with gzip and php packages as well.

emerge -pvq:
[ebuild   R   ] app-crypt/johntheripper-1.9.0  USE="openmp -custom-cflags" CPU_FLAGS_X86="-avx -avx2 -avx512f -mmx -sse2 -xop" 

 * IMPORTANT: 2 news items need reading for repository 'dlang'.
 * IMPORTANT: 56 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


Portion of the build log for johntheripper:
i686-pc-linux-gnu-gcc DES_fmt.o DES_std.o DES_bs.o DES_bs_b.o BSDI_fmt.o MD5_fmt.o MD5_std.o BF_fmt.o BF_std.o AFS_fmt.o LM_fmt.o trip_fmt.o dummy.o batch.o bench.o charset.o common.o compiler.o config.o cracker.o crc32.o external.o formats.o getopt.o idle.o inc.o john.o list.o loader.o logger.o memory.o misc.o options.o params.o path.o recovery.o rpp.o rules.o signals.o single.o status.o tty.o wordlist.o unshadow.o unafs.o unique.o c3_fmt.o x86.o -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -fopenmp -lcrypt -o ../run/john
/usr/lib/gcc/i686-pc-linux-gnu/14/../../../../i686-pc-linux-gnu/bin/ld: x86.o: warning: relocation in read-only section `.text'
/usr/lib/gcc/i686-pc-linux-gnu/14/../../../../i686-pc-linux-gnu/bin/ld: read-only segment has dynamic relocations
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:907: ../run/john] Error 1
make[1]: Leaving directory '/mnt/big_fs/var_tmp_portage/app-crypt/johntheripper-1.9.0/work/john-1.9.0/src'
make: *** [Makefile:298: linux-x86-any] Error 2


Reproducible: Always

Steps to Reproduce:
1. install binutils with +hardened
2. install johntheripper
3.



Portage 3.0.67 (python 3.12.10-final-0, default/linux/x86/23.0/i686/split-usr, gcc-14, glibc-2.40-r8, 4.4.246-gentoo i686)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.4.246-gentoo-i686-AMD_Athlon-tm-_XP_2800+-with-glibc2.40
KiB Mem:     1993148 total,    224828 free
KiB Swap:    8226924 total,   5639540 free
Timestamp of repository gentoo: Tue, 22 Apr 2025 21:15:00 +0000
Head commit of repository gentoo: f5155c364abda7866b83f14251155f1aaa323ce1
Timestamp of repository dlang: Tue, 15 Apr 2025 14:37:27 +0000
Head commit of repository dlang: 54cc9f6268e27cfd61b1242de8f7c1ee460ac7d3

sh bash 5.2_p37
ld GNU ld (Gentoo 2.44 p1) 2.44.0
app-misc/pax-utils:        1.3.8::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo, 1.17-r1::gentoo
dev-build/cmake:           3.31.5::gentoo
dev-build/libtool:         2.5.4::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.7.0::gentoo
dev-lang/perl:             5.40.2::gentoo
dev-lang/python:           3.10.17::gentoo, 3.11.12::gentoo, 3.12.10::gentoo, 3.13.3::gentoo
sys-apps/baselayout:       2.17::gentoo
sys-apps/openrc:           0.56::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-devel/binutils:        2.44::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             14.2.1_p20241221::gentoo
sys-devel/gcc-config:      2.12.1::gentoo
sys-kernel/linux-headers:  6.12::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: [redacted]://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-verify-max-age: 3
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1

MyOverlay
    location: /usr/local/portage
    masters: gentoo
    volatile: True

dlang
    location: /var/db/repos/dlang
    sync-type: git
    sync-uri: [redacted]://github.com/gentoo-mirror/dlang.git
    masters: gentoo
    volatile: False

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="@FREE Oracle-BCLA-JavaSE IBM-J1.6 NPSL ISOC-rfc 9wm FESTIVAL MPEG-4 linux-firmware"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium3 -mtune=athlon-xp -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind /var/lib/i2pd/certificates"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.2/ext-active/ /etc/php/cgi-php8.2/ext-active/ /etc/php/cli-php8.2/ext-active/ /etc/php/fpm-php8.2/ext-active/ /etc/php/phpdbg-php8.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=pentium3 -mtune=athlon-xp -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="[redacted]://distfiles.gentoo.org"
LANG="C.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
LINGUAS="en fr de es it nl ru sv"
MAKEOPTS="-j1"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="7zip X a52 aac aalib acc acl alsa apache2 apng bash-completion bazaar berkdb bittorrent bzip2 caps cgi chappa crypt cvs dbus dga divx4linux dlz dmd-2_067 dvd dvdread emacs encode esd esound examples extras faac faad fbcon fdformat finger fltk fontconfig ftp gd gdbm geoip gif gimp git gnutella gnutls gopher gpg gpm graph gtk2 harfbuzz html hwdb iconv idn imagemagick imap imlib ipv6 jadetex jpeg kdeenablefinal libcaca libopts libtirpc live lzo mad math mbox messages minizip mmx mmxext mng motif mp2 mp3 mpeg mpi multinet nas ncat ncurses ndiff nginx nls nntp nping nptl offensive ogg oident old-kernel openft openmp openssl pam pcre pcre16 perl png pnm policykit pop proxy_http purple python qt3support qt4 readline rtmp savedconfig scripting seccomp server sidebar smtp snmp socks5 speex split-usr sqlite sse ssl sslv3 subversion suexec syslog tcl test-rust text theora threads tiff tk truetype tty-helpers unicode usb v4l vcd vim-syntax vnc vorbis x264 x86 xa xattr xinetd xkb xv xvid zlib" ABI_X86="32" ADA_TARGET="gcc_14" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx 3dnow mmxext 3dnowext sse" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en fr" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres17" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_6 python3_7 python3_8 python3_9 python3_10 python3_11 python3_12" QEMU_SOFTMMU_TARGETS="i386 alpha arm m68k mips mips64 mips64el mipsel ppc ppc64 ppcemb sparc sparc64 x86_64" QEMU_USER_TARGETS="alpha arm armeb i386 m68k mips mips64 mips64el mipsel mipsn32 mipsn32el ppc ppc64 ppc64abi32 ppc64le sparc sparc32plus sparc64 x86_64" RUBY_TARGETS="ruby32" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

app-crypt/johntheripper-1.9.0::gentoo was built with the following:
USE="openmp -custom-cflags" CPU_FLAGS_X86="-avx -avx2 -avx512f -mmx -sse2 -xop"
CFLAGS="-O2 -march=pentium3 -mtune=athlon-xp -pipe -fPIC -fPIE"
CXXFLAGS="-O2 -march=pentium3 -mtune=athlon-xp -pipe -fPIC -fPIE"
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-23 17:55:07 UTC
Please include the full build.log. Thanks.
Comment 2 Alex Cannon 2025-05-24 03:17:24 UTC
Created attachment 929411 [details]
Complete build log as created by emerge

This is the build log.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-24 03:22:06 UTC
Thanks.

(In reply to Alex Cannon from comment #0)
> with USE=hardened on binutils-2.44, johntheripper-1.9.0 fails to build. This
> problem is happening with gzip and php packages as well.
> 

Please file separate bugs for those. They're issues in individual packages.

gzip could be bug 924202, but a user there says USE=pic helped them. If USE=pic didn't help you, it needs its own bug.

PHP is probably bug 940518.

I do recommend using the hardened profile or making a custom profile which inherits it so you get other defaults (like USE=pic in there).
Comment 4 Alex Cannon 2025-05-24 03:30:57 UTC
This error with johntheripper, gzip, and php actually originally happened with the hardened profile. I switched away from hardened so I could finish installing things, but just having binutils with USE=hardened seems to reproduce the problem without having to compile all of gcc again.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-24 03:32:00 UTC
The workaround for these is -Wl,-z,notext.