This is the mail archive of the
mailing list for the GDB project.
Re: GDB make error: for m68xx toolchain
Michael Snyder wrote:
On Fri, 2008-04-04 at 12:42 +1000, No.Spam wrote:
Michael Snyder wrote:
On Fri, 2008-04-04 at 12:21 +1000, Nathan K wrote:Thanks for your response, yeah I use a dumb email address for lists to
Hi people who have more of an idea about this than me,What's Uni? Oh, university? Heh, you're not at an .edu address...
For Uni we have to compile for the m68hc11. So I've set about setting up
the toolchain so I can work at home as indicated here.
My problem is a make error when compiling GDB
make: *** No rule to make target `-lm', needed by `gdb'. Stop.
make: *** [all-gdb] Error 2
I'm running os x, gcc 3.3.5 (using gcc_select), gdb-6.2 with 68hc patch as
indicated on GCC 68HC11 & 68HC12 Sources Installation
I think this might be referring to the math library, but I'm not sure what
to do about it. perhaps add a config option or edit make file???
Thanks in advance for any pointers,
Yes, the error message refers to the math library.
"-lm" means "link with libm.a" (or libm.so, depending).
But the -lm directive seems to be misplaced somehow,
perhaps from your host/target makefile fragment.
We're at version 6.8, though -- we can't help you too much
with version 6.2...
Could I just go into the Makefile and add the flag? or is it a configure
option? Where would this directive normally be?
I'd be happy to change to 6.8 but since I'm using it for cross compiling
I need to ensure that it will work with the m68hc11.... also this is my
first experience setting up a toolchain, so I'm trying to be
conservative with what I try (since i'm not sure about what might work
and don't want to get in over my head).
If anyone know of a toolchain that works with a newer version of GDB
please let me know.
The version numbers (6.2 and 6.8) are gdb versions, not toolchain.
When people talk about a toolchain version, they're usually referring
to the gcc version number. I don't think that's an issue here.
The issue is that gdb version 6.2 was a long time ago (2004, actually),
and the sources that we work with have changed a lot since then. We
don't generally like to go back in time and help people work with
old versions of the sources -- the general practice is to say "update
to the latest release of gdb, then if you still have problems we'll
So not to go against precedent, but...
I see that in the source version you are using (6.2), there is a
file in the source tree, "gdb/config/m68hc11/m68hc11.mt"
That file is called a "target makefile fragment", and it winds up
as part of your makefile. And it contains a line that looks like this:
SIM= ../sim/m68hc11/libsim.a -lm
There's your "-lm".
That means it is trying to link the math library (-lm == libm.a)
into the simulator library.
But rather than worry about fixing it or even why it's wrong,
I'll just tell you that that file doesn't even exist in the
current source tree, so your problem is likely to go away
(or at least change form) if you go to a more recent gdb version.
From - Sat
Thanks Michael. I had a go at changing the compiler to be "gcc -lm" for
all cases in the Makefile. However that didn't fix the problem. Also a
sample program was compiling fine (using the math library) without -lm
included at compile time.
So I took your advice and compiled version 6.8 with no problems. The
m6811-gcc seems to be producing binary files without error. Now I just
have to wait and try one on the actual embedded device to confirm it is
working correctly. But all seems to be functioning as expected.
Thanks for the great support and well written responses.
p.s. I'll post back only if the binary files aren't compiling properly,
otherwise assume everything is working ok.