Message ID | 20180125043621.19972-18-palmer@dabbelt.com |
---|---|
State | New |
Headers | show |
Series | [01/17] Skeleton documentation for the RISC-V port | expand |
On Wed, 24 Jan 2018, Palmer Dabbelt wrote: > diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py > index 28c04e66fd52..e3113599beb1 100755 > --- a/scripts/build-many-glibcs.py > +++ b/scripts/build-many-glibcs.py > @@ -329,6 +329,12 @@ class Context(object): > os_name='linux-gnuspe', > variant='e500v1', > gcc_cfg=['--disable-multilib', '--enable-secureplt']) > + self.add_config(arch='riscv64', > + os_name='linux-gnu', > + glibcs=[{'variant': 'rv64imafdc-lp64d', > + 'ccopts': '-march=rv64imafdc -mabi=lp64d'}, > + {'variant': 'rv64imac-lp64', > + 'ccopts': '-march=rv64imac -mabi=lp64'}]) Are you sure this actually works with this version of the port, and current upstream GCC? In patch 16, in this version of the port, the preconfigure script disallows soft-float, "glibc does not yet support systems without the F extension". Apart from a few other places in the port with soft-float support (again, the port should be consistent about what is or is not supported - either have the soft-float support, or not include the code at all because it can't be tested - of course most places are actually testing for the ABI, but it seems there are a few testing __riscv_flen), as I understand it -march=rv64imac means soft-float so wouldn't build given patch 16. *And* GCC's t-linux-multilib looks like it expects both 32-bit and 64-bit, hard-float and soft-float ABI multilibs: MULTILIB_REQUIRED = march=rv32imac/mabi=ilp32 \ march=rv32imafdc/mabi=ilp32d \ march=rv64imac/mabi=lp64 \ march=rv64imafdc/mabi=lp64d So I'd expect the second GCC build to run into problems when only RV64 multilibs of glibc but not RV32 ones have been built, because it would try to build the RV32 shared libraries of libgcc, libstdc++ etc., which depend on glibc having been built.
On Thu, 25 Jan 2018 09:42:20 PST (-0800), joseph@codesourcery.com wrote: > On Wed, 24 Jan 2018, Palmer Dabbelt wrote: > >> diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py >> index 28c04e66fd52..e3113599beb1 100755 >> --- a/scripts/build-many-glibcs.py >> +++ b/scripts/build-many-glibcs.py >> @@ -329,6 +329,12 @@ class Context(object): >> os_name='linux-gnuspe', >> variant='e500v1', >> gcc_cfg=['--disable-multilib', '--enable-secureplt']) >> + self.add_config(arch='riscv64', >> + os_name='linux-gnu', >> + glibcs=[{'variant': 'rv64imafdc-lp64d', >> + 'ccopts': '-march=rv64imafdc -mabi=lp64d'}, >> + {'variant': 'rv64imac-lp64', >> + 'ccopts': '-march=rv64imac -mabi=lp64'}]) > > Are you sure this actually works with this version of the port, and > current upstream GCC? > > In patch 16, in this version of the port, the preconfigure script > disallows soft-float, "glibc does not yet support systems without the F > extension". Apart from a few other places in the port with soft-float > support (again, the port should be consistent about what is or is not > supported - either have the soft-float support, or not include the code at > all because it can't be tested - of course most places are actually > testing for the ABI, but it seems there are a few testing __riscv_flen), > as I understand it -march=rv64imac means soft-float so wouldn't build > given patch 16. *And* GCC's t-linux-multilib looks like it expects both > 32-bit and 64-bit, hard-float and soft-float ABI multilibs: > > MULTILIB_REQUIRED = march=rv32imac/mabi=ilp32 \ > march=rv32imafdc/mabi=ilp32d \ > march=rv64imac/mabi=lp64 \ > march=rv64imafdc/mabi=lp64d > > So I'd expect the second GCC build to run into problems when only RV64 > multilibs of glibc but not RV32 ones have been built, because it would try > to build the RV32 shared libraries of libgcc, libstdc++ etc., which depend > on glibc having been built. Sorry, I think I got my signals crossed and didn't get the patches that dropped the various bits of support onto the machine that was running build-many-glibcs.py. I'm going to add three (or two, if the soft float doesn't make it in time) non-multilib targets that will look something like this: self.add_config(arch='riscv64', os_name='linux-gnu', variant='rv64imac-lp64', gcc_cfg=['--with-arch=rv64imac', '--with-abi=lp64', '--disable-multilib']) self.add_config(arch='riscv64', os_name='linux-gnu', variant='rv64imafdc-lp64', gcc_cfg=['--with-arch=rv64imafdc', '--with-abi=lp64', '--disable-multilib']) self.add_config(arch='riscv64', os_name='linux-gnu', variant='rv64imafdc-lp64d', gcc_cfg=['--with-arch=rv64imafdc', '--with-abi=lp64d', '--disable-multilib'])
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index 28c04e66fd52..e3113599beb1 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -329,6 +329,12 @@ class Context(object): os_name='linux-gnuspe', variant='e500v1', gcc_cfg=['--disable-multilib', '--enable-secureplt']) + self.add_config(arch='riscv64', + os_name='linux-gnu', + glibcs=[{'variant': 'rv64imafdc-lp64d', + 'ccopts': '-march=rv64imafdc -mabi=lp64d'}, + {'variant': 'rv64imac-lp64', + 'ccopts': '-march=rv64imac -mabi=lp64'}]) self.add_config(arch='s390x', os_name='linux-gnu', glibcs=[{}, @@ -1227,6 +1233,8 @@ class Config(object): 'nios2': 'nios2', 'powerpc': 'powerpc', 's390': 's390', + 'riscv32': 'riscv', + 'riscv64': 'riscv', 'sh': 'sh', 'sparc': 'sparc', 'tile': 'tile',