This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can not get Codesourcery work

Note: This was originally posted on 21st August 2011 at http://forums.arm.com

Hi everyone,
I am new to this forum as well as new to ARM development.
I have lpc2106 and I have some example projects from cmucam3 and WinARM. I wanted to compile the programs.

So, I installed cygwin and latest version of Codesourcery Lite for windows. I have installed both of them.Then I tried to test my installation by arm-none-eabi-gcc -v and the output is Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=c:/codesourcery/bin/../libexec/gcc/arm-none-eabi/4.5.2/lto-w
rapper.exe
Target: arm-none-eabi
Configured with: /scratch/janisjo/arm-eabi-lite/src/gcc-4.5-2011.03/configure --
build=i686-pc-linux-gnu --host=i686-mingw32 --target=arm-none-eabi --enable-thre
ads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra
-sgxxlite-multilibs --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fve
rbose-asm} -D__CS_SOURCERYGXX_MAJ__=2011 -D__CS_SOURCERYGXX_MIN__=3 -D__CS_SOURC
ERYGXX_REV__=42 %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:
%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enab
le-languages=c,c++ --disable-shared --enable-lto --with-newlib --with-pkgversion
='Sourcery G++ Lite 2011.03-42' --with-bugurl=support.codesourcery.com/G
NUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-headers=yes --with-
sysroot=/opt/codesourcery/arm-none-eabi --with-build-sysroot=/scratch/janisjo/ar
m-eabi-lite/install/host-i686-mingw32/arm-none-eabi --with-libiconv-prefix=/scra
tch/janisjo/arm-eabi-lite/obj/host-libs-2011.03-42-arm-none-eabi-i686-mingw32/us
r --with-gmp=/scratch/janisjo/arm-eabi-lite/obj/host-libs-2011.03-42-arm-none-ea
bi-i686-mingw32/usr --with-mpfr=/scratch/janisjo/arm-eabi-lite/obj/host-libs-201
1.03-42-arm-none-eabi-i686-mingw32/usr --with-mpc=/scratch/janisjo/arm-eabi-lite
/obj/host-libs-2011.03-42-arm-none-eabi-i686-mingw32/usr --with-ppl=/scratch/jan
isjo/arm-eabi-lite/obj/host-libs-2011.03-42-arm-none-eabi-i686-mingw32/usr --wit
h-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-clo
og=/scratch/janisjo/arm-eabi-lite/obj/host-libs-2011.03-42-arm-none-eabi-i686-mi
ngw32/usr --with-libelf=/scratch/janisjo/arm-eabi-lite/obj/host-libs-2011.03-42-
arm-none-eabi-i686-mingw32/usr --disable-libgomp --enable-poison-system-director
ies --with-build-time-tools=/scratch/janisjo/arm-eabi-lite/obj/tools-i686-pc-lin
ux-gnu-2011.03-42-arm-none-eabi-i686-mingw32/arm-none-eabi/bin --with-build-time
-tools=/scratch/janisjo/arm-eabi-lite/obj/tools-i686-pc-linux-gnu-2011.03-42-arm
-none-eabi-i686-mingw32/arm-none-eabi/bin
Thread model: singlegcc version 4.5.2 (Sourcery G++ Lite 2011.03-42)


Then I tried to compile the example downloaded from cmucam.org. I navigated to projects folder and typed make clean. This command was successful. But then I gave command make and it shows as following-
[codemake[1]: Entering directory `/cygdrive/d/arm/CMUcam3 CDROM/cmucam3_install/cc3 (trunk)/hal'
make[2]: Entering directory `/cygdrive/d/arm/CMUcam3 CDROM/cmucam3_install/cc3 (
trunk)/hal/lpc2106-cmucam3'
make -f hal.mk
make[3]: Entering directory `/cygdrive/d/arm/CMUcam3 CDROM/cmucam3_install/cc3 (trunk)/hal/lpc2106-cmucam3'
arm-none-eabi-gcc -c -o rdcf2.o rdcf2.c -I./../../include -O2 -pipe -funit-at-a-
time -Wall -Wstrict-prototypes -Wcast-align -Wcast-qual -Wimplicit -Wmissing-dec
larations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wswitch -Wno-re
dundant-decls -Wreturn-type -Wshadow -Wstrict-prototypes -Wunused -Wextra -Werror-implicit-function-declaration -f
freestanding -std=gnu99 -g -fdata-sections -ffunction-sections -mcpu=arm7tdmi-s -msoft-float -mthumb-interwork
rdcf2.c: In function 'spec_to_name_extension':
rdcf2.c:302:2: warning: pointer targets in return differ in signedness
rdcf2.c: In function 'find_file':
rdcf2.c:504:3: warning: pointer targets in passing argument 3 of 'spec_to_name_extension' differ in signedness
rdcf2.c:286:20: note: expected 'const uint8_t *' but argument is of type 'constchar *'
rdcf2.c: In function 'rdcf_rename':
rdcf2.c:719:2: warning: pointer targets in passing argument 3 of 'spec_to_name_extension' differ in signedness
rdcf2.c:286:20: note: expected 'const uint8_t *' but argument is of type 'constchar *'
rdcf2.c: In function 'rdcf_read':
rdcf2.c:795:49: error: 'EBADFD' undeclared (first use in this function)
rdcf2.c:795:49: note: each undeclared identifier is reported only once for each
function it appears in
rdcf2.c: In function 'real_rdcf_write':
rdcf2.c:848:23: warning: pointer targets in initialization differ in signedness
rdcf2.c:851:50: error: 'EBADFD' undeclared (first use in this function)
rdcf2.c:870:4: warning: pointer targets in passing argument 3 of 'write_sector'differ in signedness
rdcf2.c:147:13: note: expected 'const uint8_t *' but argument is of type 'constchar *'
make[3]: *** [rdcf2.o] Error 1
make[3]: Leaving directory `/cygdrive/d/arm/CMUcam3 CDROM/cmucam3_install/cc3 (trunk)/hal/lpc2106-cmucam3'
make[2]: *** [hal] Error 2
make[2]: Leaving directory `/cygdrive/d/arm/CMUcam3 CDROM/cmucam3_install/cc3 (trunk)/hal/lpc2106-cmucam3'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/cygdrive/d/arm/CMUcam3 CDROM/cmucam3_install/cc3 (trunk)/hal'make: *** [all] Error 2


And I don't understand any of this. Just understand things are going wrong.

Can you please help me. I can't figure anything out. My OS is Windows 7 and it is a 64bit version. If you need anymore information just let me know.

Please help me.

***Sorry for my bad English.
Parents
  • Note: This was originally posted on 23rd August 2011 at http://forums.arm.com

    It looks like you have a couple of problems ...

    Some of the functions you are calling are expecting an argument of "uint8_t *", but you are passing them a "char *", even though both of these are probably byte width they are technically different types in C. By default the GNU compiler now uses strict type aliasing when running in C99 mode, so it will error if you alias two types like you have here. You can disable this using the "-fno-strict-aliasing" compiler option, but it is probably better to fix your code to use the data types the function is expecting.

    Secondly you seem to be missing the declation of "EBADFD"; you probably need to include the correct header to pull in this define.


Reply
  • Note: This was originally posted on 23rd August 2011 at http://forums.arm.com

    It looks like you have a couple of problems ...

    Some of the functions you are calling are expecting an argument of "uint8_t *", but you are passing them a "char *", even though both of these are probably byte width they are technically different types in C. By default the GNU compiler now uses strict type aliasing when running in C99 mode, so it will error if you alias two types like you have here. You can disable this using the "-fno-strict-aliasing" compiler option, but it is probably better to fix your code to use the data types the function is expecting.

    Secondly you seem to be missing the declation of "EBADFD"; you probably need to include the correct header to pull in this define.


Children
No data