# GCC version to use for ARM7 demo

**URL:** <https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286>\
**Category:** Kernel\
**Created:** [August 26, 2008, 2:54am UTC](https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286 "2008-08-26T02:54:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 26, 2008, 2:54am UTC](https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286/1 "2008-08-26T02:54:06Z")

</div>

**[jamessteward](https://sourceforge.net/u/jamessteward/)** wrote on [Tuesday, August 26, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/3b61e918/#0911):

Hi,

Just wondering if I should be using a specific version of GCC to build some of the apps?

Executing make in FreeRTOS\_V5.0.3/Demo/lwIP\_Demo\_Rowley\_ARM7 after fixing the compiler tools prefix in the Makefile (and had to rename makefile to Makefile),

P=arm-none-linux-gnueabi-  
CC=$(P)gcc  
OBJCOPY=$(P)objcopy  
ARCH=$(P)ar

$ arm-none-linux-gnueabi-gcc --version  
arm-none-linux-gnueabi-gcc (CodeSourcery Sourcery G++ Lite 2007q1-10) 4.2.0 20070413 (prerelease)

After a few files are processed, I get this…  
arm-none-linux-gnueabi-gcc -I. -I./EMAC -I…/Common/include -I./USB -I./lwip-1.1.0/src/include -I./lwip-1.1.0/contrib/port/FreeRTOS/AT91SAM7X -I…/…/Source/include -I…/…/Source/portable/GCC/ARM7\_AT91SAM7S -I./lwip-1.1.0/src/include/ipv4 -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wno-strict-aliasing -D SAM7\_GCC -D THUMB\_INTERWORK -mthumb-interwork -mcpu=arm7tdmi -Tatmel-rom.ld -g -O0 -fomit-frame-pointer …/…/Source/portable/GCC/ARM7\_AT91SAM7S/portISR.o EMAC/SAM7\_EMAC\_ISR.o USB/USBIsr.o Cstartup\_SAM7.o …/…/Source/portable/MemMang/heap\_2.o ParTest/ParTest.o main.o …/Common/Minimal/flash.o …/Common/Minimal/BlockQ.o …/Common/Minimal/integer.o …/Common/Minimal/PollQ.o …/Common/Minimal/semtest.o BasicWEB.o USB/USB-CDC.o lwip-1.1.0/src/core/tcp\_out.o lwip-1.1.0/src/core/inet.o lwip-1.1.0/src/core/mem.o lwip-1.1.0/src/core/memp.o lwip-1.1.0/src/core/netif.o lwip-1.1.0/src/core/pbuf.o lwip-1.1.0/src/core/raw.o lwip-1.1.0/src/core/stats.o lwip-1.1.0/src/core/sys.o lwip-1.1.0/src/core/tcp.o lwip-1.1.0/src/core/tcp\_in.o lwip-1.1.0/src/core/ipv4/ip.o lwip-1.1.0/src/core/ipv4/ip\_addr.o lwip-1.1.0/src/core/ipv4/icmp.o lwip-1.1.0/src/api/tcpip.o lwip-1.1.0/src/api/api\_msg.o lwip-1.1.0/src/api/err.o lwip-1.1.0/src/api/api\_lib.o lwip-1.1.0/src/netif/etharp.o lwip-1.1.0/contrib/port/FreeRTOS/AT91SAM7X/sys\_arch.o lwip-1.1.0/src/netif/ethernetif.o EMAC/SAM7\_EMAC.o lwip-1.1.0/src/core/udp.o lwip-1.1.0/src/core/ipv4/ip\_frag.o …/…/Source/tasks.o …/…/Source/queue.o …/…/Source/list.o …/…/Source/portable/GCC/ARM7\_AT91SAM7S/port.o -nostartfiles boot.s -Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map  
/opt/codesourcery/arm-2007q1/bin/…/lib/gcc/arm-none-linux-gnueabi/4.2.0/…/…/…/…/arm-none-linux-gnueabi/bin/ld: error: no memory region specified for loadable section `.interp’  
collect2: ld returned 1 exit status  
make: \*\*\* [rtosdemo.elf] Error 1

I don’t think I should have to “frig” with the linker script for a proved demo, so I assume I’ve got a compiler that is too new maybe?

Regards,  
James.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 26, 2008, 5:00am UTC](https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286/2 "2008-08-26T05:00:50Z")

</div>

**[jamessteward](https://sourceforge.net/u/jamessteward/)** wrote on [Tuesday, August 26, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/3b61e918/#0911/cd3e):

Ok, I’ve just got it to compile cleanly with a very old toolchain from [gnuarm.com](http://gnuarm.com).&nbsp; arm-elf-gcc (GCC) 3.4.3.

Does everyone here, building code for ARM, still use this?

JS.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 26, 2008, 6:34am UTC](https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286/3 "2008-08-26T06:34:40Z")

</div>

**[davedoors](https://sourceforge.net/u/davedoors/)** wrote on [Tuesday, August 26, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/3b61e918/#0911/cd3e/35ff):

If you are using Windows as your host then most people seem to use Yagarto now.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 26, 2008, 9:05am UTC](https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286/4 "2008-08-26T09:05:36Z")

</div>

**[jamessteward](https://sourceforge.net/u/jamessteward/)** wrote on [Tuesday, August 26, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/3b61e918/#0911/cd3e/35ff/0833):

I use Linux, specifically Ubuntu 7.10 at the moment.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 26, 2008, 10:09am UTC](https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286/5 "2008-08-26T10:09:25Z")

</div>

**[ben\_fnr](https://sourceforge.net/u/ben_fnr/)** wrote on [Tuesday, August 26, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/3b61e918/#0911/cd3e/35ff/0833/8900):

I have used :-

gcc (CodeSourcery Sourcery G++ Lite 2007q3-53) 4.2.1

for building a luminary demo with no problems.

I also have used gnuarm v 4.1.1. both under Linux (Ubuntu)

It looks to me that something must have changed with the linker, or perhaps gnuarm just ignores the error.

Have only tried the ST & Luminary demos so I can’t comment on the other demos.

Ben

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 26, 2008, 1:46pm UTC](https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286/6 "2008-08-26T13:46:22Z")

</div>

**[david\_farrell](https://sourceforge.net/u/david_farrell/)** wrote on [Tuesday, August 26, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/3b61e918/#0911/924d):

To use you vernacular you "frigged" with the compiler/environment&nbsp; Rowley? Codesourcery? you  
have to frig with the startup files, scripts, portable routines. etc.

I’ using CodeSourcery personal edition, 4.2.3. G++ 4.2-173

The linker script I use is as follows

/\* ----------------------------------------------------------------------------  
\*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ATMEL Microcontroller Software Support&nbsp; -&nbsp; ROUSSET&nbsp; -  
\* ----------------------------------------------------------------------------  
\* Copyright (c) 2006, Atmel Corporation  
\*  
\* All rights reserved.  
\*  
\* Redistribution and use in source and binary forms, with or without  
\* modification, are permitted provided that the following conditions are met:  
\*  
\* - Redistributions of source code must retain the above copyright notice,  
\* this list of conditions and the disclaiimer below.  
\*  
\* - Redistributions in binary form must reproduce the above copyright notice,  
\* this list of conditions and the disclaimer below in the documentation and/or  
\* other materials provided with the distribution.  
\*  
\* Atmel’s name may not be used to endorse or promote products derived from  
\* this software without specific prior written permission.  
\*  
\* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL “AS IS” AND ANY EXPRESS OR  
\* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF  
\* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE  
\* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,  
\* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT  
\* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,  
\* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  
\* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING  
\* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,  
\* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
\* ----------------------------------------------------------------------------  
\*/

/\*------------------------------------------------------------------------------  
\*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Linker script for running in internal Flash on the AT91SAM7X256.  
\*----------------------------------------------------------------------------\*/

OUTPUT\_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")  
OUTPUT\_ARCH(arm)  
ENTRY(start)

MEMORY  
{  
&nbsp;&nbsp;&nbsp; sram (W!RX) : ORIGIN = 0x200000, LENGTH = 0x10000  
&nbsp;&nbsp;&nbsp; flash (RX) : ORIGIN = 0x100000, LENGTH = 0x40000  
}

/\* romvectors by DJF \*/

SECTIONS  
{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp; .fixed :  
&nbsp;&nbsp;&nbsp; {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . = ALIGN(4);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \*(.romvectors)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_sfixed = .;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \*(.text\*)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \*(.rodata\*)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . = ALIGN(4);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_efixed = .;  
&nbsp;&nbsp;&nbsp; } \>flash

&nbsp;&nbsp;&nbsp; .relocate : AT (\_efixed)  
&nbsp;&nbsp;&nbsp; {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . = ALIGN(4);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_srelocate = .;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \*(.ramfunc)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \*(.data)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . = ALIGN(4);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_erelocate = .;  
&nbsp;&nbsp;&nbsp; } \>sram

&nbsp;&nbsp;&nbsp; .bss (NOLOAD) : {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_szero = .;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \*(.bss)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_ezero = .;  
&nbsp;&nbsp;&nbsp; } \>sram  
&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp; \_sstack = 0x210000;  
}  
end = .;

David.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 27, 2008, 12:49am UTC](https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286/7 "2008-08-27T00:49:29Z")

</div>

**[jamessteward](https://sourceforge.net/u/jamessteward/)** wrote on [Wednesday, August 27, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/3b61e918/#0911/924d/d38a):

Well, I was trying to compile some demos for GCC, with GCC, so I did not "frig" with the compiler/env exactly.

I ended up getting a successful build with an old 3.4.3(?) gcc.

So it looks like the maintainers of the particular demos I tried, have not maintained them to work with newer GCCs.&nbsp; That’s fine, I was asking what version of GCC I should use, assuming that the linker script requirements had changed in newer virgins (versions).

Thanks for your sample linker script, I’ll give it a whirl when I get back to the office.

Regards,  
James.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [August 27, 2008, 8:27am UTC](https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286/8 "2008-08-27T08:27:31Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, August 27, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/3b61e918/#0911/924d/d38a/8492):

I just tried building a clean checkout with YAGARTO GCC V4.2.2 and it built with \*no\* errors or warnings.&nbsp; Doing the same with CodeSourcery V4.2.0 (Prerelease) [an older GCC version] I get the error "error: no memory region specified for loadable section `.ARM.extab", so it is not a GCC version problem but a GCC build issue.&nbsp; If you want to use CodeSourcery I should check out the linker scripts they provide to see how to setup the extab section.

I originally used the GNUARM GCC builds for the ARM7 ports and demos and know that people using WinARM GCC builds had similar problems when using the same linker scripts.&nbsp; It seems the different builds were expecting the linker scripts to define different symbols.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 27, 2008, 9:38pm UTC](https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286/9 "2008-08-27T21:38:43Z")

</div>

**[jamessteward](https://sourceforge.net/u/jamessteward/)** wrote on [Wednesday, August 27, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/3b61e918/#0911/924d/d38a/8492/23f3):

Thanks Richard.

I’ll check out Yagarto.&nbsp; I got an error about a different section (.interp) from my CodeSourcery attempt, also 4.2.0 prerelease.&nbsp; So there’s certainly something screwy going on there.

Cheers  
James.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 29, 2008, 5:59pm UTC](https://forums.freertos.org/t/gcc-version-to-use-for-arm7-demo/1286/10 "2008-08-29T17:59:54Z")

</div>

**[david\_farrell](https://sourceforge.net/u/david_farrell/)** wrote on [Friday, August 29, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/3b61e918/#0911/6579):

I posted my linker script but obviously it is all about the combination of the Makefile, linker script and startup code.&nbsp; If you are still having trouble I can post the others.&nbsp; My Makefile is based on Atmels and I really dislike it but it works and I haven’t the ambition to change it yet.&nbsp; The startup file is also mostly Atmels which makes some assumptions about how much of their library you use.&nbsp; One I get more time I plan on considerable cleanup with my use of these and submitting to Richard.&nbsp; My goal is to be compatible with the Atmel boards/components/peripheral layout so various Atmel parts are compatible with the same FreeRTOS project.
