https://bugs.kde.org/show_bug.cgi?id=382083

            Bug ID: 382083
           Summary: Failure to detect MUSL consistently.
           Product: valgrind
           Version: 3.13.0
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: i1243...@mvrht.net
  Target Milestone: ---

On some platforms (tested on the following), Valgrind 3.13.0 will fail to
configure/compile/link against the MUSL 1.1.16 library. Other versions have not
been tested, though other versions may also be affected.

MUSL provides a GCC wrapper called 'musl-gcc' which loads a GCC '.conf' file on
top of the system GCC, though these changes are not actually printed when the
'-dumpversion' flag is used. This flag is used to test whether MUSL is being
used; and in this case, the configure script(s) fail to detect MUSL and die
with an error about not having glibc >= 2.2.

A simple workaround is provided below, following the steps to replicate the
issue.

$ uname -a
Linux hostname 3.10.0-514.21.1.el7.x86_64 #1 SMP Thu May 25 17:04:51 UTC 2017
x86_64 x86_64 x86_64 GNU/Linux

$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)

(1) Compile and install MUSL 1.1.16:

    $ wget http://www.musl-libc.org/releases/musl-1.1.16.tar.gz
    $ tar -xf musl-1.1.16.tar.gz
    $ cd musl-1.1.16
    $ ./configure --prefix=$HOME/musl --disable-shared
    $ make -j`nproc` install

(2) Attempt to compile Valgrind 3.13.0:

    $ wget ftp://sourceware.org/pub/valgrind/valgrind-3.13.0.tar.bz2
    $ tar -xjf valgrind-3.13.0.tar.bz2
    $ cd valgrind-3.13.0
    $ CC=$HOME/musl/bin/musl-gcc \
          ./configure --prefix=$HOME/valgrind

(3) Observe that it prints the following, then exits:

configure: error: Valgrind requires glibc version 2.2 or later, uClibc,

(4) To remedy the issue, run:

    $ sed -e 's@-dumpmachine |@-v |\&@' -i configure* # gets .ac too
    $ CC=$HOME/musl/bin/musl-gcc \
          ./configure --prefix=$HOME/valgrind
    $ make -j`nproc` install

(5) Observe that Valgrind is successfully configured, compiled, installed.

Z

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to