Bugzilla will be upgraded to version 5.0 on December 2, 2018. The outage period for the upgrade will start at 0:00 UTC and have a duration of 12 hours
Bug 235251 - No way to override "nosegneg" hwcap bit
No way to override "nosegneg" hwcap bit
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
Blocks: 230874
  Show dependency treegraph
Reported: 2007-04-04 14:10 EDT by Will Woods
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-21 11:33:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Will Woods 2007-04-04 14:10:16 EDT
The Xen kernel uses an "extra" hwcap bit (the "nosegneg" bit) and 
/etc/ld.so.conf.d/kernelcap-*.conf to make ld.so use the libraries in

Some circumstances (e.g. building a mkinitrd for a non-xen kernel while running
under xen, or vice-versa - see bug #230874) demand the ability to set or unset
these bits, but LD_HWCAP_MASK does not affect them. 

There should be an environment variable that ld.so honors, like LD_HWCAP_MASK,
that allows us to pass a mask/vector. (We'd probably also need the ability to
read that vector from an on-disk kernel image, but that's outside the scope of
Comment 1 Jakub Jelinek 2007-05-04 12:29:59 EDT
Adding support for this in LD_HWCAP_MASK is possible, but you'd still have hard
time to compute which bit you actually want to mask (as the bit for nosegneg
is derived from vDSO content).
I'd suggest just hardcoding this, like:
--- mkinitrd.jj 2007-04-16 17:55:39.000000000 -0400
+++ mkinitrd    2007-05-04 12:27:56.000000000 -0400
@@ -206,6 +206,20 @@ requires ${NAMES[$n]} n order to properl
             exit 1
+       case "$FILE" in
+         /lib*)
+           LIBDIR=`echo "$FILE" | sed 's,\(/lib[^/]*\)/.*$,\1,'`
+           BASE=`basename "$FILE"`
+           # Prefer nosegneg libs over direct segment accesses on i686.
+           if [ -f "$LIBDIR/i686/nosegneg/$BASE" ]; then
+             FILE="$LIBDIR/i686/nosegneg/$BASE"
+           # Otherwise, prefer base libraries rather than their optimized
+           # variants.
+           elif [ -f "$LIBDIR/$BASE" ]; then
+             FILE="$LIBDIR/$BASE"
+           fi
+           ;;
+       esac
         let n++
@@ -426,7 +440,12 @@ inst() {
             get_dso_deps "$file"
             local DEPS="$DSO_DEPS"
             for x in $DEPS ; do
-                inst "$x" "$root"
+               l=`echo "$x" | sed -n 's,\(/lib[^/]*\)/.*$,\1,p'`
+               if [ -n "$l" ]; then
+                 inst "$x" "$root" "$l"/`basename "$x"`
+               else
+                 inst "$x" "$root"
+               fi

Perhaps even extend the latter chunk, install all shared libraries into /lib{,64}
.  This would create initrd that is usable with any kernels.  If you want to
taylor it for xen vs. non-xen kernels, you can add/remove that i686/nosegneg
preference depending on it.
Comment 2 Peter Jones 2007-05-21 11:33:29 EDT
Fixed in mkinitrd-6.0.9-3 .

Note You need to log in before you can comment on or make changes to this bug.