GDB make error: for m68xx toolchain


 
Thread Tools Search this Thread
Top Forums Programming GDB make error: for m68xx toolchain
# 1  
Old 04-03-2008
Error GDB make error: for m68xx toolchain

Hi people who have more of an idea about this than me,

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[1]: *** 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???
# 2  
Old 04-05-2008
MySQL Solution

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:
>>>
>>>> Hi people who have more of an idea about this than me,
>>>>
>>>> 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[1]: *** 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,
>>>>
>>>> Nathan
>>>>
>>> What's Uni? Oh, university? Heh, you're not at an .edu address...
>>>
>>> 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...
>>>
>>>
>>>
>>>
>> Thanks for your response, yeah I use a dumb email address for lists to avoid spam.
>>
>> 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
> help you".
>
> 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.
>
> Good luck!
>
>
> 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.

Nathan
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Gdb error while debugging core file

Hi, I am trying to analyze one core file on my RHEL 6.5, but I am getting below error related to the core file. So I am not getting any stack trace about the crash. # gdb MyDebugBin /var/core/MyDebugBin.27005 GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1) Copyright (C) 2010 Free... (2 Replies)
Discussion started by: sanzee007
2 Replies

2. Programming

Can't debug: assert error with gdb (no problem without)

I'm sorry if the title is really criptic, but I don't know how to phrase my problem. I know I can't really ask for a solution, and I normally wouldn't but this is really escaping my abilities. Antefacts. I developed a program using the zeromq messaging library. I got to a point where the... (11 Replies)
Discussion started by: erupter
11 Replies

3. Programming

GDB No line in file error

Hi, I have a c program i compile with gcc4.5. This elf, if I use gdb and put a breakpoint on main, instead has a breakpoint in a function other than main or says no line in file. I verified the elf is 1 to 1 with source, have all debug symbols for compilation etc. The problem I think is the... (2 Replies)
Discussion started by: dragonpoint
2 Replies

4. Red Hat

Building a ppc476 enabled GCC cross compiler and toolchain

Building a ppc476 enabled GCC cross compiler and tool chain Hello, I am trying to build a cross GCC compiler for PPC476. I applied all the relevant patches. Cross compiler build was successful. When i try to compile the source code using the cross compiler i am getting the below error... (0 Replies)
Discussion started by: raghuhb
0 Replies

5. Programming

Make error

Hello, Is someone know why this generate an error : all: dt = $(shell date) echo "$(dt)" (5 Replies)
Discussion started by: X-Or
5 Replies

6. Solaris

Gani Network Driver Won't Install - make: Fatal error: Don't know how to make targ...

I attached a README file that I will refer to. I successfully completed everything in the README file until step 4. # pwd /gani/gani-2.4.4 # ls COPYING Makefile.macros gem.c Makefile Makefile.sparc_gcc gem.h Makefile.amd64_gcc ... (1 Reply)
Discussion started by: Bradj47
1 Replies

7. Programming

Gdb classifies a Bus error as SIGSEGV

Consider the following program. int main(){ struct a_t { int *a; unsigned char b; unsigned char c; unsigned char d; } A; unsigned char e; unsigned char f; unsigned char g; g = 1; A.a = (int *)&g; -> Memory misalignment... (1 Reply)
Discussion started by: balaji280283
1 Replies

8. UNIX for Advanced & Expert Users

How can administrator can make use of GDB?

Hi, I heard lots of about GDB, was going through some documenation but it all in programmers point of view not admin. So my question is how an admin can make use gnu debugger ? - nilesh (3 Replies)
Discussion started by: ynilesh
3 Replies

9. Linux

Error in issuing a make and make install

Hi, Recently I install a package and try to do a make and make install. However, in the make it gives me below error:- make:Nothing to be done for 'install-exec-am' make:Nothing to be done for 'install-data-am' Can anyone please explain to me what does this mean? I have been trying... (1 Reply)
Discussion started by: ahjiefreak
1 Replies

10. Programming

gdb error!

When I run gdb in solaris 8 for sparc, the error occurs like this: “Segmentation Fault(core dumped)” What's the problem? Help! Thanks in advance! (2 Replies)
Discussion started by: new_hand
2 Replies
Login or Register to Ask a Question