Bug 23451

Summary: RISC-V gas aborts with "Error: unknown default architecture `'" in GCC configure tests
Product: binutils Reporter: Sebastian Huber <sebastian.huber>
Component: gasAssignee: Jim Wilson <wilson>
Status: RESOLVED FIXED    
Severity: normal CC: wilson
Priority: P2    
Version: 2.31   
Target Milestone: ---   
Host: Target: riscv-rtems5
Build: Last reconfirmed: 2018-07-27 00:00:00

Description Sebastian Huber 2018-07-25 10:18:27 UTC
I tried to build a riscv-rtems5 GCC using Binutils 2.31.1 and a recent GCC 9. There are several configure tests in GCC which test gas features. They fail now with a "Error: unknown default architecture `'" error message (about 30 tests), e.g.

configure:24456: checking assembler for thread-local storage support
configure:24469: /build/rtems/5/riscv-rtems5/bin/as   --fatal-warnings -o conftest.o conftest.s >&5
Assembler messages:
Error: unknown default architecture `'
configure:24472: $? = 1
configure: failed program was

	.section .tdata,"awT",@progbits
x:	.word 2
	.text
	la.tls.gd a0,x
        call __tls_get_addr
Comment 1 Andreas Schwab 2018-07-25 10:30:00 UTC
gas/configure.tgt only knows about riscv32 and riscv64.  Another reason why the introduction of a riscv cpu was a mistake.  config.sub really should canonicalize riscv into riscv32.
Comment 2 Sebastian Huber 2018-07-25 11:02:31 UTC
I am not sure at which level this should be fixed now.
Comment 3 Jim Wilson 2018-07-27 21:26:21 UTC
I did a build test, but I see now that it builds but doesn't run.  Annoying, but this is easy to fix.

I regularly test riscv32-* and riscv64-* as these are the officially supported targets, but I'm not interested in testing riscv-*.  Use riscv-* at your own risk.

We got in the current situation because of two main reasons.
1) There is a person (not Sebastian) willing to annoy people until he gets what he wants, and has spent so much time annoying so many people to get riscv-* that at least one key person has given up trying to fight him.
2) Both Sebatian and Ben Ellison were on vacation at the same time right before the last binutils release, limiting my options for late configure related fixes before the release.

I don't like making non-backward compatible changes.  Also, if we remove it, we have to start fighting a certain person again.  I'm willing to do that, but it will be hard now that some people have given up the fight.  So I think we are stuck with riscv-* for now.  I won't be testing it, but I will fix bugs when they are reported against it.
Comment 4 Jim Wilson 2018-07-27 21:50:49 UTC
I took a week of vacation, and forgot how to do binutils work.  Specifically, I forgot to include the bugzilla number in the ChangeLog entry.  The patch is here
    https://sourceware.org/ml/binutils-cvs/2018-07/msg00270.html
it is only on mainline for now.  We probably need to backport.
Comment 5 Sebastian Huber 2018-07-30 05:22:58 UTC
Thanks, for the fix.

The tools did build fine with this error. I only noticed the problem due to some TLS test run-time failures since emutls was picked up by GCC.