Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 403767 - dev-util/valgrind-3.7.0-r3 - TEXTREL usr/lib/valgrind/vgpreload_*-*-linux.so
Summary: dev-util/valgrind-3.7.0-r3 - TEXTREL usr/lib/valgrind/vgpreload_*-*-linux.so
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: PPC Linux
: Normal normal
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-15 04:06 UTC by hiyuh
Modified: 2012-07-25 15:05 UTC (History)
0 users

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


Attachments
*incomplete* patch for TEXTREL fix on ppc32 and ppc64 (valgrind-3.7.0-non-exec-stack-ppc.patch,3.77 KB, patch)
2012-02-15 09:25 UTC, hiyuh
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description hiyuh 2012-02-15 04:06:02 UTC
after emerge =dev-util/valgrind-3.7.0-r3, i got,

 * Package:    dev-util/valgrind-3.7.0-r3
 * Repository: gentoo
 * Maintainer: blueness@gentoo.org
 * USE:        elibc_glibc kernel_linux ppc userland_GNU
 * FEATURES:   ccache sandbox userpriv usersandbox
 * Package:    dev-util/valgrind-3.7.0-r3
 * Repository: gentoo
 * Maintainer: blueness@gentoo.org
 * USE:        elibc_glibc kernel_linux ppc userland_GNU
 * FEATURES:   ccache sandbox userpriv usersandbox
 * Applying valgrind-3.7.0-respect-flags.patch ...
 * Applying valgrind-3.7.0-fno-stack-protector.patch ...
 * Applying valgrind-3.6.0-local-labels.patch ...
 * Applying valgrind-3.7.0-non-exec-stack.patch ...
 * Applying valgrind-3.7.0-fix-gcc-regex.patch ...
 * Applying valgrind-3.7.0-automake-1.11.2.patch ...
 * Applying valgrind-3.7.0-glibc-2.15.patch ...
 * Running eautoreconf in '/var/tmp/portage/dev-util/valgrind-3.7.0-r3/work/valgrind-3.7.0' ...
 * Running aclocal ...
 * Running autoconf ...
 * Running autoheader ...
 * Running automake --add-missing --copy --foreign ...
 * Fallback PaX marking -m
 *      /var/tmp/portage/dev-util/valgrind-3.7.0-r3/image//usr/lib/valgrind/cachegrind-ppc32-linux
 *      /var/tmp/portage/dev-util/valgrind-3.7.0-r3/image//usr/lib/valgrind/callgrind-ppc32-linux
 *      /var/tmp/portage/dev-util/valgrind-3.7.0-r3/image//usr/lib/valgrind/drd-ppc32-linux
 *      /var/tmp/portage/dev-util/valgrind-3.7.0-r3/image//usr/lib/valgrind/exp-bbv-ppc32-linux
 *      /var/tmp/portage/dev-util/valgrind-3.7.0-r3/image//usr/lib/valgrind/exp-dhat-ppc32-linux
 *      /var/tmp/portage/dev-util/valgrind-3.7.0-r3/image//usr/lib/valgrind/exp-sgcheck-ppc32-linux
 *      /var/tmp/portage/dev-util/valgrind-3.7.0-r3/image//usr/lib/valgrind/helgrind-ppc32-linux
 *      /var/tmp/portage/dev-util/valgrind-3.7.0-r3/image//usr/lib/valgrind/lackey-ppc32-linux
 *      /var/tmp/portage/dev-util/valgrind-3.7.0-r3/image//usr/lib/valgrind/massif-ppc32-linux
 *      /var/tmp/portage/dev-util/valgrind-3.7.0-r3/image//usr/lib/valgrind/memcheck-ppc32-linux
 *      /var/tmp/portage/dev-util/valgrind-3.7.0-r3/image//usr/lib/valgrind/none-ppc32-linux
 * Valgrind will not work if glibc does not have debug symbols.
 * To fix this you can add splitdebug to FEATURES in make.conf
 * and remerge glibc.  See:
 * https://bugs.gentoo.org/show_bug.cgi?id=214065
 * https://bugs.gentoo.org/show_bug.cgi?id=274771
 * https://bugs.gentoo.org/show_bug.cgi?id=388703
 * QA Notice: The following files contain runtime text relocations
 *  Text relocations force the dynamic linker to perform extra
 *  work at startup, waste system resources, and may pose a security
 *  risk.  On some architectures, the code may not even function
 *  properly, if at all.
 *  For more information, see http://hardened.gentoo.org/pic-fix-guide.xml
 *  Please include the following list of files in your report:
 * TEXTREL usr/lib/valgrind/vgpreload_drd-ppc32-linux.so
 * TEXTREL usr/lib/valgrind/vgpreload_helgrind-ppc32-linux.so
 * TEXTREL usr/lib/valgrind/vgpreload_massif-ppc32-linux.so
 * TEXTREL usr/lib/valgrind/vgpreload_exp-sgcheck-ppc32-linux.so
 * TEXTREL usr/lib/valgrind/vgpreload_memcheck-ppc32-linux.so
 * TEXTREL usr/lib/valgrind/vgpreload_exp-dhat-ppc32-linux.so
 * TEXTREL usr/lib/valgrind/vgpreload_core-ppc32-linux.so


Reproducible: Always

Steps to Reproduce:
1. emerge =dev-util/valgrind-3.7.0-r3

Actual Results:  
TEXTREL QA appears.


Expected Results:  
no TEXTREL QA.


a while ago, i got ton of TEXTREL b/c broken binutils (see Bug 392645).
is this a arch-specific/toolchain related bug?

or, just missing "pax-mark m" in src_install() like this?

pax-mark m "${D}"/usr/$(get_libdir)/valgrind/vgpreload_*-*-linux.so

FYI, my emerge --info is,

Portage 2.1.10.46 (default/linux/powerpc/ppc32/10.0, gcc-4.5.3, glibc-2.14.1-r2, 3.2.5-gentoo ppc)
=================================================================
System uname: Linux-3.2.5-gentoo-ppc-7447A,_altivec_supported-with-gentoo-2.1
Timestamp of tree: Wed, 15 Feb 2012 00:45:01 +0000
ccache version 3.1.7 [enabled]
app-shells/bash:          4.2_p20
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/ccache:          3.1.7
dev-util/cmake:           2.8.7-r3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.3
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.2 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r2
Repositories: gentoo x-crossdev hiyuh
ACCEPT_KEYWORDS="ppc ~ppc"
ACCEPT_LICENSE="* -@EULA"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-Os -mcpu=G4 -mtune=G4 -maltivec -mabi=altivec -Wall"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-Os -mcpu=G4 -mtune=G4 -maltivec -mabi=altivec -Wall"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet=n --quiet-build=n"
FEATURES="assume-digests binpkg-logs ccache collision-protect distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="        http://gentoo.channelx.biz/     http://gentoo.gg3.net/  ftp://gg3.net/pub/linux/gentoo/         ftp://ftp.iij.ad.jp/pub/linux/gentoo/   http://ftp.iij.ad.jp/pub/linux/gentoo/  rsync://ftp.iij.ad.jp/pub/linux/gentoo/         http://ftp.jaist.ac.jp/pub/Linux/Gentoo/        rsync://ftp.jaist.ac.jp/pub/Linux/Gentoo/       ftp://ftp.jaist.ac.jp/pub/Linux/Gentoo/ "
LANG="ja_JP.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en ja"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/overlay/crossdev /usr/local/overlay/hiyuh"
SYNC="rsync://rsync.jp.gentoo.org/gentoo-portage"
USE="X acl altivec bash-completion berkdb bzip2 caps cjk cli cracklib crypt cxx dri fontconfig fortran gdbm gif gpm gtk3 iconv icu jbig jpeg jpeg2k lzma modules mudflap ncurses nls nptl nptlonly opengl openmp png ppc readline session ssl svg sysfs t1lib tcpd threads tiff truetype unicode vim-syntax xcb xft xorg zlib" ALSA_CARDS="aoa aoa-fabric-layout aoa-onyx aoa-soundbus aoa-soundbus-i2s aoa-tas aoa-toonie" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LINGUAS="en ja" RUBY_TARGETS="ruby19" USERLAND="GNU" VIDEO_CARDS="fbdev radeon r200"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 hiyuh 2012-02-15 09:25:22 UTC
Created attachment 302019 [details, diff]
*incomplete* patch for TEXTREL fix on ppc32 and ppc64

according to valgrind-3.7.0-non-exec-stack.patch, 

 * coregrind/m_dispatch/dispatch-{ppc32,ppc64}-linux.S
 * coregrind/m_syswrap/syscall-{ppc32,ppc64}-linux.S

should not omit ".section .note.GNU-stack,"",@progbits".

and according to build.log,

 * coregrind/m_cpuid.S
 * coregrind/m_trampoline.S

are also used for {ppc32,ppc64}.
former does omit ".section .note.GNU-stack,"",@progbits",
latter does not.

even if using w/ this patch, TEXTREL QA still appears.
maybe, real fix needs to investigate {ppc32,ppc64}'s inline asm?
Comment 2 hiyuh 2012-02-15 10:35:30 UTC
*sigh*, replacing -Os to -O2 solves this bug w/o attached patch...
maybe my toolchain breaks some programs if w/ -Os.
Comment 3 Anthony Basile gentoo-dev 2012-07-25 15:05:20 UTC
(In reply to comment #2)
> *sigh*, replacing -Os to -O2 solves this bug w/o attached patch...
> maybe my toolchain breaks some programs if w/ -Os.

While I would ideally we would support all CFLAGS, that's not going to happen with valgrind.  Various compiler optimizations definitely break valgrinds delicate logic.