The first drawing is superior with regards to stability. Objects topple when the center of gravity moves beyond the area of the base. In your first drawing the base is enlarged, and the center of gravity must travel further in the horizontal plane to cause a fall. (i.e. You need to pull the bookcase further before it will fall forward.) In the second picture the center of gravity is lowered, which also increases stability. It's not quite as good, however, because odds are good you'll create a situation where the center of gravity must move the same distance but moving it requires more force.
You can, by the way, combine them in other ways to make things stable. Wider shelves on the bottom helps but can be two different sized sections fastened together. (Hutches with large bases, mirrors fastened to dressers, etc.) You can also place heavier objects on the bottom shelves to lower the center of gravity. In your specific case a thick hollow shelf hiding ballast (sandbags or weights) would make it significantly more difficult to tip over.
You may also be able to fasten it to something besides the wall. If the floor is carpeted you may be able to run cables from floor to ceiling through the front of the shelves. If the base board is painted to may be able to run a safety cable from there to the top behind the unit.
One thing you should definitely avoid is drawers in the top half, which will move the center of gravity forward when opened. Heavy objects stored up high is also ill advised. That being said, if the design works and you are disciplined enough to not overload shelves you can get some small gains by increasing the distance between shelves on the way up, which will tend to keep the weight lower.