Glibc-2.3.3-lfs-5.1 Ch. 6 make check errors - math, dlfcn & elf

Jan Mattila jan.mattila at helsinki.fi
Wed Aug 11 19:11:53 PDT 2004


Hello again.


This is a follow-up on my post: "Glibc-2.3.3 Ch. 6 make check 
errors - math & dlfcn" Sun Aug 8 14:57:49 MDT 2004


I forgot to give any decent specs about my host, so here goes:

My initial build system is based on LFS-3.3, I've only upgraded 
my kernel.

# uname -a
Linux terry 2.4.26 #1 to elo  5 14:17:10 EEST 2004 i586 unknown

# gcc -dumpversion
2.95.3

# gcc -dumpmachine
i586-pc-linux-gnu

# /lib/libc.so.6 
GNU C Library stable release version 2.2.5<snip>

My processor is, as I mentioned before, an AMD-K6 500MHz.

I'll be happy to provide any additional info about my build 
system.


Trying to learn from my mistakes I started from scratch and 
went by the book, but just got more errors (the same 3 math 
tests: math/test-ldouble, math/test-ildoubl and math/test-ifloat, 
dlfcn/default, elf/tst-array[1234] and elf/order). With the 
non-lfs glibc-2.3.3 I didn't get the elf/tst-array2 error.

Then I realised that I'd misbuilt from Ch. 5 Coreutils, since 
the Next link on the page skipped M4, Bison and Flex, and went 
straight from Coreutils to Bzip2. 
http://linuxfromscratch.org/~robert/hlfs/downloads/cvs/hlfs-book-cvs-html-2004-06-07/chapter05/coreutils.html

So I started again and this time went by the Table of Contents page. 
I still, however, got the same errors. I'm not concerned about the 
math tests. My processor is an oldish AMD, and apparently it can't 
count. Besides, the problem is confined to inline functions, so the
damage shouldn't be too big.


The other errors have unnerved me. I googled to find the error in 
dlfcn/default.out and found this:

http://sources.redhat.com/ml/libc-hacker/2000-11/msg00109.html

"This patch adds a testcase whether _dl_argv is setup properly.

2000-11-15  Jakub Jelinek  <jakub at redhat.com>

* dlfcn/default.c (main): Add test for dladdr of main returning
argv[0] in dli_fname field."

(from dlfcn/default.c)

  dladdr(main, &info);
  if (info.dli_fname == NULL)
    {
      printf ("%s: dladdr returns NULL dli_fname\n", __FILE__);
      result = 1;
    }
  else if (strcmp (info.dli_fname, argv[0]))
    {
      printf ("%s: dladdr returned '%s' as dli_fname\n", __FILE__,
info.dli_fname);
      result = 1;
    }
  else
    printf ("%s: dladdr returned correct dli_fname\n", __FILE__);
      

So the error in dlfcn/default.out is the line:

default.c: dladdr returned '' as dli_fname

Which means that the _dl_argv on my machine is not setup correctly. 
I just don't know what to do about it. 

I googled something about this for FreeBSD: the dlfcn.3 functions 
are a dynamic linker interface that "provide an interface to the 
run-time linker ld.so(1). They allow new shared objects to be 
loaded into the process' address space under program control."
http://www.daemon-systems.org/man/dlfcn.3.html

My linker is ld-linux.so.2 but I've had it working properly at 
least for the tests in the book (in Ch. 5 Adjust the toolchain).
I don't even know if I'm looking in the right place...


On to the next errors. I googled for the elf/tst-arrays and found 
that sometime in 2002 the elf/tst-array[123] were a known error 
for x86, and that in 2003 Ulrich Drepper had added the tst-array4
to "Test for fini array handling."

Apparently also the fini array handling on my machine is broken.

I could however find no clue as to what the errors are in the 
tst-array[1234].out files.

Here are the outputs:

# cat builds/glibc-final/elf/tst-array1.out
preinit array 0
preinit array 1
preinit array 2
init
init array 0
init array 1
init array 2
init
init array 0
init array 1
init array 2
fini array 2
fini array 1
fini array 0
fini
fini array 2
fini array 1
fini array 0


# cat builds/glibc-final/elf/tst-array2.out
preinit array 0
preinit array 1
preinit array 2
DSO init
DSO init array 0
DSO init array 1
DSO init array 2
init
init array 0
init array 1
init array 2
init
init array 0
init array 1
init array 2
fini array 2
fini array 1
fini array 0
fini
fini array 2
fini array 1
fini array 0
DSO fini array 2
DSO fini array 1
DSO fini array 0
DSO fini


# cat builds/glibc-final/elf/tst-array3.out
preinit array 0
preinit array 1
preinit array 2
init
init array 0
init array 1
init array 2
init
init array 0
init array 1
init array 2
fini array 2
fini array 1
fini array 0
fini
fini array 2
fini array 1
fini array 0


# cat builds/glibc-final/elf/tst-array4.out
preinit array 0
preinit array 1
preinit array 2
init
init array 0
init array 1
init array 2
init
init array 0
init array 1
init array 2
DSO init
DSO init array 0
DSO init array 1
DSO init array 2
DSO fini array 2
DSO fini array 1
DSO fini array 0
DSO fini
fini array 2
fini array 1
fini array 0
fini
fini array 2
fini array 1
fini array 0


Also the "Main program for constructor/destructor ordering 
test." is not working, since the elf/order.c gives the error:

# cat builds/glibc-final/elf/order.out     
01234456789


I'm sorry about the length of this rather full disclosure
post. I'm hoping that all the tests are somehow related
to my ancient processors inability to count, but I really
wouldn't know.

Again, I'm indebted to all who can shed light on these
mysterious errors. I could for example put in some hours 
in fixing the broken links in the CVS book or at least 
hunting them down or anything.


PaX.
-- 

 Jan Mattila <jan.mattila at helsinki.fi>

 "Finland, Finland, Finland, Finland has it all."
                             - Michael Palin



More information about the hlfs-dev mailing list