gcc can't find /usr/bin/ld


Forum: DSL-N
Topic: gcc can't find /usr/bin/ld
started by: taiko

Posted by taiko on April 25 2007,00:24
Whenever I attempt to run gcc on some file (gcc was installed via the DSL extension that contains libraries) it gives me an error like the following:

Code Sample
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status


Has anyone else run into this problem and found a solution/workaround?  thanks!

Posted by ^thehatsrule^ on April 25 2007,04:42
Your problem is not a missing /usr/bin/ld, but that that ld cannot find crt1.o

Make sure you have that somewhere in /usr like /usr/lib
Or you could specify the -B flag to gcc.

However, I must warn you that packages from mydsl are specifically made to work only for DSL, and not DSL-N.  Also, a search would've revealed that using the debian packages (i.e. via apt-get) is generally used.

Posted by taiko on April 25 2007,14:56
Quote (^thehatsrule^ @ April 24 2007,21:42)
Your problem is not a missing /usr/bin/ld, but that that ld cannot find crt1.o

Make sure you have that somewhere in /usr like /usr/lib
Or you could specify the -B flag to gcc.

However, I must warn you that packages from mydsl are specifically made to work only for DSL, and not DSL-N.  Also, a search would've revealed that using the debian packages (i.e. via apt-get) is generally used.

I realized after I posted that I was missing part of the error message and so I edited my post and simply forgot to edit the title so that's why it (incorrectly) said missing /usr/bin/ld instead of the real problem.  

As for the suggestion for apt-get I know about that, I've done LOTS of searching on this issue prior to deciding on the gcc route and would prefer to have gcc work because I would like to be able to not only compile existing apps, but create my own (currently not even a "Hello World" app will compile).

Any other suggestions?

Posted by Juanito on April 25 2007,18:08
I've managed to compile in DSL-N by loading a bunch of *.deb files - I can post the details here if that would be useful.
Posted by taiko on April 25 2007,18:30
Quote (Juanito @ April 25 2007,11:08)
I've managed to compile in DSL-N by loading a bunch of *.deb files - I can post the details here if that would be useful.

Please post more info.  I'm definitely interested!
Posted by ^thehatsrule^ on April 25 2007,19:31
Well, quick search: (juanito's thread) < http://damnsmalllinux.org/cgi-bin....t=18021 >

Also, make sure you see the 'old' forums at < http://damnsmalllinux.org/dsl-n/f/ > ... seems to suggest grabbing bin-utils then gcc/gcc-3.4/gcc-2.95

Posted by Juanito on April 26 2007,06:48
Before Hats mentioned it, I'd forgotten that I'd made a post on this.

Since the first post, I've continued to add debs each time I get an error message that something is missing when compiling. By now I would guess that some of the list/symlinks are obsolete but I did not get round to refining this somewhat "brute force" method.

Here's the latest script:
Code Sample
#!/bin/bash
#
# Requires dsl-dpkg.dsl & gnu-utils.dsl [be sure you have the DSL-N versions]
#
dpkg -i /path-to-file/libc6_2.3.2.ds1-22sarge5_i386.deb
dpkg -i /path-to-file/libgcc1_3.4.3-13sarge1_i386.deb
dpkg -i /path-to-file/libdb4.2_4.2.52-18_i386.deb
dpkg -i /path-to-file/libgdbm3_1.8.3-2_i386.deb
dpkg -i /path-to-file/perl-base_5.8.4-8sarge5_i386.deb
dpkg -i --force-all /path-to-file/perl-modules_5.8.4-8sarge5_all.deb
dpkg -i /path-to-file/perl_5.8.4-8sarge5_i386.deb
dpkg -i /path-to-file/m4_1.4.2-1_i386.deb
dpkg -i /path-to-file/make_3.80-9_i386.deb
dpkg -i /path-to-file/patch_2.5.9-2_i386.deb
dpkg -i /path-to-file/autoconf_2.59a-3_all.deb
dpkg -i /path-to-file/autotools-dev_20050422.1_all.deb
#dpkg -i /path-to-file/automake1.7_1.7.9-7_all.deb [some applications require different automake versions]
#dpkg -i /path-to-file/automake1.8_1.8.5-3_all.deb
dpkg -i /path-to-file/automake1.9_1.9.5-1_all.deb
dpkg -i /path-to-file/binutils_2.15-6_i386.deb
dpkg -i /path-to-file/cpp-2.95_2.95.4-22_i386.deb
dpkg -i /path-to-file/gcc-2.95_2.95.4-22_i386.deb
#
dpkg -i /path-to-file/linux-kernel-headers_2.5.999-test7-bk-17_i386.deb
dpkg -i /path-to-file/libc6-dev_2.3.2.ds1-22sarge5_i386.deb
#
ln -s /usr/src/linux-2.6.12 /usr/src/linux
ln -s /usr/bin/gcc-2.95 /usr/bin/cc
ln -s /usr/bin/gcc-2.95 /usr/bin/gcc
ln -s /usr/bin/cpp-2.95 /usr/bin/cpp
ln -s /usr/bin/cpp-2.95 /lib/cpp
dpkg -i /path-to-file/libtool_1.5.6-6_i386.deb
#
dpkg -i /path-to-file/libsysfs1_1.2.0-5_i386.deb
dpkg -i /path-to-file/libsysfs-dev_1.2.0-5_i386.deb
#
#dpkg -i /cdrom/temp/zlib1g_1.2.2-4.sarge.2_i386.deb
#dpkg -i /cdrom/temp/libmagic1_4.12-1_i386.deb
#dpkg -i /cdrom/temp/file_4.12-1_i386.deb
#
dpkg -i /path-to-file/gcc-3.3-base_3.3.5-13_i386.deb
dpkg -i /path-to-file/cpp-3.3_3.3.5-13_i386.deb
dpkg -i /path-to-file/cpp_3.3.5-3_i386.deb
dpkg -i /path-to-file/gcc-3.3_3.3.5-13_i386.deb
dpkg -i /path-to-file/gcc_3.3.5-3_i386.deb
#
dpkg -i /path-to-file/pkg-config_0.17.2-1_i386.deb
dpkg -i /path-to-file/gettext-base_0.14.4-2_i386.deb
dpkg -i /path-to-file/gettext_0.14.4-2_i386.deb
dpkg -i /path-to-file/zlib1g_1.2.2-4.sarge.2_i386.deb
dpkg -i /path-to-file/libxml2_2.6.16-7_i386.deb
dpkg -i /path-to-file/zlib1g-dev_1.2.2-4.sarge.2_i386.deb
dpkg -i /path-to-file/libxml2-dev_2.6.16-7_i386.deb
#
dpkg -i /path-to-file/libncurses5_5.4-4_i386.deb
dpkg -i /path-to-file/libncurses5-dev_5.4-4_i386.deb
#
dpkg -i /path-to-file/libstdc++5_3.3.5-13_i386.deb
dpkg -i --force-all /path-to-file/libstdc++5-3.3-dev_3.3.5-13_i386.deb
dpkg -i /path-to-file/g++-3.3_3.3.5-13_i386.deb
dpkg -i /path-to-file/g++_3.3.5-3_i386.deb
#
# EOF


In case you need the full kernel sources to build modules or recompile a patched kernel, you can run the following script after the first script. Once this is done (and you apply your patch or whatever) you can go directly to "make clean" then "make && make install" or "make modules && make modues_install":
Code Sample
#!/bin/bash
#
rm -f /lib/modules/2.6.12/modules.*
cp /KNOPPIX/lib/modules/2.6.12/modules.* /lib/modules/2.6.12
#
cp /path-to-file/linux-2.6.12.tar.gz /usr/src/
cd /usr/src
tar -xzvf linux-2.6.12.tar.gz -C /usr/src
rm -f linux-2.6.12.tar.gz
#
ln -s /usr/src/linux-2.6.12/include/asm-i386 /usr/src/linux-2.6.12/include/asm
rm -f /lib/modules/2.6.12/build
ln -s /usr/src/linux-2.6.12 /lib/modules/2.6.12/build
rm -f /lib/modules/2.6.12/source
ln -s /usr/src/linux-2.6.12 /lib/modules/2.6.12/source
#
cp /path-to-file/autoconf.h /usr/src/linux-2.6.12/include/linux
cp /path-to-file/version.h /usr/src/linux-2.6.12/include/linux
cp /path-to-file/Module.symvers /usr/src/linux-2.6.12
cp /path-to-file/modpost /usr/src/linux-2.6.12/scripts/mod
#
cp -f /usr/src/linux-2.6.12/.config /usr/src/linux-2.6.12/arch/i386/defconfig
cd /usr/src/linux-2.6.12
make oldconfig
make modules_prepare
#
# EOF

Note that the files autoconf.h, version.h, etc come from the equivalent location on the Knoppix 4.0.2 cd/iso.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.