Skip to contentSkip to conversation

qemu and modern glibc

Qemu-devel Alexander E. Patrakov 1 participant 1 message May 23, 2004

lore
Share & tools
lore
#0 lore raw

The problem is that such a modern distro as Linux From Scratch CVS b6_0 cannot build qemu-fast. I have tracked it down to the following:

1) Modern glibc (a known good CVS snapshot, since there will be no more release tarballs) uses TLS when built with --with-tls --enable-addons=nptl
2) Building two versions of glibc, one with TLS and one without, as Debian and RedHat do, is their custom modification, not supported by glibc developers, and intended only to support old binaries that rely upon old pthreads implementation. LFSers still don't know how to do this, and they don't need this.
3) To build qemu-fast with such a modern glibc, one has to modify the i386-vl.ld ldscript to account for the new .tdata and .tbss sections (supported only by HJL binutils and FSF binutis 2.15 at this moment). Also one has to add -lpthread to the end of $(QEMU_USER) rule in Makefile.target.

The lines to insert after .data1 section into the ldscript are:

.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }

(copied without understanding from the output of gcc -Wl,--verbose trivial_program.c)

After doing all this, I get the qemu-fast binary. But it does not work, just shows the SDL window and then eats 100% of CPU. gdb shows that the program constantly gets SIGSEGV at the same address in code_gen_buffer().

How should I troubleshoot this further?

Signature · 1 line
Alexander E. Patrakov