Loading ...
Sorry, an error occurred while loading the content.

Re: New m6812-elf-gcc user, can't use code from GEL libraries (linking breaks)

Expand Messages
  • NZG
    You probably just aren t #including the right .h file. Are you sure serial_print is included in: #include #include ? NZG.
    Message 1 of 6 , Jun 1, 2004
    • 0 Attachment
      You probably just aren't #including the right .h file.
      Are you sure serial_print is included in:
      #include <sys/ports.h>
      #include <sys/sio.h>
      ?

      NZG.


      On Sunday 30 May 2004 04:41 am, hvincentnz wrote:
      > Hi,
      >
      > I am new to the 68hc12, and am trying to use m6812-elf-gcc and GEL to
      > compile code for my university project (a simple MP3 player with the
      > STA013 decoder chip).
      >
      > I have the toolchain itself (from
      > http://savannah.gnu.org/projects/m68hc11/) compiled and installed (I used
      > prefix=hc12-elf- instead of m6812-elf) (my OS is Mac OS X 10.3.4): ->
      > binutils-2.14-m68hc1x
      > -> gdb-5.2.1-m68hc1x
      > -> newlib-1.11.0-m68hc1x
      > -> gcc-3.3.3-m68hc1x
      > and gel-hc1x-1.6 compiled and installed without any problems.
      >
      > My problem is this: the code produced by the compiler is fine (OK, so i
      > haven't tested it on hardware yet, but its disassembly looks fine). All the
      > includes etc work OK. I am linking with libc.a and libbsp.a from the GEL
      > build (they seem to be fine based on a quick look at the output of the
      > disassembler).
      > HOWEVER, none of the functions in these libraries are available in my code.
      > e.g. using serial_print() gives a linker error (NOTE it compiles fine
      > because there is a define for serial_print() in the sys\sio.h, it just
      > can't find it when linking). Here is a typical output:
      >
      > hc12-elf-gcc -m68hc12 -mshort -msoft-reg-count=16 -Wall
      > -Wmissing-prototypes -Os -I. -c firsttest.c -o firsttest.o
      > hc12-elf-gcc -m68hc12 -mshort -Wl,-m,m68hc12elfb -Wl,--relax lib/libc.a
      > lib/libbsp.a firsttest.o -o firsttest.elf
      > firsttest.o: undefined reference to `serial_print'
      > collect2: ld returned 1 exit status
      > make: *** [firsttest.elf] Error 1
      >
      > Has anyone had this problem, or know how to fix it.
      > Regards, Hugo Vincent.
      >
      > Listed below are the relevant files. Sorry this mail is SO long :).
      >
      > My build directory looks like this:
      > ------------------------------------------------------------------------
      > firsttest.c
      > memory.x
      > Makefile
      > lib\libc.a
      > lib\libbsp.a
      > ------------------------------------------------------------------------
      >
      > My memory.x looks like this:
      > ------------------------------------------------------------------------
      > MEMORY
      > {
      > /* Use CME12 ext. RAM Space for code (called MyCode in PRM file.) */
      > .text (rx) : ORIGIN = 0x0800, LENGTH = 0x00FF
      >
      > /* Also use ext. RAM for data (called MyData in PRM file.) */
      > .data (rwx) : ORIGIN = 0x0900, LENGTH = 0x01FF
      > }
      >
      > /* Setup the stack from the top of the internal RAM, growing down. */
      > PROVIDE (_stack = 0x0C00-1);
      >
      > /* Set the IO registers to start at 0x0000. */
      > PROVIDE (_io_ports = 0x0000);
      > ------------------------------------------------------------------------
      >
      > My makefile looks like this:
      > ------------------------------------------------------------------------
      > # Makefile for hc12-elf-gcc.
      > # Hugo Vincent, 29 May 2004, GPL.
      > # Based on analysis of build environment for GEL, and modified
      > # to suit the Axiom CME12B32.
      >
      > #Tools - definitions of toolchain setup.
      > CC=hc12-elf-gcc
      > CFLAGS=-m68hc12 -mshort -msoft-reg-count=16 -Wall -Wmissing-prototypes -Os
      > -I. #old: CFLAGS+=-fomit-frame-pointer
      > LDFLAGS=-m68hc12 -mshort -Wl,-m,m68hc12elfb -Wl,--relax lib/libc.a
      > lib/libbsp.a OBJCOPY=hc12-elf-objcopy
      > OBJCOPYFLAGS=-S --only-section=.text --only-section=.rodata
      > --only-section=.vectors --only-section=.data
      > OBJDUMP=hc12-elf-objdump
      >
      > #Files - what we are trying to build.
      > LDSCRIPT=memory.x
      > #Leave the .c off of SRC
      > SRC=firsttest
      > OBJ=$(SRC).o
      > ELF=$(SRC).elf
      > S19=$(SRC).s19
      >
      > #Rules
      > all :: $(S19)
      >
      > #Objcopy - translate ELF into S19 file.
      > $(S19) : $(ELF)
      > $(OBJCOPY) $(OBJCOPYFLAGS) $(ELF) -O srec $(S19)
      >
      > #Link - combine object files into an ELF.
      > $(ELF) : $(OBJ)
      > $(CC) $(LDFLAGS) $(OBJ) -o $(ELF)
      >
      > #Compile - compile C files into object files.
      > $(OBJ): %.o : %.c
      > $(CC) $(CFLAGS) -c $< -o $@
      >
      > #Delete temporary/generated files
      > clean ::
      > rm -f $(OBJ) $(ELF) $(S19)
      >
      > #Disassemble compiled/linked source file.
      > disassemble :: $(ELF)
      > $(OBJDUMP) -D $(ELF)
      >
      > #Dependencies
      > firsttest.o: firsttest.c
      > ------------------------------------------------------------------------
      >
      > My source code (firsttest.c) looks like this:
      > ------------------------------------------------------------------------
      > #include <sys/ports.h>
      > #include <sys/sio.h>
      >
      > int main(void)
      > {
      > unsigned short i;
      >
      > /* set up data direction reg on Port S. */
      > _io_ports[M6812_DDRS] = 255;
      >
      > serial_init();
      > serial_print("Hello World\n");
      >
      > while (1)
      > {
      > /* Toggle Bit 0 on Port S. */
      > _io_ports[M6812_PORTS] ^= 1;
      >
      > /* Wait for a while. */
      > for (i = 0; i < 255; i++)
      > asm volatile("nop"::);
      > }
      > return 0;
      > }
      > ------------------------------------------------------------------------
      >
      >
      >
      >
      >
      >
      > To Post a message, send it to: gnu-m68hc11@...
      >
      > To Unsubscribe, send a blank message to:
      > gnu-m68hc11-unsubscribe@... Yahoo! Groups Links
      >
      >
      >
    • NZG
      Hmm, you are right, it s in sio.h. I notice your .text section is pretty short in memory.x. Maybe your just running out of room. Although I would think it
      Message 2 of 6 , Jun 3, 2004
      • 0 Attachment
        Hmm, you are right, it's in sio.h.

        I notice your .text section is pretty short in memory.x.
        Maybe your just running out of room.
        Although I would think it would give you an overflow.

        NZG.



        On Wednesday 02 June 2004 09:40 pm, you wrote:
        > Hi NZG,
        >
        > On 2/06/2004, at 2:14 AM, NZG wrote:
        > > You probably just aren't #including the right .h file.
        > > Are you sure serial_print is included in:
        > > #include <sys/ports.h>
        > > #include <sys/sio.h>
        > > ?
        >
        > Whats wrong with this? thats how its done in the "hello world" examples
        > provided with GEL. What should I be including for this?
        >
        > Cheers, Hugo.
        >
        > > NZG.
        > >
        > > On Sunday 30 May 2004 04:41 am, hvincentnz wrote:
        > >> Hi,
        > >>
        > >> I am new to the 68hc12, and am trying to use m6812-elf-gcc and GEL to
        > >> compile code for my university project (a simple MP3 player with the
        > >> STA013 decoder chip).
        > >>
        > >> I have the toolchain itself (from
        > >> http://savannah.gnu.org/projects/m68hc11/) compiled and installed (I
        > >> used
        > >> prefix=hc12-elf- instead of m6812-elf) (my OS is Mac OS X 10.3.4): ->
        > >> binutils-2.14-m68hc1x
        > >> -> gdb-5.2.1-m68hc1x
        > >> -> newlib-1.11.0-m68hc1x
        > >> -> gcc-3.3.3-m68hc1x
        > >> and gel-hc1x-1.6 compiled and installed without any problems.
        > >>
        > >> My problem is this: the code produced by the compiler is fine (OK, so
        > >> i
        > >> haven't tested it on hardware yet, but its disassembly looks fine).
        > >> All the
        > >> includes etc work OK. I am linking with libc.a and libbsp.a from the
        > >> GEL
        > >> build (they seem to be fine based on a quick look at the output of the
        > >> disassembler).
        > >> HOWEVER, none of the functions in these libraries are available in my
        > >> code.
        > >> e.g. using serial_print() gives a linker error (NOTE it compiles fine
        > >> because there is a define for serial_print() in the sys\sio.h, it just
        > >> can't find it when linking). Here is a typical output:
        > >>
        > >> hc12-elf-gcc -m68hc12 -mshort -msoft-reg-count=16 -Wall
        > >> -Wmissing-prototypes -Os -I. -c firsttest.c -o firsttest.o
        > >> hc12-elf-gcc -m68hc12 -mshort -Wl,-m,m68hc12elfb -Wl,--relax
        > >> lib/libc.a
        > >> lib/libbsp.a firsttest.o -o firsttest.elf
        > >> firsttest.o: undefined reference to `serial_print'
        > >> collect2: ld returned 1 exit status
        > >> make: *** [firsttest.elf] Error 1
        > >>
        > >> Has anyone had this problem, or know how to fix it.
        > >> Regards, Hugo Vincent.
        > >>
        > >> Listed below are the relevant files. Sorry this mail is SO long :).
        > >>
        > >> My build directory looks like this:
        > >> ----------------------------------------------------------------------
        > >> --
        > >> firsttest.c
        > >> memory.x
        > >> Makefile
        > >> lib\libc.a
        > >> lib\libbsp.a
        > >> ----------------------------------------------------------------------
        > >> --
        > >>
        > >> My memory.x looks like this:
        > >> ----------------------------------------------------------------------
        > >> --
        > >> MEMORY
        > >> {
        > >> /* Use CME12 ext. RAM Space for code (called MyCode in PRM file.) */
        > >> .text (rx) : ORIGIN = 0x0800, LENGTH = 0x00FF
        > >>
        > >> /* Also use ext. RAM for data (called MyData in PRM file.) */
        > >> .data (rwx) : ORIGIN = 0x0900, LENGTH = 0x01FF
        > >> }
        > >>
        > >> /* Setup the stack from the top of the internal RAM, growing down. */
        > >> PROVIDE (_stack = 0x0C00-1);
        > >>
        > >> /* Set the IO registers to start at 0x0000. */
        > >> PROVIDE (_io_ports = 0x0000);
        > >> ----------------------------------------------------------------------
        > >> --
        > >>
        > >> My makefile looks like this:
        > >> ----------------------------------------------------------------------
        > >> --
        > >> # Makefile for hc12-elf-gcc.
        > >> # Hugo Vincent, 29 May 2004, GPL.
        > >> # Based on analysis of build environment for GEL, and modified
        > >> # to suit the Axiom CME12B32.
        > >>
        > >> #Tools - definitions of toolchain setup.
        > >> CC=hc12-elf-gcc
        > >> CFLAGS=-m68hc12 -mshort -msoft-reg-count=16 -Wall
        > >> -Wmissing-prototypes -Os
        > >> -I. #old: CFLAGS+=-fomit-frame-pointer
        > >> LDFLAGS=-m68hc12 -mshort -Wl,-m,m68hc12elfb -Wl,--relax lib/libc.a
        > >> lib/libbsp.a OBJCOPY=hc12-elf-objcopy
        > >> OBJCOPYFLAGS=-S --only-section=.text --only-section=.rodata
        > >> --only-section=.vectors --only-section=.data
        > >> OBJDUMP=hc12-elf-objdump
        > >>
        > >> #Files - what we are trying to build.
        > >> LDSCRIPT=memory.x
        > >> #Leave the .c off of SRC
        > >> SRC=firsttest
        > >> OBJ=$(SRC).o
        > >> ELF=$(SRC).elf
        > >> S19=$(SRC).s19
        > >>
        > >> #Rules
        > >> all :: $(S19)
        > >>
        > >> #Objcopy - translate ELF into S19 file.
        > >> $(S19) : $(ELF)
        > >> $(OBJCOPY) $(OBJCOPYFLAGS) $(ELF) -O srec $(S19)
        > >>
        > >> #Link - combine object files into an ELF.
        > >> $(ELF) : $(OBJ)
        > >> $(CC) $(LDFLAGS) $(OBJ) -o $(ELF)
        > >>
        > >> #Compile - compile C files into object files.
        > >> $(OBJ): %.o : %.c
        > >> $(CC) $(CFLAGS) -c $< -o $@
        > >>
        > >> #Delete temporary/generated files
        > >> clean ::
        > >> rm -f $(OBJ) $(ELF) $(S19)
        > >>
        > >> #Disassemble compiled/linked source file.
        > >> disassemble :: $(ELF)
        > >> $(OBJDUMP) -D $(ELF)
        > >>
        > >> #Dependencies
        > >> firsttest.o: firsttest.c
        > >> ----------------------------------------------------------------------
        > >> --
        > >>
        > >> My source code (firsttest.c) looks like this:
        > >> ----------------------------------------------------------------------
        > >> --
        > >> #include <sys/ports.h>
        > >> #include <sys/sio.h>
        > >>
        > >> int main(void)
        > >> {
        > >> unsigned short i;
        > >>
        > >> /* set up data direction reg on Port S. */
        > >> _io_ports[M6812_DDRS] = 255;
        > >>
        > >> serial_init();
        > >> serial_print("Hello World\n");
        > >>
        > >> while (1)
        > >> {
        > >> /* Toggle Bit 0 on Port S. */
        > >> _io_ports[M6812_PORTS] ^= 1;
        > >>
        > >> /* Wait for a while. */
        > >> for (i = 0; i < 255; i++)
        > >> asm volatile("nop"::);
        > >> }
        > >> return 0;
        > >> }
        > >> ----------------------------------------------------------------------
        > >> --
        > >>
        > >>
        > >>
        > >>
        > >>
        > >> ------------------------ Yahoo! Groups Sponsor
        > >> --------------------~-->
        > >> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
        > >> Now with Pop-Up Blocker. Get it for free!
        > >> http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/SAfwlB/TM
        > >> --------------------------------------------------------------------
        > >> ~->
        > >>
        > >> To Post a message, send it to: gnu-m68hc11@...
        > >>
        > >> To Unsubscribe, send a blank message to:
        > >> gnu-m68hc11-unsubscribe@... Yahoo! Groups Links
        > >>
        > >>
        > >>
      • Hugo Vincent
        Thanks, It was solved. It was due to the simplest stupidest error on my part. In the linker file, memory.x, I had .text and .data instead of text and
        Message 3 of 6 , Jul 1, 2004
        • 0 Attachment
          Thanks, It was solved. It was due to the simplest stupidest error on my
          part. In the linker file, memory.x, I had ".text" and ".data" instead
          of "text" and "data". The "." was breaking it. But it did take a lot of
          work to find out that was the problem (I called on a local GCC guru to
          sort it out).


          On 2/07/2004, at 3:32 AM, tarang_mittal wrote:

          > I dont know if your problem was solved or not.. I was searching the
          > archives for something else and your message popped up.
          >
          > You have to link with libutil.a as well. That is where the object
          > files for serial input/output etc are located.
          >
          >
          > --- In gnu-m68hc11@yahoogroups.com, "hvincentnz" <hjv15@s...> wrote:
          >> Hi,
          >>
          >> I am new to the 68hc12, and am trying to use m6812-elf-gcc and GEL
          > to compile code for
          >> my university project (a simple MP3 player with the STA013 decoder
          > chip).
          >>
          >> I have the toolchain itself (from
          > http://savannah.gnu.org/projects/m68hc11/) compiled
          >> and installed (I used prefix=hc12-elf- instead of m6812-elf) (my OS
          > is Mac OS X 10.3.4):
          >> -> binutils-2.14-m68hc1x
          >> -> gdb-5.2.1-m68hc1x
          >> -> newlib-1.11.0-m68hc1x
          >> -> gcc-3.3.3-m68hc1x
          >> and gel-hc1x-1.6 compiled and installed without any problems.
          >>
          >> My problem is this: the code produced by the compiler is fine (OK,
          > so i haven't tested it on
          >> hardware yet, but its disassembly looks fine). All the includes etc
          > work OK. I am linking
          >> with libc.a and libbsp.a from the GEL build (they seem to be fine
          > based on a quick look at
          >> the output of the disassembler).
          >> HOWEVER, none of the functions in these libraries are available in
          > my code. e.g. using
          >> serial_print() gives a linker error (NOTE it compiles fine because
          > there is a define for
          >> serial_print() in the sys\sio.h, it just can't find it when
          > linking). Here is a typical output:
          >>
          >> hc12-elf-gcc -m68hc12 -mshort -msoft-reg-count=16 -Wall
          > -Wmissing-prototypes -Os
          >> -I. -c firsttest.c -o firsttest.o
          >> hc12-elf-gcc -m68hc12 -mshort -Wl,-m,m68hc12elfb -Wl,--relax
          > lib/libc.a lib/libbsp.a
          >> firsttest.o -o firsttest.elf
          >> firsttest.o: undefined reference to `serial_print'
          >> collect2: ld returned 1 exit status
          >> make: *** [firsttest.elf] Error 1
          >>
          >> Has anyone had this problem, or know how to fix it.
          >> Regards, Hugo Vincent.
          >>
          >> Listed below are the relevant files. Sorry this mail is SO long :).
          >>
          >> My build directory looks like this:
          >> ----------------------------------------------------------------------
          >> --
          >> firsttest.c
          >> memory.x
          >> Makefile
          >> lib\libc.a
          >> lib\libbsp.a
          >> ----------------------------------------------------------------------
          >> --
          >>
          >> My memory.x looks like this:
          >> ----------------------------------------------------------------------
          >> --
          >> MEMORY
          >> {
          >> /* Use CME12 ext. RAM Space for code (called MyCode in PRM file.) */
          >> .text (rx) : ORIGIN = 0x0800, LENGTH = 0x00FF
          >>
          >> /* Also use ext. RAM for data (called MyData in PRM file.) */
          >> .data (rwx) : ORIGIN = 0x0900, LENGTH = 0x01FF
          >> }
          >>
          >> /* Setup the stack from the top of the internal RAM, growing down. */
          >> PROVIDE (_stack = 0x0C00-1);
          >>
          >> /* Set the IO registers to start at 0x0000. */
          >> PROVIDE (_io_ports = 0x0000);
          >> ----------------------------------------------------------------------
          >> --
          >>
          >> My makefile looks like this:
          >> ----------------------------------------------------------------------
          >> --
          >> # Makefile for hc12-elf-gcc.
          >> # Hugo Vincent, 29 May 2004, GPL.
          >> # Based on analysis of build environment for GEL, and modified
          >> # to suit the Axiom CME12B32.
          >>
          >> #Tools - definitions of toolchain setup.
          >> CC=hc12-elf-gcc
          >> CFLAGS=-m68hc12 -mshort -msoft-reg-count=16 -Wall
          > -Wmissing-prototypes -Os -I.
          >> #old: CFLAGS+=-fomit-frame-pointer
          >> LDFLAGS=-m68hc12 -mshort -Wl,-m,m68hc12elfb -Wl,--relax lib/libc.a
          > lib/libbsp.a
          >> OBJCOPY=hc12-elf-objcopy
          >> OBJCOPYFLAGS=-S --only-section=.text --only-section=.rodata
          > --only-section=.vectors
          >> --only-section=.data
          >> OBJDUMP=hc12-elf-objdump
          >>
          >> #Files - what we are trying to build.
          >> LDSCRIPT=memory.x
          >> #Leave the .c off of SRC
          >> SRC=firsttest
          >> OBJ=$(SRC).o
          >> ELF=$(SRC).elf
          >> S19=$(SRC).s19
          >>
          >> #Rules
          >> all :: $(S19)
          >>
          >> #Objcopy - translate ELF into S19 file.
          >> $(S19) : $(ELF)
          >> $(OBJCOPY) $(OBJCOPYFLAGS) $(ELF) -O srec $(S19)
          >>
          >> #Link - combine object files into an ELF.
          >> $(ELF) : $(OBJ)
          >> $(CC) $(LDFLAGS) $(OBJ) -o $(ELF)
          >>
          >> #Compile - compile C files into object files.
          >> $(OBJ): %.o : %.c
          >> $(CC) $(CFLAGS) -c $< -o $@
          >>
          >> #Delete temporary/generated files
          >> clean ::
          >> rm -f $(OBJ) $(ELF) $(S19)
          >>
          >> #Disassemble compiled/linked source file.
          >> disassemble :: $(ELF)
          >> $(OBJDUMP) -D $(ELF)
          >>
          >> #Dependencies
          >> firsttest.o: firsttest.c
          >> ----------------------------------------------------------------------
          >> --
          >>
          >> My source code (firsttest.c) looks like this:
          >> ----------------------------------------------------------------------
          >> --
          >> #include <sys/ports.h>
          >> #include <sys/sio.h>
          >>
          >> int main(void)
          >> {
          >> unsigned short i;
          >>
          >> /* set up data direction reg on Port S. */
          >> _io_ports[M6812_DDRS] = 255;
          >>
          >> serial_init();
          >> serial_print("Hello World\n");
          >>
          >> while (1)
          >> {
          >> /* Toggle Bit 0 on Port S. */
          >> _io_ports[M6812_PORTS] ^= 1;
          >>
          >> /* Wait for a while. */
          >> for (i = 0; i < 255; i++)
          >> asm volatile("nop"::);
          >> }
          >> return 0;
          >> }
          >> ----------------------------------------------------------------------
          >> --
          >
        • gonzalo briceno
          I have the technologicalarts Adapt9s12e128 board based on the motorola m68hc12. I have succesfully uploaded a file using minicom although it does not work
          Message 4 of 6 , Jul 9, 2004
          • 0 Attachment
            I have the technologicalarts Adapt9s12e128 board based
            on the motorola m68hc12. I have succesfully uploaded
            a file using minicom although it does not work because
            it is the generic hello world example that came with
            gel-hc1x-1.6.
            I would like to get some help compiling this hello
            world example using my boards parameters. Attached is
            the memory.x file that a technologicalarts support
            person gave me.
            I can successfully compile the hello.c file that comes
            with gel using the command 'm6811-elf-gcc -g -Os
            -mshort -Wl,-m,m68hc11elfb -o hello.elf hello.o' and
            using the original memory.x file, an indication that
            gel is installed properly.
            Now, when I replace the original memory.x file with
            the one I received from technologicalarts and run the
            following two commands I get the errors
            -----
            [root@localhost hello]# m6811-elf-gcc -g -Os -mshort
            -Wl,-m,m68hc11elfb -o hello.elf hello.o
            /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/../../../../m6811-elf/bin/ld:hello.elf:
            can not set architecture: No error
            collect2: ld returned 1 exit status
            [root@localhost hello]# m6811-elf-gcc -g -Os -mshort
            -Wl,-m,m68hc12elfb -o hello.elf hello.o
            /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/../../../../m6811-elf/bin/ld:
            skipping incompatible
            /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/mshort/libgcc.a
            when searching for -lgcc
            /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/../../../../m6811-elf/bin/ld:
            skipping incompatible
            /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/libgcc.a
            when searching for -lgcc
            /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/../../../../m6811-elf/bin/ld:
            cannot find -lgcc
            collect2: ld returned 1 exit status
            [root@localhost hello]#
            ---
            If I run other variations of the commands above, I get
            even more errors.
            Can anyone suggest how I may compile this file/solve
            this problem?

            P.S. the SEARCH_DIR directive in memroy.x points to
            /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/mshort
            and this is a valid location.





            __________________________________
            Do you Yahoo!?
            Yahoo! Mail Address AutoComplete - You start. We finish.
            http://promotions.yahoo.com/new_mail
          • Armand ten Doesschate
            Hi, ... Although I don t work with gel I would say that you didnot specify the architecture in the linker/loader file. You can do this like : OUTPUT_ARCH
            Message 5 of 6 , Jul 10, 2004
            • 0 Attachment
              Hi,

              > Now, when I replace the original memory.x file with
              > the one I received from technologicalarts and run the
              > following two commands I get the errors
              > -----
              > [root@localhost hello]# m6811-elf-gcc -g -Os -mshort
              > -Wl,-m,m68hc11elfb -o hello.elf hello.o
              > /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/../../../../m6811-elf/bin/ld:hello.elf:
              > can not set architecture: No error

              Although I don't work with "gel" I would say that you didnot specify the
              architecture in the linker/loader file. You can do this like :

              OUTPUT_ARCH (m68hc12)

              I made cross tools explicitly for both the HC11 and HC(S)12 because I
              noticed that code generation for both targets didnot work out for me
              for some reason with one and the same cross tool with this hc11 patch (20031004).
              Even with the latest patch (2.91 I think) I prefer to make separate
              cross tools, but that mightnot be required anymore (I didnot try
              anyway) YMMV.
              One of the results I got is what you mentioned below :

              > collect2: ld returned 1 exit status
              > [root@localhost hello]# m6811-elf-gcc -g -Os -mshort
              > -Wl,-m,m68hc12elfb -o hello.elf hello.o
              > /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/../../../../m6811-elf/bin/ld:
              > skipping incompatible
              > /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/mshort/libgcc.a
              > when searching for -lgcc
              > /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/../../../../m6811-elf/bin/ld:
              > skipping incompatible
              > /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/libgcc.a
              > when searching for -lgcc
              > /usr/lib/gcc-lib/m6811-elf/3.3.1-m68hc1x-20031004/../../../../m6811-elf/bin/ld:
              > cannot find -lgcc
              > collect2: ld returned 1 exit status
              > [root@localhost hello]#
              > ---

              When having explicitly separate cross tools I didnot get anymore errors in
              code generation.

              Armand


              *******************************************
              * choose GNU/Linux : GNU/Linux is Freedom *
              *******************************************

              ----------------------------------

              Armand ten Doesschate
              Welschapsedijk 141
              5652 XL Eindhoven
              the Netherlands
              tel : (++31) 40 2571 274
              e-mail : a_DOT_doesschate_AT_hccnet_DOT_nl
            Your message has been successfully submitted and would be delivered to recipients shortly.