Immanuel Kant formulated the principle Ought Implies Can. It says that if morality (Ought) applies to a situation, then it must be that free will (Can) also does. It is easier to understand this in reverse; if free will does not apply to a situation, then neither does morality. Philosophers who reject to Ought Implies Can are fall into 2 groups; people with different conceptions of free will than we typically use and moral nihilists. Any statement about morality that not made by one of these people needs to have clause "unless you do not have a choice" appended to the end. Usually this clause is just left unsaid since it gets annoying repeating it again and again. Can you imagine sitting through a 1 hour philosophy lecture where every sentence ended with the same 7 words?
However, I think your question is poorly phrased, in the sense that the topic you are actually curious about when do people act without free will do to outside influences, not the relationship between free will and morality. If I am mistaken, feel free to ignore everything else below. Otherwise, let me tell you a story about a hungry eagle, an unlucky rabbit, and a sadistic baboon.
One day Lion, the king of all animals, goes out for a stroll and comes across Eagle sitting next to Rabbit, who is injured. Rabbit tells Lion that she wishes to call Eagle to court for the crime of assault. Lion agrees and the trial begins. Rabbit's case is that a part of her is now in Eagle’s stomach; a rather convincing argument. However, Eagle argues that actions taken without free will are not punishable by law and claims that Baboon forced him to act without free will. Lion accepts Eagles argument regarding free will, but asks him to describe to actions of Baboon to determine if he acted under coercion.
Situation 1:
Rabbit, Eagle, and Baboon come across one another in a field. Baboon applied mechanical force with his fingers to Eagle’s talons such that they tore Rabbit’s flesh and moved a piece to Eagle’s mouth. Then, Baboon applied mechanical force to Eagle’s jaw and talons so that his jaw opened, the piece of flesh was put in, and his jaw was closed. Baboon massaged Eagle’s throat such that an instinctive reflect caused Eagle to swallow Rabbit’s flesh. Baboon then ran off.
Situation 2:
The same as Situation 1, but Baboon does not massage Eagle’s throat. Instead, he holds his fingers over Eagle’s nose. Eagle, no longer able to breath through his nose, swallows and start breathing through his mouth.
Situation 3:
Rabbit, Eagle, and Baboon come across one another in a field. Baboon grabbed Eagle and said that he would strangle Eagle to death unless he ate part of Rabbit. Eagle used his talons to tear her flesh, puts that flesh in his mouth, and swallowed it.
Situation 4:
The same as Situation 3, but Baboon said he would break Eagle’s wing.
Situation 5:
Same as Situation 3, but Baboon said he would fire Eagle from the only job Eagle could possible have.
According to every philosopher in history, Eagle is not liable in Situation 1. In a very literal, mechanical sense, there was nothing Eagle could have done such that Rabbit’s flesh would not be end up in his stomach.
According to every philosopher in history except maybe Hobbes, Eagle is not liable for assault in Situation 2. If I understand Hobbes correctly, which I very well may not, he believed coercion had no relationship to morality. If Eagle swallowed, the result (not dying) would be something he wanted; if Eagle did not swallow, the result (dying) would be something he did not want. Eagle had 2 paths before him. Even if one path lead to a dead end, it still existed. He choose the path that he desired most, and is therefor responsible.
Situation 3 differs from 1 and 2 in that now Eagle is active, rather than passive. Before, Rabbit had been hurt by the time Eagle could perform an action not mechanically forced. No matter if he swallowed or not, that flesh would not be attached to Rabbit. His choice was between dying and not dying. Now however, Eagle’s actions are the cause of Rabbit’s injuries. If he chose not to act, Rabbit would have not been injured. His choice was between dying and injuring another. Most philosophers would say that Eagle did make a chose to eat Rabbit, but because that chose was made under coercion Eagle is not liable.
The only difference between Situation 4 and Situation 3 is that now Eagle must choose between himself being injured and another being injured. Since being injured is less harmful than dying [citation needed], whether Eagle acted under coercion is debatable. Until now I could make broad claims about the community of philosophers overall, but at this point the devil is in the details. Just about everyone will look at this situation in a slightly different way and you really need to research each one individually to figure out what they would believe.
Situation 5 is really tricky because most philosophers never wrote about situations like this. The simple fact of the matter is that this situation could only happen in very modern society. Someone with valuable skills, sound body, and fit mind being unable to find work is an extremely foreign idea in many economic systems. In feudalism, the concept of firing a worker doesn’t even make sense! The job of many 20th and 21st century philosophers has been to imagine using a time machine to meet these older philosophers and explain situations like this to them to see what they say. As you can imagine, this is a very hard job. Different modern philosophers can reach different conclusions even when they are considering the same primary source.