Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8151263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:19:32+00:00 2026-06-06T15:19:32+00:00

$ printf ‘int main(){}’ | gcc -static -x c – -o hello $ scp

  • 0
$ printf 'int main(){}' | gcc -static -x c - -o hello
$ scp hello vi-server.org:./
hello                                100%  565KB 565.2KB/s   00:00
$ ssh -t vi-server.org "./hello; uname -r"
FATAL: kernel too old
sh: line 1: 15378 Segmentation fault      ./hello
2.6.18-274....  # can't easily upgrade the kernel
Connection to vi-server.org closed.

How to build static binary that will work on on old systems? I expect static binaries to work even on 2.4.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:19:35+00:00Added an answer on June 6, 2026 at 3:19 pm

    You need to configure glibc to target the older kernel version. Per http://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html glibc accepts the configure option --enable-kernel=version where version is in the form 2.4.20 to target older kernel versions.

    You can then link your program statically with gcc -static -nodefaultlibs [...] /path/to/my/libc.a.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

main() { printf(Hello World.); } Why does no warning is produced in gcc compiler
Why the two printf statements are outputting different values? int main() { int n=10;
Possible Duplicate: Why does printf print wrong values? #include<stdio.h> int main(int argc, const char
void myThread(void *arg) { printf(Thread ran!\n); pthread_exit( NULL ); } int main() { int
printf returns 1 instead of Hello World! which is the desired result. I googled
Does printf occupy memory in the stack? printf(Hello world); Does Hello world have a
int m=32 printf(%x , ~m); Output of this statement is ffdf and without ~
void child(int pid){ printf(Child PID:%d\n,pid); exit(0); } void parent(int pid){ printf(Parent PID:%d\n,pid); exit(0); }
I have written a printf() statement like below: printf(hello\n); this works fine when built
Is there a printf-like function in Sql Server? I want the same features as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.