0

I have an old dynamically linked (.so) library that was last compiled on CentOS 5. Using the old .so file it seems to work fine but if I rebuild on Ubuntu 20 I get an error number of 2 when calling the following line:

    map_addr = mremap((void*)address, oldSize, newSize, MREMAP_MAYMOVE);

Running ldd on the libraries yield that they were both built with the same library and glibc versions

linux-vdso.so.1 (0x00007ffcb0b15000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f09ba1b1000)
/lib64/ld-linux-x86-64.so.2 (0x00007f09ba5b2000)

The only thing I can think of is due to sloppy source control that the built library is not the same as the source but is there any other possible explanation for why the library would start failing when re-compiled?

user439407
  • 1,666
  • 2
  • 19
  • 40
  • Seems that the issue was not setting the _GNU_SOURCE see https://stackoverflow.com/questions/59537934/map-hugetlb-undefined – user439407 May 15 '23 at 12:42

1 Answers1

0

Seems that the issue was not setting the _GNU_SOURCE directive see stackoverflow.com/questions/59537934/map-hugetlb-undefined –

user439407
  • 1,666
  • 2
  • 19
  • 40