Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mips-gcc: No include path to stdio.h

1,011 views
Skip to first unread message

Takis

unread,
Apr 17, 2009, 3:30:21 AM4/17/09
to
Hello,

I would greatly appreciate if someone could provide a hint on how to make my
mips-gcc work.

After failing to build a gcc cross-compiler myself I downloaded a binary
version from UC Berkeley CS162 site (x86.linux) and made sure all
executables are in the PATH.

However I am missing some link to glibc (all related RPMS are installed).

Please note I have no specific MIPS machine as target. This is for
educational purposes only.

Thanks in advance,
Takis

Mike Sieweke

unread,
Apr 17, 2009, 9:06:15 PM4/17/09
to
Takis <tak...@otenet.gr> wrote:

You haven't given enough info to debug the problem. You need to
show
- the directory where the compiler is installed
- your PATH variable
- the complete command you typed
- the complete error message(s)

It would probably also help to have the output from this command:
mips-gcc -v

--
Mike Sieweke
Duluth, GA

Takis

unread,
Apr 18, 2009, 12:56:32 AM4/18/09
to
Mike Sieweke wrote:

Hello Mike,

Here is the extra debug info:

- the directory where the compiler is installed

/usr/local/src/mips-x86.linux-xgcc, all executables symbolically linked
to /usr/bin

- your PATH variable
$PATH=/home/takis/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11R6:
/usr/X11R6/bin:/usr/games:/usr/lib/jvm/jre/bin:/usr/lib/mit/bin:
//usr/lib/mit/sbin

- the complete command you typed

mips-gcc -S -O2 -fno-delayed-branch lab4_ex4.c -o lab4_ex4.s

- the complete error message(s)

lab4_ex4.c:1:19:no include path in which to find stdio.h
(obviously caused by the directive #include <stdio.h>)

It would probably also help to have the output from this command:
> mips-gcc -v

Using built-in specs.
Configuredwith:./configure --target=mips-dec-ultrix42 --program-prefix=mips-
--with-gnu-as --with-gnu-ld --enable-obsolete
Thread model: single
gcc version 3.2.2

(My version of gcc is 4.2.1 (SUSE Linux))

thank you in advance for your assistance.

Best Regards,
Takis Markopoulos
Athens,

Mike Sieweke

unread,
Apr 18, 2009, 10:35:53 PM4/18/09
to
Takis <tak...@otenet.gr> wrote:

Hello Takis,

Usually the Gnu compiler finds its include path automatically in
the same folder where the compiler was found. That didn't work, so
either the include directory is missing or the compiler couldn't
figure out where it was (maybe because it's accessed via a symbolic
link, or because the directory naming scheme is non-standard). If
the directory isn't missing, you need to point the compiler to it,
like this:

mips-gcc \
-I/usr/local/src/mips-x86.linux-xgcc/mips-x86.linux-xgcc/include \


-S -O2 -fno-delayed-branch lab4_ex4.c -o lab4_ex4.s

This assumes your directory naming scheme matches the one for
my compiler. You need to substitute the real path to the
"include" directory.


I didn't need to do any of the above with my compiler. I built it
myself as "mipsisa32-elf-gcc". Here is how it's installed:

My compiler is in "/install-path/mipsisa32-elf/bin/".

The path variable is "PATH=$PATH:/install-path/mipsisa32-elf/bin".

The include directory is:
/install-path/mipsisa32-elf/mipsisa32-elf/include

I can compile with this command, and the compiler finds the
include path automatically:
mipsisa32-elf-gcc -c -O2 test.c


If this all doesn't get you going, I recommend you install a
different version of GCC. The MIPS company has one called
"SDE-Lite" for free, and it's likely to be better supported
than the one you have. You can get it from here:
http://www.mips.com/products/software-tools/mips-sde-lite/
This one also has some documentation, although it might be
confusing with all the options available.

Mike

Takis

unread,
Apr 19, 2009, 1:53:35 PM4/19/09
to
Mike Sieweke wrote:

Hi Mike,

It worked and thank you for your comments which gave me the right direction
to the solution!

Just for the records the -l switch didn't work. gcc-mips was searching a
number of directories around the "gcc-lib/mips-dec-ultrix42" string with no
success. So I had to create the directory and symlink a good number (>100)
of header files from various include directories in my SUSE distribution.

My patience was rewarded.

Once again thanks,
Takis
Athens, Greece

Mike Sieweke

unread,
Apr 21, 2009, 10:54:49 PM4/21/09
to
Takis <tak...@otenet.gr> wrote:

> Hi Mike,
>
> It worked and thank you for your comments which gave me the right direction
> to the solution!
>
> Just for the records the -l switch didn't work. gcc-mips was searching a
> number of directories around the "gcc-lib/mips-dec-ultrix42" string with no
> success. So I had to create the directory and symlink a good number (>100)
> of header files from various include directories in my SUSE distribution.
>
> My patience was rewarded.
>
> Once again thanks,
> Takis
> Athens, Greece

Hi Takis,

I'm glad everything worked out.

0 new messages