Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-10 Thread Jim Wilson
On Mon, Jul 9, 2018 at 10:15 PM, Ben Elliston  wrote:
> OK--I don't terribly mind what is done as long as it is clear and
> uniform.  If you think riscv/riscv-* should be allowed, I am happy to
> put it back.

Yes, please put it back, as riscv-rtems is using it.

Jim

___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-09 Thread Ben Elliston
On Mon, Jul 09, 2018 at 08:41:09AM -0700, Jim Wilson wrote:

> We already merged config.sub patches into binutils and gcc, and added
> riscv-* support to them.  So at this point I think we just have to
> allow riscv-*-* even though we don't want it.  I don't expect to use
> it and I don't expect to maintain it, but some stubborn people will
> never give up on it, so we have to allow it.
> 
> I don't care about Liviu, but there is a riscv-rtems port rolling out.
> We had agreement to expand riscv-rtems to riscv32-rtems at config.sub
> time, but then you modified config.sub to remove the riscv->riscv32
> conversion, so the riscv-rtems port went out as just riscv-rtems and
> we can't drop support for that now.

OK--I don't terribly mind what is done as long as it is clear and
uniform.  If you think riscv/riscv-* should be allowed, I am happy to
put it back.

Ben


signature.asc
Description: PGP signature
___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-09 Thread Jim Wilson
On Mon, Jul 9, 2018 at 4:07 AM, Liviu Ionescu  wrote:
>> On 9 Jul 2018, at 12:20, Ben Elliston  wrote:
>>
>> On Tue, Jul 03, 2018 at 10:41:49AM -0700, Jim Wilson wrote:
>>
>>> Accepting riscv-linux isn't OK.  That will cause complications.
>>> Though I'm not sure if that can be easily avoided if we allow
>>> riscv-elf.

We already merged config.sub patches into binutils and gcc, and added
riscv-* support to them.  So at this point I think we just have to
allow riscv-*-* even though we don't want it.  I don't expect to use
it and I don't expect to maintain it, but some stubborn people will
never give up on it, so we have to allow it.

I don't care about Liviu, but there is a riscv-rtems port rolling out.
We had agreement to expand riscv-rtems to riscv32-rtems at config.sub
time, but then you modified config.sub to remove the riscv->riscv32
conversion, so the riscv-rtems port went out as just riscv-rtems and
we can't drop support for that now.

Jim

___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-09 Thread Liviu Ionescu



> On 9 Jul 2018, at 12:20, Ben Elliston  wrote:
> 
> On Tue, Jul 03, 2018 at 10:41:49AM -0700, Jim Wilson wrote:
> 
>> Accepting riscv-linux isn't OK.  That will cause complications.
>> Though I'm not sure if that can be easily avoided if we allow
>> riscv-elf.
> 
>> There are no plans for any tools to accept riscv- as a CPU, so
>> adding support for this to config.sub isn't very useful.
> 
> In light of this, I have removed riscv- from config.sub because:

This is regrettable.

Jim has no interest in embedded cross toolchains, but this does not mean that 
there are no plans to accept `riscv-`, as proven by my binary distribution.

Jim anyway solved the config.gcc configuration, so the initial concerns were no 
longer a priority.


If you decide to permanently deny `riscv-`, I'll no longer maintain the 
embedded RISC-V toolchain, which, in my opinion, requires it.


Regards,

Liviu


___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-09 Thread Ben Elliston
On Tue, Jul 03, 2018 at 10:41:49AM -0700, Jim Wilson wrote:

> Accepting riscv-linux isn't OK.  That will cause complications.
> Though I'm not sure if that can be easily avoided if we allow
> riscv-elf.

> There are no plans for any tools to accept riscv- as a CPU, so
> adding support for this to config.sub isn't very useful.

In light of this, I have removed riscv- from config.sub because:

> Most GNU tools accept --program-transform-name as a configure
> option, so it is easy to strip off the 32 or 64 in the program name
> at install time if you wish.  That should solve Liviu's problem.

.. I had forgotten about --program-transform-name.  That will indeed
solve the problem _if_ you want your toolchain binaries prefixed with
riscv instead of riscv32/riscv64.

Cheers,
Ben

PS: nice to hear from you, Jim.


signature.asc
Description: PGP signature
___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-03 Thread Jim Wilson
On Tue, Jul 3, 2018 at 10:54 AM, Liviu Ionescu  wrote:
>> I think Liviu's argument has a flaw.  While it is true that both riscv32 and 
>> risvc64 can emit both 32-bit and 64-bit code, they have different defaults.  
>> riscv32 emits 32-bit by default, and riscv64 emits 64-bit by default.  That 
>> is a property we lose if we allow riscv, because it won't be obvious if 
>> 32-bit or 64-bit code is the default.
>
> The defaults you mention apply to the Linux compilers, which are not the 
> topic of this thread.

Ben's latest patch suggestion adds riscv-linux support, which makes
linux concerns relevant to this thread.

> To minimise uncertainty, the embedded cross compilers should not provide such 
> defaults, the `-march` option should be mandatory, preferably the `-mabi` 
> option too.

This would break the embedded cross compilers for most people.  I
don't think it would be wise to do this.  I'm not aware of any other
GNU toolchain that works this way.  There is always a default
architecture and ABI.

Jim

___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-03 Thread Liviu Ionescu



> On 3 Jul 2018, at 20:41, Jim Wilson  wrote:
> 
> I think Liviu's argument has a flaw.  While it is true that both riscv32 and 
> risvc64 can emit both 32-bit and 64-bit code, they have different defaults.  
> riscv32 emits 32-bit by default, and riscv64 emits 64-bit by default.  That 
> is a property we lose if we allow riscv, because it won't be obvious if 
> 32-bit or 64-bit code is the default.

The defaults you mention apply to the Linux compilers, which are not the topic 
of this thread.

To minimise uncertainty, the embedded cross compilers should not provide such 
defaults, the `-march` option should be mandatory, preferably the `-mabi` 
option too. 

It would be good if the RISC-V compiler would implement this.


Regards,

Liviu


___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-03 Thread Jim Wilson

On 07/03/2018 03:29 AM, Ben Elliston wrote:

+riscv-linuxriscv-unknown-linux-gnu


Accepting riscv-linux isn't OK.  That will cause complications.  Though 
I'm not sure if that can be easily avoided if we allow riscv-elf.


There are no plans for any tools to accept riscv- as a CPU, so adding 
support for this to config.sub isn't very useful.


Personally, I think Palmer's suggestion of mapping riscv to riscv32 is 
the best compromise.  I realize that Liviu isn't happy about that, but 
we can't do much about that.


Most GNU tools accept --program-transform-name as a configure option, so 
it is easy to strip off the 32 or 64 in the program name at install time 
if you wish.  That should solve Liviu's problem.


I think Liviu's argument has a flaw.  While it is true that both riscv32 
and risvc64 can emit both 32-bit and 64-bit code, they have different 
defaults.  riscv32 emits 32-bit by default, and riscv64 emits 64-bit by 
default.  That is a property we lose if we allow riscv, because it won't 
be obvious if 32-bit or 64-bit code is the default.


Jim

___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-03 Thread Liviu Ionescu



> On 3 Jul 2018, at 13:29, Ben Elliston  wrote:
> 
> OK, how about this? This patch makes everything uniform

for my embedded toolchain it seems ok.

however please note that I did not try to update my `riscv-none-embed-` build 
scripts to use this new structure; actually my scripts are still based on the 
7.x version of the RISC-V repositories, so they might need some adjustments.

but I guess I can manage this.


regards,

Liviu


___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-03 Thread Ben Elliston
OK, how about this? This patch makes everything uniform (see test
cases below for an illustration of behaviour):

diff --git a/config.sub b/config.sub
index 072700f..c95acc6 100755
--- a/config.sub
+++ b/config.sub
@@ -625,7 +625,7 @@ case $basic_machine in
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pru \
| pyramid \
-   | riscv32 | riscv64 \
+   | riscv | riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | 
shbe | shle | sh[1234]le | sh3ele \
@@ -752,7 +752,7 @@ case $basic_machine in
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pru-* \
| pyramid-* \
-   | riscv32-* | riscv64-* \
+   | riscv-* | riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* 
| sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
@@ -1125,12 +1125,6 @@ case $basic_machine in
ps2)
basic_machine=i386-ibm
;;
-   riscv)
-   basic_machine=riscv32-unknown
-   ;;
-   riscv-*)
-   basic_machine=`echo "$basic_machine" | sed 's/^riscv/riscv32/'`
-   ;;
rm[46]00)
basic_machine=mips-siemens
;;
diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data
index 7ad1f76..5ab1807 100644
--- a/testsuite/config-sub.data
+++ b/testsuite/config-sub.data
@@ -422,11 +422,11 @@ riscv64-elf   
riscv64-unknown-elf
 riscv64-hcos   riscv64-unknown-hcos
 riscv64-linux  riscv64-unknown-linux-gnu
 riscv64riscv64-unknown-none
-riscv-company-elf  riscv32-company-elf
-riscv-company-hcos riscv32-company-hcos
-riscv-elf  riscv32-unknown-elf
-riscv-linuxriscv32-unknown-linux-gnu
-riscv  riscv32-unknown-none
+riscv-company-elf  riscv-company-elf
+riscv-company-hcos riscv-company-hcos
+riscv-elf  riscv-unknown-elf
+riscv-linuxriscv-unknown-linux-gnu
+riscv  riscv-unknown-none
 rl78-linux rl78-unknown-linux-gnu
 rl78   rl78-unknown-none
 rx-linux   rx-unknown-linux-gnu


signature.asc
Description: PGP signature
___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-02 Thread Liviu Ionescu



> On 3 Jul 2018, at 07:45, Ben Elliston  wrote:
> 
> How is this?
> 
> - | riscv32-* | riscv64-* \
> + | riscv-* | riscv32-* | riscv64-* \

I think this is ok

>   riscv-*)
>   basic_machine=`echo "$basic_machine" | sed 's/^riscv/riscv32/'`

I'm not sure I understand this, but automatically replacing riscv- by riscv32- 
is not ok.


Regards,

Liviu


___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [RFC] Add "riscv-" for embedded cross toolchains

2018-07-02 Thread Ben Elliston
How is this?

2018-07-03  Liviu Ionescu 
Ben Elliston  

* config.sub: Recognise riscv-*.
* testsuite/config-sub.data: Adjust tests.

diff --git a/config.sub b/config.sub
index 072700f..76c4640 100755
--- a/config.sub
+++ b/config.sub
@@ -752,7 +752,7 @@ case $basic_machine in
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pru-* \
| pyramid-* \
-   | riscv32-* | riscv64-* \
+   | riscv-* | riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* 
| sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
@@ -1126,7 +1126,7 @@ case $basic_machine in
basic_machine=i386-ibm
;;
riscv)
-   basic_machine=riscv32-unknown
+   basic_machine=riscv-unknown
;;
riscv-*)
basic_machine=`echo "$basic_machine" | sed 's/^riscv/riscv32/'`
diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data
index 7ad1f76..5ab1807 100644
--- a/testsuite/config-sub.data
+++ b/testsuite/config-sub.data
@@ -422,11 +422,11 @@ riscv64-elf   
riscv64-unknown-elf
 riscv64-hcos   riscv64-unknown-hcos
 riscv64-linux  riscv64-unknown-linux-gnu
 riscv64riscv64-unknown-none
-riscv-company-elf  riscv32-company-elf
-riscv-company-hcos riscv32-company-hcos
-riscv-elf  riscv32-unknown-elf
-riscv-linuxriscv32-unknown-linux-gnu
-riscv  riscv32-unknown-none
+riscv-company-elf  riscv-company-elf
+riscv-company-hcos riscv-company-hcos
+riscv-elf  riscv-unknown-elf
+riscv-linuxriscv-unknown-linux-gnu
+riscv  riscv-unknown-none
 rl78-linux rl78-unknown-linux-gnu
 rl78   rl78-unknown-none
 rx-linux   rx-unknown-linux-gnu


signature.asc
Description: PGP signature
___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


[RFC] Add "riscv-" for embedded cross toolchains

2018-06-23 Thread Liviu Ionescu
Hi,

Thank you all for the valuable feedback on the previous related thread 
(http://lists.gnu.org/archive/html/config-patches/2018-06/threads.html).

However I think the topic needs a reset.

The initial assumption for the patch was:

> Most RISC-V toolchains can generate code for all RISC-V targets, but are
> currently named "riscv32-*" and "riscv64-*".  Users have suggested that
> these names are unintuitive and would like tuples to be "riscv-*".

Well, I don't know other users who suggested this, so I'll speak only for 
myself, based on the experience with the GNU MCU Eclipse RISC-V Embedded GCC 
distribution.

First, I'll state what this proposal **is not**:

- it **is not** about renaming the Linux RISC-V compiler, in any Linux 
distribution
- it **is not** about automatically renaming `riscv-` to anything else
- generally it **is not** about disturbing any native RISC-V compiler, in any 
Linux distribution, in any way; from my point of view the naming scheme for the 
native compilers is ok, and I see no reason to change it.

However, the use case for native compilers is different from the use case for 
embedded cross toolchains, since embedded cross toolchains:

- do not need to be 'guessed' for capabilities in configure scripts,
- are not related, in terms of 32/64-bit capabilities, to the host platform 
where they run,
- generally are distributed as a single executable that is capable of 
generating binaries for multiple architectures/ABIs, with multilibs.

The RISC-V non-Linux toolchain is no exception, a single executable can 
generate binaries for many architectures/ABIs based on separate `-march` & 
`-mabi` options (in their RISC-V GCC distribution, Microsemi identified 39(!) 
different multilib combinations).

In this context, it is more natural to invoke the compile using something like:

  riscv-xxx-gcc -march=rv32i -mabi=ilp32  <- generate a 32-bit binary
  riscv-xxx-gcc -march=rv64i -mabi=lp64   <- generate a 64-bit binary

Since the current config.sub file does not accept `riscv-`, and only explicit 
`riscv32-` and `riscv64-` are allowed, this leads to confusing invocations, 
like:

  riscv32-unknown-elf-gcc -march=rv64i -mabi=lp64 <- generate a 64-bit binary


The current proposal adds exactly this, the `riscv-*` tuple prefix alongside 
the existing `riscv32-*` and `riscv64-*`.

I think that this can be an incremental step towards a more elaborate mechanism 
that John defined as "config-for-target vs config-for-toolchain". I agree that 
"exact-target" and "toolchain" use-cases are fundamentally different, and one 
specifics should not be imposed on the other.

I definitely welcome John volunteering to implement such a mechanism.

Regards,

Liviu


p.s. For completeness, the proposed patch, as already used in GNU MCU Eclipse 
RISC-V Embedded GCC is:

```
diff --git a/config.sub b/config.sub
index d1f5b54..cc4d9ed 100755
--- a/config.sub
+++ b/config.sub
@@ -752,7 +752,7 @@ case $basic_machine in
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pru-* \
| pyramid-* \
-   | riscv32-* | riscv64-* \
+   | riscv32-* | riscv64-* | riscv-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* 
| sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
@@ -1522,6 +1522,8 @@ case $os in
;;
none)
;;
+   embed)
+   ;;
*-eabi)
;;
*)
```

In addition, this patch adds `embed` as an acceptable suffix for the tuple, for 
explicit use in embedded toolchains that do not have a separate embedded ABI 
(RISC-V case for now).



___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches