When building git package on Buildroot gcc throws: ''' [ 98%] Building C object src/CMakeFiles/bellesip.dir/antlr3c/src/antlr3treeparser.c.o /tmp/ccDtjRfo.s: Assembler messages: /tmp/ccDtjRfo.s:210798: Error: branch offset out of range /tmp/ccDtjRfo.s: Fatal error: branch relaxation failed ''' To reproduce it: # git clone git://git.busybox.net/buildroot # wget https://git.busybox.net/buildroot-test/tree/utils/br-reproduce-build - modify BASE_GIT=... with your buildroot path in br-reproduce-build then: # chmod a+x br-reproduce-build # ./br-reproduce-build 71f26fd81db8e9b19b3f18f3f3cefd9c768f094f The only way I've found to build correctly is to turn off optimization overriding CFLAGS with -O0.
I think this is the same as https://sourceware.org/bugzilla/show_bug.cgi?id=27243 .
You’re right, it’s an assembler bug, not gcc. And yes it’s the same. Thank you.
Ah no, wait, that happens with older binutils too, so it doesn't look like the same and most of all it stop to show with gcc 8.x, so it seems that gcc create a particular Assembly that GAS doesn't like or can't handle.
It's not git package but belle-sip package that fails to build. I'm going to add .i and .s file soon.
Disabling parallel build it turns out that the file where it hangs is: src/grammars/belle_sip_messageParser.c So I'm going to add .i and .s attachments for it.
Created attachment 51338 [details] Pre-processed belle_sip_messageParser.c(belle_sip_messageParser.i)
Created attachment 51339 [details] Pre-processed belle_sip_messageParser.c(belle_sip_messageParser.s)
This bug still shows up on gcc 9.3.0
This bug shows up with gcc 11.3.0 and 12.1.0