How to compile a program in C with IAR for msp430x5438A when i get the following error? - c

i am using IAR for msp430xf5438A and when i am trying to compile my program i get an the following error: Internal Error: [TaInstr::Validate]: Instruction does not match requirement. what can i do to solve the this error? thanx!

This is an internal error in the compiler, it is issued when one part of the compiler emits an instruction that it shouldn't have.
If you have the latest version of the compiler, make sure you report this to IAR so that they can fix it. If not, I suggest that you upgrade the compiler.
If you need to continue with the compiler you have, you could try to change the optimization levels or other settings. Alternatively, try to figure out which code triggers the problem and rewrite it.
If you can reduce the problem to a small sample, add it to your question and I'll try to suggest ways to rewrite the code.

Related

"unexpected reloc type 0x03" when loading shared library on ARM system

I am trying to compile a shared library (igraph) on Raspbian that will be used as a "plugin" to another program (to be specific, it will extend Mathematica, but I do not think this is relevant to the question).
This library can be compiled with GLPK for a performance boost in some operations. Without GLPK, everything works fine. But when I include GLPK, and try to load my shared library into the host application, I get the error:
unexpected reloc type 0x03
I am looking for tips that will help me find the cause of this error and eliminate it.
Some googling led me to this thread, which suggests that the problem may be that not everything is compiled with -fPIC. I double-checked that I do indeed compile everything with -fPIC. In the case of GLPK, I achieve this by passing --with-pic to the configure script.
What else may be causing this error?
I am looking for hints that will help me debug this. Debugging is painful on the Raspberry Pi as it takes hours to compile the project.
(Note: On x86_64 Linux I compile the project the same way and there are no issues. Thus I assume this must be at least ARM-specific.)
Note: This was originally posted on RPi.SE but received no attention at all.

Optimisation takes place at which compilation stage

I was looking for some information regarding when the compiler optimisation takes place i.e either at compile time or run time. I searched web and got a rough idea that optimisations mainly occurs at compile time.
But at what compilation stage the optimisation is done by compiler.
Can anyone please explain the above query.
I am asking this question in context of optimising a C language program using a GCC compiler on Linux.
For this query, you need to go through the compilation stages to get better idea about optimization. Here is a simple example as a screenshot from my book.
Translation of assignment statement
From the image You will see that code optimization is done after the intermediate code generation phase.

How can you implement the C language with DrRacket?

Does anyone know how to install the C language or enable it in the DrRacket?
I have installed the C package but I get an error every time I run my program.
The error is:
..\..\Program Files\Racket\collects\racket\system.rkt:181:19:
system*: contract violation
expected: path-string? given: #f
First off: I'm assuming that you're talking about Jay McCarthy's "C" package for Racket. If not, please ignore everything below.
I'm pretty sure that the problem here is that you're running this on Windows. This language level tries to run a C compiler, and Windows is ... not a system that makes it easy to run a C compiler.
I think the right answer here, sadly, is that I wouldn't expect this package to work correctly on Windows. I think the best fix is probably just for the package to signal an error on Windows.
Sorry :(.
Perhaps +jeapostrophe has something to add here?
EDIT: I took a look at the package source, and that's exactly what's going on. I've made a pull request that should at least improve the error message a bit.

Kernel compilation error

I was trying to compile the Linux kernel.
I am getting the following error:-
"No rule to make target arch/x86/kernel/entry_32.o', needed byarch/x86/kernel/built-in.o'."
Before this I configured the kernel(didn't do anything extra except the default options).
configured the kernel using "make gconfig". The config was generated. I am using x86 32 bit machine (Fedora 9) kernel version 2.6.30.
Finally I used :-
"make bzImage"
to compile.
Tried to search the net for a solution but without success.
How to fix these errors??
Kindly help.
Thanks,
Sourabh
You need to call make before make bzImage.
make clean or make mrproper would perhaps help too depending how much you screwed up already.
I agree with the previous answer, you should take a look at how to compile a kernel, the fedora way (here). Not sure this is still up-to-date, but leveraging the provided tools is a good idea sometimes.
Maybe you didn't actually configure the kernel. Did you use any of "make config", "make menuconfig", "make xconfig"?
Are you running an x86 distribution or an x86_64 one? In the latter case, you need the x86 32 bits compilation environment too.
Advice : this is a poorly asked question. You didn't give any relevant information : Linux distribution and architecture, kernel version you want to compile, the commands you tried and the messages you got.

sample rc file for splint

I am using splint for code checking, and it is throwing out a huge number of warnings. Some of them, I guess can be ignored. I am in the process of creating the .splintrc by trial and error.
My question,
Is there some sample .splintrc file that can be used?
I am using splint for C code, written for a multi-tasking embedded system.
This may not be the greatest of help but I think that you need to provide a bit more information about the type of error messages that you are getting and the target processor/compiler that you are using. The different compilers for embedded target processors all have their own syntax to provide their specific functionality (interrupt processing, transferring to supervisor modes and hardware interfacing are examples)
I have tried to use splint on the MSP430 under IAR and gave up because of the number of warnings and errors that it was throwing when it tried to process the compiler supplied hardware interface definition files. I bit the bullet and purchased Gimpel LINT which came with some configuration files that I could modify to support the precise flavour of compiler and processor I was using.
I have never worked with Splint, but have worked with PC-Lint, and this was my experience as well. Without the compiler configuration files, the lint tool will throw a ton of errors.
You will need to find or create compiler-specific configurations files for your compiler informing the linting tool of the special (non-standard) C constructs and macros that it uses which should be ignored by the linting tool, or you will continue to throw tons of errors.
It is worth the effort, however. Linting your code will help you find errors now instead of during testing when they are harder to find and much more expensive to fix.

Resources