https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101971
--- Comment #11 from Giulio Benetti <giulio.benetti at benettiengineering dot com> --- I think I've found, a -fPIC was in CPPFLAGS while -static too. They can't work together. Indeed removing -fPIC it builds fine. So this is the solution. Please correct if I'm wrong because I'm not that experienced on this topic, but for me it makes sense. What do you think? Thank in advance(again :-)