[blfs-dev] Stunnel-5.10 configure: problem with ld from Binutils-2.24

Fernando de Oliveira famobr at yahoo.com.br
Sun Jan 25 13:21:19 PST 2015


On 25-01-2015 14:31, Fernando de Oliveira wrote:
> I am almost ready to close ticket #6058:
> 
> stunnel-5.10
> 
> http://wiki.linuxfromscratch.org/blfs/ticket/6058#comment:2
> 
> There was a problem, now solved, but I need more info, because it may
> not happen in all (B)LFS systems, perhaps only in those with
> Binutils-2.24. LFS-svn is now using Binutils-2.25.
> 
> In the following, I describe with more detail the error, how to test if
> your system has the problem, a patch for Binutils-2.24. I also ask for
> some info in more detail.
> 
> Thanks in advance for the collaboration.
> 
> Configure error:
> 
> {{{
> checking for objdir... .libs
> checking if gcc supports -fno-rtti -fno-exceptions... no
> checking for gcc option to produce PIC... -fPIC -DPIC
> checking if gcc PIC flag -fPIC -DPIC works... yes
> checking if gcc static flag -static works... *** Error in `/usr/bin/ld':
> corrupted double-linked list: 0x08a277a0 ***
> }}}
> 
> This error is well known:
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=16428
> 
> Can be easily reproduced:
> 
> $ cat > conftest.c << "EOF"
> int main() { return 0; }
> EOF
> $ gcc -fPIE -pie -static conftest.c
> *** Error in `/usr/bin/ld': corrupted double-linked list: 0x09ce5488 ***
> 
> Problem is the use of "-pie -static". They seem to be incompatible with
> each other.
> 
> Back to stunnel, found at config.log:
> $ grep pie config.log | grep static
> LDFLAGS=' -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -static'
> 
> After some search, I found the part of configure that performs the
> "static flag" test. We encourage to disable static, so, this test is not
> important for BLFS. I disabled it:
> 
> sed -i '10542,10567s/^/# /' configure
> 
> Problem is gone and installed package works fine!!!
> 
> After some reading, I understand that the problem is not with
> Stunnel-5.10, but with Binutils-2.24.
> 
> There is a patch for Binutils to avoid that error:
> 
> https://sourceware.org/ml/binutils/2014-01/msg00080.html
> 
> Don't know if this is fixed in Binutils-2.25.
> 
> The only required dependency for stunnel is OpenSSL, so, it would be
> appreciated if someone could make the simple test above and also run
> 
> ./configure --prefix=/usr        \
>             --sysconfdir=/etc    \
>             --localstatedir=/var \
>             --disable-systemd
> 
> for Stunnel-5.10.
> 
> For the book, it is necessary to confirm that the problem is really with
> Binutils-2.24. Also, it is important to know if the problem has gone
> with Binutils-2.25. These results will be in the updated page.
> 
> I'm using gcc-4.9.2, i686. Apparently, the problem is architecture
> independent.
> 
> Again, any collaboration is welcome and much appreciated.
> 
> Thanks.
> 

FWIW, some progress.

1. Test completes with a warning, not an error (using clang, instead of
gcc):

$ cat > conftest.c << "EOF"
int main() { return 0; }
EOF
$ clang -fPIE -pie -static conftest.c
clang: warning: argument unused during compilation: '-pie'

2. configure completes without error (using clang, instead of gcc):

CC=clang \
./configure \
                --prefix=/usr \
                --sysconfdir=/etc \
                --localstatedir=/var \
                --with-ssl=/usr \
                --disable-systemd

3. configure.log correctly logs not to build "static libraries" (using
clang, instead of gcc):

$ grep static configure.log
checking if clang static flag -static works... no
checking whether to build static libraries... no

One of the comments I read stated that this was a problem with gcc.

4. Better sed:

sed -i '/LDFLAGS.*static_flag/ s/^/#/' configure

Configure completes, but:

$ grep static ../configure.log
checking if gcc static flag -static works... yes
checking whether to build static libraries... no

It "thinks" that static flag -static works, which seems wrong.

5. Found another discussion of similar problem, fixed at 2015-01-14:

https://bugs.gentoo.org/show_bug.cgi?id=533862

-- 
[]s,
Fernando


More information about the blfs-dev mailing list