[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compiling and linking problems

> From: mschapira@xxxxxxx.com
> Date: Fri, 27 Apr 2001 11:03:14 -0600

> I am trying to compile and run a small test program that illustrates some
> compiling and linking problems that I am having with the cris 1.11 compiler
> package.

First of all, thank you for providing a clear and repeatable
test-case to illustrate the problems.  I'm sorry to say that
this reply will probably not help with your immediate problems.

I think it should be noted that the problems are misattributed.
Your beef is with the uC-libc library and the compiler wrapper
script in the devboard_lx release, not with cris-dist-1.11.

> 1. There is no prototype for the bsearch function in the  stdio.h found in
> the devboard_lx software. I had to include the stdio.h found in the
> /usr/local/cris/../2.96
> directory to get past a compiler problem

The former not part of cris-dist-1.11, while the latter is.
Note that having
"-I/usr/local/cris/lib/gcc-lib/cris/2.96/include" is wrong; it
will give you the wrong header files: system definitions will be
wrong.  The right path is either
/usr/local/cris/lib/gcc-lib/cris/2.96/elinux/include or
/usr/local/cris/lib/gcc-lib/cris/2.96/linux/include depending on
your devboard platform.

> 2.  I get an undefined for the fopen function when the function is part of
> a c++ class method. fopen works fine if  it is not part of a c++ method.
> Moreover there seems to be no problem for  the fprintf function.

I get no errors when I compile with
 make CC='gcc-cris -mlinux' CXX='g++-cris -mlinux', removing
include Rules.elinux and CFLAGS, therefore I believe what you
see is uC-libc breaking.  I did not investigate further;
i.e. how to fix it.  Note that while the above links , it will
create a binary that will not run on the devboard_lx because the
system call ABI has changed since the cris-dist-1.11 release.

> I also get an undefined for errno when I compile another program.

I need more details, though first thing to check is whether you
actually #include <errno.h>.

> The program should compile and run for the etrax100 platform using cris 1.7

I'm confused.  Do you say it compile and links with
cris-dist-1.7 and "make elinux", but not with cris-dist-1.11 and
"make clinux"?  That a bsearch is found with the former but not
with the latter?

> Please tell me what I am doing wrong?

Nothing else I can help with, unfortunately.  Perhaps someone
can find the right tweaks to get this to work with
cris-dist-1.11 and the current devboard_lx release.

It might give some comfort that eliminating these kind of build
problems, where there are differences between building for an
ordinary GNU/Linux platform and the devboard_lx, are given
highest priority.  Your program compiles and seems to run
cleanly with CC='gcc-cris -mlinux' CXX='g++-cris -mlinux' of an
upcoming cris-dist-1.12.

A note for the future: you should generally link as well as
compile C++-code with g++-cris rather than gcc-cris (here:
$(CXX), not $(CC)) in order to link with the right run-time
libraries.  Though for your example program, linking with $(CC)

brgds, H-P