Is transistor the only electronic component on a CPU?
The logical blocks and memories can be made out of only transistors. The important question is: are all of the circuits on CPUs logical blocks and memories, or is there anything else?
The answer is, there are always some other circuits. Here are some examples:
- ESD protection circuits often uses diodes and resistors
- Internal bypass capacitors: actually these can be made just from transistor gates, but they are often also made in the metal layers.
- Analog blocks like internal LDO regulators, bandgap references, power-on-reset comparators, etc. are usually best implemented with some resistors among the transistors. It may be possible to get rid of the resistors and use 100% transistors in some of these cases, but it's not necessarily optimal.
- Internal oscillators may use inductor-capacitor (LC) tank circuits (though inductors are so large that they are not cost-effective on modern general purpose CPUs).
- Etc., etc.
I think you have to look at it the other way around: CPUs are made with steps (implantation, lithography, etching, deposition of materials). If you design the steps and layers a certain way you get a CMOS couple (N-type MOSFET on the left, P-type MOSFET on the right), useful for making inverters and then start the whole logic thing, to eventually build all the CPU logic blocks.
But CPUs need other kinds of devices, for ESD or integration of memory or whatever. For that, you can design the layers in another way and get resistors (using the polysilicon layers or the doped substrate), by making a long line thing of material:
This is the crux of what made planar IC technology such a disruptive idea: From simple steps you can build (almost) anything.
The majority of components on a CPU are transistors but other components can be made.
A diode is made from either a PN junction or a metal semiconductor junction with a suitable level of doping in the semiconductor.
A resistor can be made out of a long strip of material (possiblly metal on one of te metal layers, possiblly semiconductor on a semiconductor layer).
A capacitor can be made up of two conductive materials with a thin insulating layer in between (similar to the gate of a mosfet but larger).
The issue with resistors and capacitors is there is no good way to make large values in an IC. Often a resistor or capacitor can end up taking up the same area as many many transistors. It's often cheaper in terms of silicon area to use a special transistor instead of a resistor.