Kylix on Fedora 21

160 views Asked by At

we have an application built on Borland Kylix C++. The application is still being used and we maintain a Red Hat 9 virtual machine with the Kylix IDE installed to continue its development. We know it is quite old, but for awhile that´s our choice.

Until Fedora 21, we could run this application without problem, but in this new version our library can´t be loaded, resulting in a segmentation fault error.

That´s the test program to simply load the library:

#include <stdio.h>
#include <dlfcn.h>

void main()
{
  int *p = dlopen("libX.so", RTLD_NOW);
  if (p == NULL)
  {
    printf("Erro = %s\n", dlerror());
  }
}

The libX.so was built in Kylix C++. The error ocurrs when dlopen executes. We don´t need to load a method or execute a method to get the error. Using strace to analyze the error, we get this:

open("i686/sse2/libborunwind.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("i686/libborunwind.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("sse2/libborunwind.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("libborunwind.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\21\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=27125, ...}) = 0
close(3)                                = 0
mprotect(0xb7170000, 4096, PROT_READ)   = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xb85fbad4} ---
+++ killed by SIGSEGV (core dumped) +++

The libborunwind.so is a Kylix runtime library, so we don´t have the source code to see what is going on. It seems the old Kylix libraries are not compatible with the new libraries from Fedora 21 (libc etc).

Is there any way to run old compiled code in a recent Linux distribution?

0

There are 0 answers