to be related to having debug enabled). Add some upstream and one non-upstream patches to work around this.