2

I am trying to compile my code using the DS-5 compiler. In the linking state, I am getting the linker fail error. I see warnings but not concrete errors like undefined references or the like. Can someone help me out on the same

The log is as below

/usr/local/DS-5/sw/gcc/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/../../../../arm-linux-gnueabihf/bin/ld: warning: /opt/arm-2010.09/lib/gcc/arm-none-eabi/4.5.1/libgcc.a(bpabi.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/local/DS-5/sw/gcc/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/../../../../arm-linux-gnueabihf/bin/ld: warning: /opt/arm-2010.09/lib/gcc/arm-none-eabi/4.5.1/libgcc.a(unwind-arm.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/local/DS-5/sw/gcc/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/../../../../arm-linux-gnueabihf/bin/ld: warning: /opt/arm-2010.09/lib/gcc/arm-none-eabi/4.5.1/libgcc.a(pr-support.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/local/DS-5/sw/gcc/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/../../../../arm-linux-gnueabihf/bin/ld: warning: /opt/arm-2010.09/lib/gcc/arm-none-eabi/4.5.1/libgcc.a(_divdi3.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/local/DS-5/sw/gcc/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/../../../../arm-linux-gnueabihf/bin/ld: warning: /opt/arm-2010.09/lib/gcc/arm-none-eabi/4.5.1/libgcc.a(_udivdi3.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/local/DS-5/sw/gcc/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/../../../../arm-linux-gnueabihf/bin/ld: .ddr_text has both ordered [`.ARM.exidx.atcm_text' in .//hw/obj/target/hw.a] and unordered [`.ARM.extab' in /opt/arm-2010.09/lib/gcc/arm-none-eabi/4.5.1/libgcc.a(_udivdi3.o)] sections
/usr/local/DS-5/sw/gcc/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/../../../../arm-linux-gnueabihf/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [all] Error 1

1 Answers1

0

This problem can happen when you use the gcc compiler switch -fno-short-enums to force all enums to be 32bits. The actual warning message comes from the linker when the linker's target is set for variable sized enums.

If you specify the compiler switch -fshort-enums the warnings will go away because all enums are now consistent. That's the good news. The bad news is... If you truly require the enums to be 32bits, I don't know what option the linker requires to so. This is my problem. I believe it is implied by some other build setting and still looking...

Rod Dewell
  • 840
  • 1
  • 7
  • 18