• XSS.stack #1 – первый литературный журнал от юзеров форума

Question about compiling a C program for ESXi

espe0n

HDD-drive
Пользователь
Регистрация
21.08.2024
Сообщения
38
Реакции
11
Гарант сделки
4
Hello xss.pro community,

I have a question about compiling a C program for ESXi.

I'm trying to compile my program, but because ESXi uses a very old kernel and doesn't follow POSIX standards, the code doesn't work very well.

I tried to create a VM with centos7 with the minimum of libs to try to compile but it didn't work anyway.

Код:
# Build (CentOS 7)
[root@localhost main]# gcc -D_BSD_SOURCE -std=c99 main.c
# Run in (ESXi)
[root@localhost:~] ./a.out
/out: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./out)


I also tried compiling statically with `-static` but when I run it I get the following error
Код:
[root@localhost:~] ./out -copy /vmfs
Failed to backup directory: /vmfs : Function not implemented


This error is being caused in this block of code, but I know that the problem is in how I am compiling since I know other programs that do the same thing and it works

C:
DIR *dir = opendir(dirname);
if (dir == NULL)
{
    printf(“Failed to backup directory: %s : %s\n”, dirname, strerror(errno));
    return;
}

I'm testing on an ESXi 7
 
Ты можешь использовать кросс компиляторы для сборки
 
This is because centos 7 has a newer GLIBC version. Please change to a lower centos system version to ensure that the corresponding GLIBC version exists in the centos system.
23nlad.jpg


espe0n, cross-compile against the older glibc
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх