installing gcc into a target


I’m tryng to install QNX into a target. I need that pc to include gcc. I included it in the buildfile, but it does need more files. I’ve copied all the files gcc “told me” directly from the host to the target. gcc compiles. For a Hello World program:
#gcc -c hello.c
hello.c hello.o

But if I want gcc to create the executable:
#gcc -o hello hello.c
collect2: cannot find ‘ld’

I tried to include ld into the buildfile. Ibuilt the fs, but it didn’t boot (why?? I just added /usr/bin/ld into the builfile).

I created /proc/boot in the target hd and copied ld from the host as an alternative solution . And if I do:

#ld hello.o

It gives me the same error as in the host, so I think ld works. But if I try to compile:

#gcc -o hello hello.c
collect2: cannot find ‘ld’

What can I do?


Grillo Solitario

You are probably hitting the limit of the image size?

As for ld maybe it’s no in the path. Try starting ld gcc with verbose option to get more info.

I use this build file that was provided by cmd a while ago. Greating speec up booting for me, and not the option for devb-eide that help speed up hd at the cost of data safety ;-)

This sets up the kernel and proc.

- x86 based kernel using the bios.boot to set things up.

- Compression is turned on.

- Use startup-bios to finish setting up the machine.

- Start procnto after startup-bios is finished.

[virtual=x86,bios +compress] boot = {
startup-bios -v
PATH=/proc/boot:/bin:/usr/bin:/opt/bin LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib procnto -v

Once procnto is running it will mount the image filesystem and

run this script.

[+script] startup-script = {

procmgr_symlink ../../proc/boot/ /usr/lib/

# Populate the kernel resource database

# Start the system logger
slogger &
waitfor /dev/slog

# Start the PCI server for drivers that need pci.
display_msg "Starting pci-bios server..."
pci-bios &
waitfor /dev/pci

# Start the standard PC console driver and
#  make it the default output (reopen).
display_msg "Starting up console driver..."
devc-con -n6 &
waitfor /dev/con1
reopen /dev/con1

# Pipe provides pipe() services.
display_msg "Starting pipe manager..."
pipe &
waitfor /dev/pipe

# Start eide driver to get drive access.
display_msg "Starting eide driver..."
#devb-eide blk auto=partition dos exec=all cam quiet eide dma eide dma &
devb-eide dos exe=all eide blk commit=low,noatime,auto=partition,cache=64M,alloc=64M,delwri=60 &
display_msg "Waiting HD detection"
waitfor /dev/hd0t79 30

# Mount Filesystems
display_msg "Mounting filesystems..."
#mount -t dos /dev/hd0t12 /fs/hd0-dosdd
#mount -t qnx4 /dev/hd0t77 /fs/hd0-qnx4
#mount -t qnx4 "/fs/hd0-dos/Program Files/qnx/boot/fs/root.qfs" /
#mount -r -t qnx4 "/fs/hd0-dos/Program Files/qnx/boot/fs/qnxbase.qfs" /pkgs/base
mount -t qnx4 /dev/hd0t79 /
mount -t qnx4 /dev/hd0t78 /home

# Start the sysinit script
display_msg "Running /etc/system/sysinit...."
[+session] /bin/ksh -c /etc/system/sysinit

#display_msg "Starting high priority shell on /dev/con2"
#reopen /dev/con2
#[+session pri=30o] fesh

 reopen /dev/con2


These are the standard, required links

[type=link] /dev/console=/dev/con1
[type=link] /usr/lib/

Shared Libraries



unlink_list = {


The problem with the booting was really what you said. I had hit the limit. But I’m afraid that doesn’t solve the main problem :- <<

I’ve included ld, and I’ve linked it into /usr/bin and /x86/usr/bin (the folders where the host fs contains ld), and it doesn’t work. I’ve copied ld from the host in /proc/boot /usr/bin and /x86/usr/bin and I still have the same error.

I used verbose mode in gcc as you told me. I noticed it used some /x86/lib files, so I copied that folder into the target. But the problem hasn’t been solved.

So now, what can I do?

Thanks :- >>

P.S. I still have the problem with TERM in the target:

#vi file.c
unrecognized TERM type

So if anybody can help me, I’d thank him/her/it a lot :- >>

Sorry, I forgot to say I had exactly the same problem with ‘as’, but I solved it just includig /usr/bin/as in the buildfile.

You need to have /usr/lib/terminfo on the target.

BTW, since you want to have so many stuff, they probably won’t fit onto the boot image. It’s probably better to put those additional stuff on the filesystem.

Thank you!!! :- >>> that was the solution to the TERM problem :- >>