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 45223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:46:31+00:00 2026-05-10T15:46:31+00:00

I’m building a project using a GNU tool chain and everything works fine until

  • 0

I’m building a project using a GNU tool chain and everything works fine until I get to linking it, where the linker complains that it is missing/can’t find crti.o. This is not one of my object files, it seems to be related to libc but I can’t understand why it would need this crti.o, wouldn’t it use a library file, e.g. libc.a?

I’m cross compiling for the arm platform. I have the file in the toolchain, but how do I get the linker to include it?

crti.o is on one of the ‘libraries’ search path, but should it look for .o file on the library path?

Is the search path the same for gcc and ld?

  • 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. 2026-05-10T15:46:31+00:00Added an answer on May 10, 2026 at 3:46 pm

    crti.o is the bootstrap library, generally quite small. It’s usually statically linked into your binary. It should be found in /usr/lib.

    If you’re running a binary distribution they tend to put all the developer stuff into -dev packages (e.g. libc6-dev) as it’s not needed to run compiled programs, just to build them.

    You’re not cross-compiling are you?

    If you’re cross-compiling it’s usually a problem with gcc’s search path not matching where your crti.o is. It should have been built when the toolchain was. The first thing to check is gcc -print-search-dirs and see if crti.o is in any of those paths.

    The linking is actually done by ld but it has its paths passed down to it by gcc. Probably the quickest way to find out what’s going on is compile a helloworld.c program and strace it to see what is getting passed to ld and see what’s going on.

    strace -v -o log -f -e trace=open,fork,execve gcc hello.c -o test 

    Open the log file and search for crti.o, as you can see my non-cross compiler:

    10616 execve('/usr/bin/ld', ['/usr/bin/ld', '--eh-frame-hdr', '-m', 'elf_x86_64', '--hash-style=both', '-dynamic-linker', '/lib64/ld-linux-x86-64.so.2', '-o' , 'test', '/usr/lib/gcc/x86_64-linux-gnu/4.'..., '/usr/lib/gcc/x86_64-linux-gnu/4.'..., '/usr/lib/gcc/x86_64-linux-gnu/4.'..., '-L/usr/lib/gcc/x86_64-linux-g nu/'..., '-L/usr/lib/gcc/x86_64-linux-gnu/'..., '-L/usr/lib/gcc/x86_64-linux-gnu/'..., '-L/lib/../lib', '-L/usr/lib/../lib', '-L/usr/lib/gcc/x86_64-linux-gnu /'..., '/tmp/cc4rFJWD.o', '-lgcc', '--as-needed', '-lgcc_s', '--no-as-needed', '-lc', '-lgcc', '--as-needed', '-lgcc_s', '--no-as-needed', '/usr/lib/gcc/x86_ 64-linux-gnu/4.'..., '/usr/lib/gcc/x86_64-linux-gnu/4.'...],  'COLLECT_GCC=gcc', 'COLLECT_GCC_OPTIONS=\'-o\' \'test\' '..., 'COMPILER_PATH=/usr/lib/gcc/x86_6'..., 'LIBRARY_PATH=/usr/lib/gcc/x86_64'..., 'CO LLECT_NO_DEMANGLE=']) = 0 10616 open('/etc/ld.so.cache', O_RDONLY) = 3 10616 open('/usr/lib/libbfd-2.18.0.20080103.so', O_RDONLY) = 3 10616 open('/lib/libc.so.6', O_RDONLY)  = 3 10616 open('test', O_RDWR|O_CREAT|O_TRUNC, 0666) = 3 10616 open('/usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../../lib/crt1.o', O_RDONLY) = 4 10616 open('/usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../../lib/crti.o', O_RDONLY) = 5 10616 open('/usr/lib/gcc/x86_64-linux-gnu/4.2.3/crtbegin.o', O_RDONLY) = 6 10616 open('/tmp/cc4rFJWD.o', O_RDONLY) = 7 

    If you see a bunch of attempts to open(...crti.o) = -1 ENOENT, ld is getting confused and you want to see where the path it’s opening came from…

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

Related Questions

No related questions found

Sidebar

Ask A Question

Stats

  • Questions 58k
  • Answers 58k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer EDIT: As noted in comments, this project doesn't actually have… May 11, 2026 at 8:37 am
  • added an answer Unfortunately there is this problem called the Halting problem... May 11, 2026 at 8:37 am
  • added an answer yum list packagename That will show from which repository the… May 11, 2026 at 8:37 am

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

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.