Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of glibc_version_header in project not effective #15

Open
hardtwell opened this issue Sep 18, 2018 · 4 comments
Open

Use of glibc_version_header in project not effective #15

hardtwell opened this issue Sep 18, 2018 · 4 comments

Comments

@hardtwell
Copy link

I'm not sure what I need to do, or, what I'm failing to understand ...

  1. Platforms:
    Development
    x86_64
    CentOS Linux 2.6.32-358.el6.x86_64
    gcc 4.4.7
    Target:
    x86_64
    Oracle Linux 2.6.39-400.294.3.el5uek

  2. curl-7.61.0 built on development platform fails to run on target
    platform:
    ./curl: /lib64/libc.so.6: version `GLIBC_2.7' not found (required by ./curl)

  3. Tried simple project with Makefile entries ...

    SHELL = /bin/sh
    CC = gcc -static-libgcc
    CFLAGS = -include /home/geek2/dev/proofs/glibcVerHdr/force_link_glibc_2.6.h
    LDFLAGS = -Wl,-v

    (and with other versions of force_link_glibc_2.*.h), but, the executable
    continues to fail like curl.

@wheybags
Copy link
Owner

Curl probably links to other dependencies which were not compiled with this (eg libssl)

@hardtwell
Copy link
Author

Right, before I rebuild openssl and curl I wanted to successfully build a simple executable with which to confirm correct usage of a glibc_version_header header file. So, I assumed that "...'GLIBC_2.7' not found ..." (due to, say, an sscanf (2.7) versioned symbol) might be resolved by including the force_link_glibc_2.6.h header, but, haven't had success yet; i.e., my test executable won't run on the target platform regardless of the force_link_glibc_x.y.h header I include. So, it seems clear I'm missing something ... maybe a lot.

BTW, the previously cited Makefile builds a simple program ...
int main(int argc, char* argv[]) {
char str[32] = "a b c"; char c1 = ' '; char c2 = ' '; char c3 = ' ';
sscanf(str, "%c %c %c", &c1, &c2, &c3);
printf("main: sscanf: %c %c %c\n", c1, c2, c3);
}

@hardtwell hardtwell reopened this Sep 18, 2018
@hardtwell
Copy link
Author

Didn't mean to close this thread.

@dsnezhkov
Copy link

dsnezhkov commented Feb 13, 2019

Hi,

I am running into the same issue. Freshly built on :
host: Debian 9 testing x86_64

native glibc:
ldd --version

ldd (Debian GLIBC 2.27-6) 2.27
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char **argv) {

    pause();
    return 0;
}

gcc -Wall -static-libgcc -include /root/Code/z/ext/glibc_version_header/version_headers/force_link_glibc_2.17.h /root/Code/z/src/main.c -o /root/Code/z/bin/main

nm main

                 w __cxa_finalize@@GLIBC_2.2.5
                 U __libc_start_main@@GLIBC_2.2.5
                 U pause@@GLIBC_2.2.5

What am I doing wrong? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants