taviso / wpunix

WordPerfect for UNIX Character Terminals
603 stars 17 forks source link

patchelf fails with "Assertion `splitIndex != -1' failed." on wpdecom #43

Open spaskalev opened 1 year ago

spaskalev commented 1 year ago

I'm trying to build WP on a amd64 glibc void linux system. One of the patchelf invocations fails with the following output

+ patchelf --replace-needed libm.so.5 /home/user/pdev/wpunix/build/lib/libm.so.5 linux/ins/wpdecom
patchelf: patchelf.cc:504: void ElfFile<Elf_Ehdr, Elf_Phdr, Elf_Shdr, Elf_Addr, Elf_Off, Elf_Dyn, Elf_Sym, Elf_Verneed, Elf_Versym>::shiftFile(unsigned int, size_t, size_t) [with Elf_Ehdr = Elf32_Ehdr; Elf_Phdr = Elf32_Phdr; Elf_Shdr = Elf32_Shdr; Elf_Addr = unsigned int; Elf_Off = unsigned int; Elf_Dyn = Elf32_Dyn; Elf_Sym = Elf32_Sym; Elf_Verneed = Elf32_Verneed; Elf_Versym = short unsigned int; size_t = long unsigned int]: Assertion `splitIndex != -1' failed.
build8.sh: line 102:  8883 Aborted                 patchelf --replace-needed "libm.so.5" "${topdir}/build/lib/libm.so.5" linux/ins/wpdecom
make: *** [Makefile:19: wordperfect8_i386] Error 134

Running it with debug outputs

$ patchelf --debug --replace-needed libm.so.5 /home/user/pdev/wpunix/build/lib/libm.so.5 linux/ins/wpdecom
patching ELF file 'linux/ins/wpdecom'
keeping DT_NEEDED entry '/home/user/pdev/wpunix/build/lib/libcompat.so'
replacing DT_NEEDED entry 'libm.so.5' with '/home/user/pdev/wpunix/build/lib/libm.so.5'
resizing .dynstr ...
keeping DT_NEEDED entry 'libc.so.5'
replacing section '.dynstr' with size 432
this is an executable
using replaced section '.dynstr'
last replaced is 4
looking at section '.interp'
replacing section '.interp' which is in the way
looking at section '.hash'
replacing section '.hash' which is in the way
looking at section '.dynsym'
replacing section '.dynsym' which is in the way
looking at section '.dynstr'
first reserved offset/addr is 0x67c/0x804767c
first page is 0x8047000
needed space is 1700
needed space is 1732
needed pages is 1
patchelf: patchelf.cc:504: void ElfFile<Elf_Ehdr, Elf_Phdr, Elf_Shdr, Elf_Addr, Elf_Off, Elf_Dyn, Elf_Sym, Elf_Verneed, Elf_Versym>::shiftFile(unsigned int, size_t, size_t) [with Elf_Ehdr = Elf32_Ehdr; Elf_Phdr = Elf32_Phdr; Elf_Shdr = Elf32_Shdr; Elf_Addr = unsigned int; Elf_Off = unsigned int; Elf_Dyn = Elf32_Dyn; Elf_Sym = Elf32_Sym; Elf_Verneed = Elf32_Verneed; Elf_Versym = short unsigned int; size_t = long unsigned int]: Assertion `splitIndex != -1' failed.
Aborted
abenson commented 1 year ago

This seems to be fixed with patchelf 0.18.0. I run into issues later on, though.

$ ./build/linux/ins/wpdecom 
Floating point exception