ld crashes when building ZDoom with winelib
Hi all, First excuse me, if this is the wrong place to report this, but AFAIK ld should not crash, no matter what I try to link. So this seems to be a bug of ld to me. I'm trying to build the Windows version of ZDoom 2.1.7 under Linux with Winelib. Of course, I know that ZDoom can be compiled natively under Linux, but I'm aiming to port Skulltag (which is based on ZDoom) to Linux and if ZDoom can't be build with Winelib, Skulltag can't be either. With little modifications I was able to compile ZDoom with winegcc, but during linking ld crashes, with a malloc error. This only happens if I link the dxguid library, but I need to link it, since I get undefined references otherwise. It happens to me under Ubuntu 7.04 and openSUSE 10.2 with the GNU binutils and Wine versions supplied by these distros. Under Ubuntu I also tried Wine 0.9.35 and 0.9.36 and the latest weekly of binutils. In case someone wants to reproduce it, I can supply the source. I get this message during linking: - *** glibc detected *** /usr/bin/ld: malloc(): memory corruption: 0x0b293c00 *** === Backtrace: = /lib/tls/i686/cmov/libc.so.6[0x40136ef3] /lib/tls/i686/cmov/libc.so.6(__libc_malloc+0x7e)[0x4013860e] /lib/tls/i686/cmov/libc.so.6(qsort+0x61)[0x400fb011] /usr/lib/libbfd-2.17.50.so(bfd_elf_final_link+0x2e2a)[0x4007f84a] /usr/bin/ld[0x805f90b] /usr/bin/ld[0x805ef20] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xdc)[0x400e4ebc] /usr/bin/ld[0x804b011] === Memory map: 08048000-080b7000 r-xp 08:01 932679 /usr/bin/ld 080b7000-080b9000 rw-p 0006f000 08:01 932679 /usr/bin/ld 080b9000-0b36b000 rw-p 080b9000 00:00 0 [heap] 4000-40019000 r-xp 08:01 572341 /lib/ld-2.5.so 40019000-4001b000 rw-p 00019000 08:01 572341 /lib/ld-2.5.so 4001b000-40029000 rw-p 4001b000 00:00 0 40029000-400c3000 r-xp 08:01 933679 /usr/lib/libbfd-2.17.50.so 400c3000-400cb000 rw-p 0009a000 08:01 933679 /usr/lib/libbfd-2.17.50.so 400cb000-400cf000 rw-p 400cb000 00:00 0 400cf000-4020a000 r-xp 08:01 575620 /lib/tls/i686/cmov/libc-2.5.so 4020a000-4020b000 r--p 0013b000 08:01 575620 /lib/tls/i686/cmov/libc-2.5.so 4020b000-4020d000 rw-p 0013c000 08:01 575620 /lib/tls/i686/cmov/libc-2.5.so 4020d000-4032e000 rw-p 4020d000 00:00 0 4033a000-40345000 r-xp 08:01 572384 /lib/libgcc_s.so.1 40345000-40346000 rw-p a000 08:01 572384 /lib/libgcc_s.so.1 4034f000-403f8000 rw-p 4034f000 00:00 0 4040-40421000 rw-p 4040 00:00 0 40421000-4050 ---p 40421000 00:00 0 bfeeb000-bff03000 rw-p bfeeb000 00:00 0 [stack] e000-f000 r-xp 00:00 0 [vdso] collect2: ld terminated with signal 6 [Aborted], core dumped - Any suggestions? Thanks, Benjamin ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
Re: ld crashes when building ZDoom with winelib
Hi Nick, >> It happens to me under Ubuntu 7.04 and openSUSE 10.2 with the GNU >> binutils and Wine versions supplied by these distros. > > Can you please tell us which versions these are ? Sure, according to Ubuntu the versions are: wine = 0.9.36~winehq0~ubuntu~7.04.1 (feisty) binutils = 2.17.20070103cvs-0ubuntu2 I also tried wine 0.9.33. > Could you be running out of memory ? If so, then maybe adding the > --reduce-memory-overheads switch to the linker command line might > help. I can't rule out this totally, but the --reduce-memory-overheads switch doesn't help. > It would be more helpful to have a tarball of the object files and > libraries, plus a copy of the linker command line. Here you go: http://files.filefront.com//;7400443;/ This archive contains all the ZDoom object files and a file with the linker command. The fmod library I link is (http://www.fmod.org/files/fmodapi375linux.tar.gz) I didn't include the libraries supplied by Ubuntu. Do you need them too? Best regards, Benjamin ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
building ZDoom with winelib - ld crash fixed but new problem arised
Hi all, Last week I reported a crash of ld when trying to build the Windows version of ZDoom 2.1.7 under Linux with Winelib. Nick Clifton managed to reproduce and fix the crash. Many thanks to him again for this! He reported the following about the cause of the crash: > Anyway the problem itself appears to be that your object files are > using 8-byte relocations, but the linker is expecting them to be using > 12-byte relocations. I am not sure whether this is a linker bug or a > compiler bug, but it seems possible to remove the guesswork from the > linker and make it determine exactly which size of relocs have been > used. With the patch he supplied to me (should be included in the latest binutils snapshot) I can compile and link ZDoom flawlessly, but when I try to run the executable, it stops directly with the following error message: Inconsistency detected by ld.so: ../sysdeps/i386/dl-machine.h: 554: elf_machine_rel_relative: Assertion `((reloc->r_info) & 0xff) == 8' failed! Nick told me the following about this error: > This is almost certainly related to the same problem that I fixed for > the linker. It looks like one or more of the object files that you > are linking in (or the object files extract from one or more of the > libraries) is lying about its type, making the user think that it has > relocations of a different size. > It may well turn out to be a linker problem however. It may be that > the linker should not be creating the executable at all (because of > the dodgy object files mentioned above), so be prepared to come back > to us. At first I thought this could be an Ubuntu specific problem, so I tried openSUSE 10.2. The problem persists there, so it's not Ubuntu specific. Any suggestions what can be done about this? Thanks, Benjamin ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
Re: building ZDoom with winelib - ld crash fixed but new problem arised
Andreas Schwab wrote: The first DT_RELCOUNT entries in .rel.dyn should be R_386_RELATIVE relocations. You can verify that with `readelf -dDr'. Looks like it is, but I'm not familiar with the output of readelf. Therefore, I uploaded the standard output (readelf) and the error output (readelf2) to http://files.filefront.com//;7464792;/ , so you can have a look at it. The archive also contains the script that is required to start the executable, since it's build with Winelib. Best regards, Benjamin ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils