Mr. Martinez,
Your friend in your office has fallen into a few common traps. In
general, the Makefile I posted on the third of July answers most of these
questions. To save you having to go back and find it, I'll just give you
the answers to your friends questions.
> > At first I just couldn't find the math symbols pow and cos, but
> > I looked in the mailing list for a solution to the problem.
> > I found it! Somebody said that I should just write this:
> >
> > ld -r -static -o enginemodel.o temp.o -L/usr/lib -lc -lm
Somebody was wrong. There are two errors in this line. First, the
-static generally belongs after the input modules and before the libraries.
Second, you will never succeed in including the standard libc in an RTLinux
program.
So the answer is, use something like this fragment from my Makefile
modified for your friends application:
----- Begin Makefile Fragment -----
LIBPATHS= -L/usr/lib
LIBGCC := $(shell $(CC) -print-libgcc-file-name)
LIBS = -lm
enginemodel.o: temp.o
$(LD) -r -o enginemodel.o temp.o $(LIBPATHS) -static $(LIBS)
$(LIBGCC)
include /usr/include/rtlinux/rtl.mk
----- End Makefile Fragment -----
> > So I did! But that doesn't help!
> > First of all -static is not an option for ld!
On any modern architecture with a recent version of gcc / binutils
-static is most certainly an option for ld.
> > Well.... It helps in the way that cos and pow are not
> unresolved anymore,
This is due to the -lm.
> > but now __isnan stderr and fputs can't be found!
All due to the -lc - lose it as it will never work. OK, I shouldn't
say never, it will not work unless you do a lot of work building an RTL
compatible libc.
> > If I switch the -lc and -lm flags then __udivdi3 and __umoddi3
> > can't be found!
These are provided by the libgcc included in my ld line.
Also, please make sure you are including the rtl.mk file and using
its compiler directives, definition for LD, etc. See the Makefile from my
post on the 3rd of July for more details.
Regards,
Steve Cohen
----- End of forwarded message from [EMAIL PROTECTED] -----
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/