problem in integrating the slave code in attiny 84
You are trying to compile the wrong program for the wrong chip.

The nice thing about the Arduino core library is that it enables you to
write code that is portable across various Arduino boards. However, this
library provides very limited access to the capabilities of the
underlying hardware. Then, it is quite common for users to mix Arduino
code with C statements that directly access the hardware registers.
Doing this provides full control over the hardware, at the cost of
reduced portability.

Just an example from your code:

SPCR |= bit (SPE);


This line is accessing the control register of the SPI port (SPCR means
“SPI Control Register”) in order to set to 1 the bit named SPE (for “SPI
Enable”). This is the “bare metal” way of turning on the SPI port.

Now, your problem is that, unlike the ATmega328P powering your Unos, the
ATtiny84 does not have a hardware SPI port. Thus the line above just
makes no sense.

The solution: you have to figure out some other means for your chip to
talk SPI. You could emulate it purely in software, but it would
certainly be more efficient to use the USI port. The USI (“Universal
Serial Interface”) is a multipurpose serial port found in many ATtinies.
It can be configured to do SPI, I2C or simplex/half-duplex UART.

Recommended readings:


AVR319: Using the USI module for SPI
communication, an
application note by ATmel
Using an ATtiny2313/4313 as SPI
master on the Arduino
Playground


You may be able to find ready-made libraries for doing this.