I am trying to write my own MIDI receive library based on USART rx interrupts.
However, in "wiring_serial.c"
SIGNAL(SIG_USART_RECV)
is already defined.
I could probably get my library running by simply deleting this part of wiring_serial.c, but I would like to keep my code as portable as possible.
Is there a way to override an ISR with out modifying any of the existing libraries?
You would have to hack your installation and/or bootloader. If you've outgrown what you can do with arduino you might take a closer look at what it is doing to create the binary and load it.
There is a build.verbose=true in preferences.txt that will spit out all the gcc/avrdude commands being issued to go from the C++ file arduino created to the board.
This may or may not be an avr-gcc question rather than Arduino..
Do you know by any chance, at which point such routines (as the one I wanted to avoid being included) are ignored?
Is it the whom at build time, does not include such "include files" unless it finds them necessary?
The answer may be in the verbose settings you advised me of earlier, but to be honest, I did not notice any change in the output message after changing those settings.
I'm not sure exactly where in the process the serial isr is optionally included.
My wrestling with predefined ISRs was with the timer0 one, which does not seem like it can be avoided in a portable fashion. I just used another timer.
It sounds like the problem is caused when the sketch is linked with the needed object files. Your sketch defines the isr routine and if it also makes a call to the arduino Serial class, the build process links in the object file for that class that also has a definition for the same isr routine.
the build process links in the object file for that class
If I understand correctly, the Arduino environment can be considered as sort of a wrapper to avr-gcc. I don't think avr-gcc has such functions to automatically include necessary libraries unless specified.
So is it the Arduino environment that includes the necessary libraries as a pre-build process before passing the code on to avr-gcc?
Exactly; the Arduino development environment wraps the AVR GCC tools. Pressing the compile button in the Arduino IDE runs through the build process described here: Redirecting
After compiling, the C/C++ linker brings in only those object files that have been referenced in the project. So if there is no reference to the Serial object, the linker does not link the object file containing the Arduino ISR and there is no conflict.