Author Topic: Setup GNU Tools ARM Embedded in Code::Blocks  (Read 1194 times)

Offline Pavel_47

  • Multiple posting newcomer
  • *
  • Posts: 66
Setup GNU Tools ARM Embedded in Code::Blocks
« on: November 29, 2016, 11:30:58 am »
Hello,

After specifying "GNU Tools ARM Embedded in Code" executable in the "Compiler options" can't build simplest project.
The assembler "vectors.S" file is generated, that contain references to undefined functions.
default\src\vectors.o||In function `warm_reset':|
C:\Users\user1\Documents\proj_ARM\proj1\src\vectors.S|219|undefined reference to `IrqInit'|
C:\Users\user1\Documents\proj_ARM\proj1\src\vectors.S|264|undefined reference to `_exit'|


Hoping that unrecognized functions are located in link libraries, I've added 2 references in "Link Libraries":
C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\lib\gcc\arm-none-eabi\5.4.1\libgcc.a
C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\lib\gcc\arm-none-eabi\5.4.1\libgcov.a


Still doesn't work.
Help, please.

Thanks in advance.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5898
    • My Best Post
Re: Setup GNU Tools ARM Embedded in Code::Blocks
« Reply #1 on: November 29, 2016, 03:35:56 pm »
Post a build log!

Because the newbies seem to have trouble adding libraries correctly.

I for one will ignore you till you post a build log.

You need to post the complete and full linking command!

EDIT: Build messages is NOT build log!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Pavel_47

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Setup GNU Tools ARM Embedded in Code::Blocks
« Reply #2 on: November 29, 2016, 03:42:59 pm »
Here it is:

||=== Build: default in proj1 (compiler: GNU GCC Compiler for ARM) ===|
default\src\vectors.o||In function `warm_reset':|
C:\Users\user1\Documents\proj_ARM\proj1\src\vectors.S|219|undefined reference to `IrqInit'|
C:\Users\user1\Documents\proj_ARM\proj1\src\vectors.S|264|undefined reference to `_exit'|
default\src\vectors.o||In function `IRQ':|
C:\Users\user1\Documents\proj_ARM\proj1\src\vectors.S|315|undefined reference to `IrqHandler'|
c:\program files (x86)\gnu tools arm embedded\5.4 2016q3\bin\..\lib\gcc\arm-none-eabi\5.4.1\..\..\..\..\arm-none-eabi\lib\crt0.o||In function `_start':|
(.text+0x104)||undefined reference to `__bss_start__'|
c:\program files (x86)\gnu tools arm embedded\5.4 2016q3\bin\..\lib\gcc\arm-none-eabi\5.4.1\..\..\..\..\arm-none-eabi\lib\crt0.o||In function `_start':|
(.text+0x108)||undefined reference to `__bss_end__'|
c:\program files (x86)\gnu tools arm embedded\5.4 2016q3\bin\..\lib\gcc\arm-none-eabi\5.4.1\..\..\..\..\arm-none-eabi\lib\libc.a(lib_a-exit.o)||In function `exit':|
exit.c:(.text.exit+0x2c)||undefined reference to `_exit'|
||error: ld returned 1 exit status|
||=== Build failed: 7 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5898
    • My Best Post
Re: Setup GNU Tools ARM Embedded in Code::Blocks
« Reply #3 on: November 29, 2016, 03:45:52 pm »
Post the LINKER COMMAND from the build log or I will just ignore you !!!

Decide to do what you want me to do in the past.

Henceworth don't trouble yourself to answer to my questions !!!

Tim S.
« Last Edit: November 29, 2016, 03:53:10 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Pavel_47

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Setup GNU Tools ARM Embedded in Code::Blocks
« Reply #4 on: November 29, 2016, 03:54:11 pm »
arm-none-eabi-g++.exe -L"C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\lib\gcc\arm-none-eabi\5.4.1" -o default\proj1.elf default\src\main.o default\src\vectors.o  -s -Wl,-Map,map.txt -mcpu=arm7tdmi -T ld/target.ld  "C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\lib\gcc\arm-none-eabi\5.4.1\libgcc.a" "C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\lib\gcc\arm-none-eabi\5.4.1\libgcov.a" "C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\lib\gcc\arm-none-eabi\5.4.1\libgcc.a" "C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\lib\gcc\arm-none-eabi\5.4.1\libgcov.a"
default\src\vectors.o: In function `warm_reset':
C:\Users\user1\Documents\proj_ARM\proj1/src/vectors.S:219: undefined reference to `IrqInit'
C:\Users\user1\Documents\proj_ARM\proj1/src/vectors.S:264: undefined reference to `_exit'
default\src\vectors.o: In function `IRQ':
C:\Users\user1\Documents\proj_ARM\proj1/src/vectors.S:315: undefined reference to `IrqHandler'
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/crt0.o: In function `_start':
(.text+0x104): undefined reference to `__bss_start__'
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/crt0.o: In function `_start':
(.text+0x108): undefined reference to `__bss_end__'
c:/program files (x86)/gnu tools arm embedded/5.4 2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
7 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5898
    • My Best Post
Re: Setup GNU Tools ARM Embedded in Code::Blocks
« Reply #5 on: November 29, 2016, 03:59:13 pm »
Possible solution: http://forums.codeblocks.org/index.php?topic=12374.0

You need to find a site that supports your compiler.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org