0

I'm trying to run my compiled c progam on different machine doesn't have gcc installed, but i'm getting beloe error:

====> command on my machie:

gcc -m32 -o myprogram myprogram.c

====> error on the remote machine:

$ uname -a Linux 4.15.0-041500-generic i686 i686 i686 GNU/Linux

$ ./myprogram
./myprogram: /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./myprogram)

so i tried to follow this link How can I link to a specific glibc version?

$ locate libc.so.6 /usr/lib/x86_64-linux-gnu/libc.so.6 /usr/lib32/libc.so.6 /usr/share/gdb/auto-load/lib/x86_64-linux-gnu/libc.so.6-gdb.py

$ objdump -T /usr/lib/x86_64-linux-gnu/libc.so.6 | grep -i realpath

0000000000116eb0 g DF .text 0000000000000014 GLIBC_2.4 __realpath_chk

000000000003d4a0 g DF .text 00000000000007ae GLIBC_2.3 realpath

000000000014fbf0 g DF .text 0000000000000021 (GLIBC_2.2.5) realpath

so i added in my code

#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
__asm__(".symver realpath,realpath@GLIBC_2.2.5");

but still face the same error, and objdump still showing the other required glibc

so what i'm missing?

refra
  • 1
  • 1
  • 1

0 Answers0