[haiku-development] Re: C runtime libs

  • From: Tim Kelly <gtkelly@xxxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 13 Mar 2016 17:03:18 -0400

waddlesplash wrote:

On Mar 13, 2016 4:39 PM, "Tim Kelly" <gtkelly@xxxxxxxxxxxxxxxxx> wrote:
I see that Haiku has crti.o and crtn.o, so I set the compiler to tell ld
to link against them:

Yes, why are you doing that manually?

Because I haven't been able to find crt0.o, which is what the pcc compiler would prefer to tell the ld linker to link to.

ld -o hello_pcc -v -d -dynamic-linker /system/haiku_loader -e __start
crti.o /tmp/ctm.n99jQw -L/boot/system/develop/lib
-L/boot/system/develop/lib/x86
-L/system/non-packaged/lib/pcc/i586-pc-haiku/1.2.0.DEVEL/lib/ -L/usr/lib/
-lbe -lpccsoftfloat -lpcc -lbe crtn.o
GNU ld version 2.17-haiku-2013_04_21
ld: crti.o: No such file: No such file or directory

You probably need to specify an absolute path. Also, .../lib and
.../lib/x86 are 2 different things - the former has GCC2 ABI libs, the
latter has GCC4 ABI libs.

Ok, that is an important distinction.

Haiku's internal build toolchains in general are rather complex due to the
dual ABIs; so unless you really, really, REALLY know what you're doing,
it's a thousand times better to let the linker and compiler decide
everything for you.

This is past the point of using the gcc compiler to build pcc. I'm using the pcc compiler to build executables, in preparation for building pcc with pcc.

tim

--
"Those things that hurt, instruct."

                -- Benjamin Franklin

Other related posts: