* [kvm-unit-tests PATCH v2 0/4] Support cross compiling with clang @ 2024-09-04 10:50 ` Andrew Jones 0 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-04 10:50 UTC (permalink / raw) To: kvm-riscv Modify configure to allow --cc=clang and a cross-prefix to be specified together (as well as --cflags). This allows compiling with clang, but using cross binutils for everything else, including the linker. So far tested on riscv 32- and 64-bit and aarch64 (with some hacks to the code to get it to compile - which is why there's no gitlab-ci patch for aarch64 in this series). I suspect it should work for other architectures too. v2: - fix building with clang and --config-efi by suppressing a warning - added riscv clang efi build to CI - picked up Thomas's tags Andrew Jones (4): riscv: Drop mstrict-align Makefile: Prepare for clang EFI builds configure: Support cross compiling with clang riscv: gitlab-ci: Add clang build tests .gitlab-ci.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ Makefile | 2 ++ configure | 11 ++++++++--- riscv/Makefile | 2 +- 4 files changed, 54 insertions(+), 4 deletions(-) -- 2.46.0 ^ permalink raw reply [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 0/4] Support cross compiling with clang @ 2024-09-04 10:50 ` Andrew Jones 0 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-04 10:50 UTC (permalink / raw) To: kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390 Cc: pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio Modify configure to allow --cc=clang and a cross-prefix to be specified together (as well as --cflags). This allows compiling with clang, but using cross binutils for everything else, including the linker. So far tested on riscv 32- and 64-bit and aarch64 (with some hacks to the code to get it to compile - which is why there's no gitlab-ci patch for aarch64 in this series). I suspect it should work for other architectures too. v2: - fix building with clang and --config-efi by suppressing a warning - added riscv clang efi build to CI - picked up Thomas's tags Andrew Jones (4): riscv: Drop mstrict-align Makefile: Prepare for clang EFI builds configure: Support cross compiling with clang riscv: gitlab-ci: Add clang build tests .gitlab-ci.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ Makefile | 2 ++ configure | 11 ++++++++--- riscv/Makefile | 2 +- 4 files changed, 54 insertions(+), 4 deletions(-) -- 2.46.0 ^ permalink raw reply [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 1/4] riscv: Drop mstrict-align 2024-09-04 10:50 ` Andrew Jones @ 2024-09-04 10:50 ` Andrew Jones -1 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-04 10:50 UTC (permalink / raw) To: kvm-riscv The spec says unaligned accesses are supported, so this isn't required and clang doesn't support it. A platform might have slow unaligned accesses, but kvm-unit-tests isn't about speed anyway. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Andrew Jones <andrew.jones@linux.dev> --- riscv/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv/Makefile b/riscv/Makefile index 179a373dbacf..2ee7c5bb5ad8 100644 --- a/riscv/Makefile +++ b/riscv/Makefile @@ -76,7 +76,7 @@ LDFLAGS += -melf32lriscv endif CFLAGS += -DCONFIG_RELOC CFLAGS += -mcmodel=medany -CFLAGS += -mstrict-align +#CFLAGS += -mstrict-align CFLAGS += -std=gnu99 CFLAGS += -ffreestanding CFLAGS += -O2 -- 2.46.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 1/4] riscv: Drop mstrict-align @ 2024-09-04 10:50 ` Andrew Jones 0 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-04 10:50 UTC (permalink / raw) To: kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390 Cc: pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio The spec says unaligned accesses are supported, so this isn't required and clang doesn't support it. A platform might have slow unaligned accesses, but kvm-unit-tests isn't about speed anyway. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Andrew Jones <andrew.jones@linux.dev> --- riscv/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv/Makefile b/riscv/Makefile index 179a373dbacf..2ee7c5bb5ad8 100644 --- a/riscv/Makefile +++ b/riscv/Makefile @@ -76,7 +76,7 @@ LDFLAGS += -melf32lriscv endif CFLAGS += -DCONFIG_RELOC CFLAGS += -mcmodel=medany -CFLAGS += -mstrict-align +#CFLAGS += -mstrict-align CFLAGS += -std=gnu99 CFLAGS += -ffreestanding CFLAGS += -O2 -- 2.46.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 1/4] riscv: Drop mstrict-align 2024-09-04 10:50 ` Andrew Jones @ 2024-09-11 0:08 ` Nicholas Piggin -1 siblings, 0 replies; 26+ messages in thread From: Nicholas Piggin @ 2024-09-11 0:08 UTC (permalink / raw) To: kvm-riscv On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > The spec says unaligned accesses are supported, so this isn't required > and clang doesn't support it. A platform might have slow unaligned > accesses, but kvm-unit-tests isn't about speed anyway. > > Reviewed-by: Thomas Huth <thuth@redhat.com> > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > --- > riscv/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/riscv/Makefile b/riscv/Makefile > index 179a373dbacf..2ee7c5bb5ad8 100644 > --- a/riscv/Makefile > +++ b/riscv/Makefile > @@ -76,7 +76,7 @@ LDFLAGS += -melf32lriscv > endif > CFLAGS += -DCONFIG_RELOC > CFLAGS += -mcmodel=medany > -CFLAGS += -mstrict-align > +#CFLAGS += -mstrict-align Just remove the line? Or put a comment there instead to explain. Thanks, Nick ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v2 1/4] riscv: Drop mstrict-align @ 2024-09-11 0:08 ` Nicholas Piggin 0 siblings, 0 replies; 26+ messages in thread From: Nicholas Piggin @ 2024-09-11 0:08 UTC (permalink / raw) To: Andrew Jones, kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390 Cc: pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > The spec says unaligned accesses are supported, so this isn't required > and clang doesn't support it. A platform might have slow unaligned > accesses, but kvm-unit-tests isn't about speed anyway. > > Reviewed-by: Thomas Huth <thuth@redhat.com> > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > --- > riscv/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/riscv/Makefile b/riscv/Makefile > index 179a373dbacf..2ee7c5bb5ad8 100644 > --- a/riscv/Makefile > +++ b/riscv/Makefile > @@ -76,7 +76,7 @@ LDFLAGS += -melf32lriscv > endif > CFLAGS += -DCONFIG_RELOC > CFLAGS += -mcmodel=medany > -CFLAGS += -mstrict-align > +#CFLAGS += -mstrict-align Just remove the line? Or put a comment there instead to explain. Thanks, Nick ^ permalink raw reply [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 1/4] riscv: Drop mstrict-align 2024-09-11 0:08 ` Nicholas Piggin @ 2024-09-11 8:19 ` Andrew Jones -1 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-11 8:19 UTC (permalink / raw) To: kvm-riscv On Wed, Sep 11, 2024 at 10:08:23AM GMT, Nicholas Piggin wrote: > On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > > The spec says unaligned accesses are supported, so this isn't required > > and clang doesn't support it. A platform might have slow unaligned > > accesses, but kvm-unit-tests isn't about speed anyway. > > > > Reviewed-by: Thomas Huth <thuth@redhat.com> > > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > > --- > > riscv/Makefile | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/riscv/Makefile b/riscv/Makefile > > index 179a373dbacf..2ee7c5bb5ad8 100644 > > --- a/riscv/Makefile > > +++ b/riscv/Makefile > > @@ -76,7 +76,7 @@ LDFLAGS += -melf32lriscv > > endif > > CFLAGS += -DCONFIG_RELOC > > CFLAGS += -mcmodel=medany > > -CFLAGS += -mstrict-align > > +#CFLAGS += -mstrict-align > > Just remove the line? > > Or put a comment there instead to explain. I'll add a comment. Thanks, drew ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v2 1/4] riscv: Drop mstrict-align @ 2024-09-11 8:19 ` Andrew Jones 0 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-11 8:19 UTC (permalink / raw) To: Nicholas Piggin Cc: kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390, pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio On Wed, Sep 11, 2024 at 10:08:23AM GMT, Nicholas Piggin wrote: > On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > > The spec says unaligned accesses are supported, so this isn't required > > and clang doesn't support it. A platform might have slow unaligned > > accesses, but kvm-unit-tests isn't about speed anyway. > > > > Reviewed-by: Thomas Huth <thuth@redhat.com> > > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > > --- > > riscv/Makefile | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/riscv/Makefile b/riscv/Makefile > > index 179a373dbacf..2ee7c5bb5ad8 100644 > > --- a/riscv/Makefile > > +++ b/riscv/Makefile > > @@ -76,7 +76,7 @@ LDFLAGS += -melf32lriscv > > endif > > CFLAGS += -DCONFIG_RELOC > > CFLAGS += -mcmodel=medany > > -CFLAGS += -mstrict-align > > +#CFLAGS += -mstrict-align > > Just remove the line? > > Or put a comment there instead to explain. I'll add a comment. Thanks, drew ^ permalink raw reply [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds 2024-09-04 10:50 ` Andrew Jones @ 2024-09-04 10:50 ` Andrew Jones -1 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-04 10:50 UTC (permalink / raw) To: kvm-riscv clang complains about GNU extensions such as variable sized types not being at the end of structs unless -Wno-gnu is used. We may eventually want -Wno-gnu, but for now let's just handle the warnings as they come. Add -Wno-gnu-variable-sized-type-not-at-end to avoid the warning issued for the initrd_dev_path struct. Signed-off-by: Andrew Jones <andrew.jones@linux.dev> --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 3d51cb726120..7471f7285b78 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,8 @@ EFI_CFLAGS += -fshort-wchar # EFI applications use PIC as they are loaded to dynamic addresses, not a fixed # starting address EFI_CFLAGS += -fPIC +# Avoid error with the initrd_dev_path struct +EFI_CFLAGS += -Wno-gnu-variable-sized-type-not-at-end # Create shared library EFI_LDFLAGS := -Bsymbolic -shared -nostdlib endif -- 2.46.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds @ 2024-09-04 10:50 ` Andrew Jones 0 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-04 10:50 UTC (permalink / raw) To: kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390 Cc: pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio clang complains about GNU extensions such as variable sized types not being at the end of structs unless -Wno-gnu is used. We may eventually want -Wno-gnu, but for now let's just handle the warnings as they come. Add -Wno-gnu-variable-sized-type-not-at-end to avoid the warning issued for the initrd_dev_path struct. Signed-off-by: Andrew Jones <andrew.jones@linux.dev> --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 3d51cb726120..7471f7285b78 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,8 @@ EFI_CFLAGS += -fshort-wchar # EFI applications use PIC as they are loaded to dynamic addresses, not a fixed # starting address EFI_CFLAGS += -fPIC +# Avoid error with the initrd_dev_path struct +EFI_CFLAGS += -Wno-gnu-variable-sized-type-not-at-end # Create shared library EFI_LDFLAGS := -Bsymbolic -shared -nostdlib endif -- 2.46.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds 2024-09-04 10:50 ` Andrew Jones @ 2024-09-04 10:57 ` Thomas Huth -1 siblings, 0 replies; 26+ messages in thread From: Thomas Huth @ 2024-09-04 10:57 UTC (permalink / raw) To: kvm-riscv On 04/09/2024 12.50, Andrew Jones wrote: > clang complains about GNU extensions such as variable sized types not > being at the end of structs unless -Wno-gnu is used. We may > eventually want -Wno-gnu, but for now let's just handle the warnings > as they come. Add -Wno-gnu-variable-sized-type-not-at-end to avoid > the warning issued for the initrd_dev_path struct. > > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > --- > Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Makefile b/Makefile > index 3d51cb726120..7471f7285b78 100644 > --- a/Makefile > +++ b/Makefile > @@ -50,6 +50,8 @@ EFI_CFLAGS += -fshort-wchar > # EFI applications use PIC as they are loaded to dynamic addresses, not a fixed > # starting address > EFI_CFLAGS += -fPIC > +# Avoid error with the initrd_dev_path struct > +EFI_CFLAGS += -Wno-gnu-variable-sized-type-not-at-end > # Create shared library > EFI_LDFLAGS := -Bsymbolic -shared -nostdlib > endif Reviewed-by: Thomas Huth <thuth@redhat.com> ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds @ 2024-09-04 10:57 ` Thomas Huth 0 siblings, 0 replies; 26+ messages in thread From: Thomas Huth @ 2024-09-04 10:57 UTC (permalink / raw) To: Andrew Jones, kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390 Cc: pbonzini, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio On 04/09/2024 12.50, Andrew Jones wrote: > clang complains about GNU extensions such as variable sized types not > being at the end of structs unless -Wno-gnu is used. We may > eventually want -Wno-gnu, but for now let's just handle the warnings > as they come. Add -Wno-gnu-variable-sized-type-not-at-end to avoid > the warning issued for the initrd_dev_path struct. > > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > --- > Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Makefile b/Makefile > index 3d51cb726120..7471f7285b78 100644 > --- a/Makefile > +++ b/Makefile > @@ -50,6 +50,8 @@ EFI_CFLAGS += -fshort-wchar > # EFI applications use PIC as they are loaded to dynamic addresses, not a fixed > # starting address > EFI_CFLAGS += -fPIC > +# Avoid error with the initrd_dev_path struct > +EFI_CFLAGS += -Wno-gnu-variable-sized-type-not-at-end > # Create shared library > EFI_LDFLAGS := -Bsymbolic -shared -nostdlib > endif Reviewed-by: Thomas Huth <thuth@redhat.com> ^ permalink raw reply [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds 2024-09-04 10:50 ` Andrew Jones @ 2024-09-11 0:21 ` Nicholas Piggin -1 siblings, 0 replies; 26+ messages in thread From: Nicholas Piggin @ 2024-09-11 0:21 UTC (permalink / raw) To: kvm-riscv On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > clang complains about GNU extensions such as variable sized types not > being at the end of structs unless -Wno-gnu is used. We may > eventually want -Wno-gnu, but for now let's just handle the warnings > as they come. Add -Wno-gnu-variable-sized-type-not-at-end to avoid > the warning issued for the initrd_dev_path struct. You could also make a variant of struct efi_vendor_dev_path with no vendordata just for initrd_dev_path? It's taken from Linux or some efi upstream though so maybe it's annoying to make such changes here. Okay in that case since it's limited to EFI. Reviewed-by: Nicholas Piggin <npiggin@gmail.com> > > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > --- > Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Makefile b/Makefile > index 3d51cb726120..7471f7285b78 100644 > --- a/Makefile > +++ b/Makefile > @@ -50,6 +50,8 @@ EFI_CFLAGS += -fshort-wchar > # EFI applications use PIC as they are loaded to dynamic addresses, not a fixed > # starting address > EFI_CFLAGS += -fPIC > +# Avoid error with the initrd_dev_path struct > +EFI_CFLAGS += -Wno-gnu-variable-sized-type-not-at-end > # Create shared library > EFI_LDFLAGS := -Bsymbolic -shared -nostdlib > endif ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds @ 2024-09-11 0:21 ` Nicholas Piggin 0 siblings, 0 replies; 26+ messages in thread From: Nicholas Piggin @ 2024-09-11 0:21 UTC (permalink / raw) To: Andrew Jones, kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390 Cc: pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > clang complains about GNU extensions such as variable sized types not > being at the end of structs unless -Wno-gnu is used. We may > eventually want -Wno-gnu, but for now let's just handle the warnings > as they come. Add -Wno-gnu-variable-sized-type-not-at-end to avoid > the warning issued for the initrd_dev_path struct. You could also make a variant of struct efi_vendor_dev_path with no vendordata just for initrd_dev_path? It's taken from Linux or some efi upstream though so maybe it's annoying to make such changes here. Okay in that case since it's limited to EFI. Reviewed-by: Nicholas Piggin <npiggin@gmail.com> > > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > --- > Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Makefile b/Makefile > index 3d51cb726120..7471f7285b78 100644 > --- a/Makefile > +++ b/Makefile > @@ -50,6 +50,8 @@ EFI_CFLAGS += -fshort-wchar > # EFI applications use PIC as they are loaded to dynamic addresses, not a fixed > # starting address > EFI_CFLAGS += -fPIC > +# Avoid error with the initrd_dev_path struct > +EFI_CFLAGS += -Wno-gnu-variable-sized-type-not-at-end > # Create shared library > EFI_LDFLAGS := -Bsymbolic -shared -nostdlib > endif ^ permalink raw reply [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds 2024-09-11 0:21 ` Nicholas Piggin @ 2024-09-11 8:21 ` Andrew Jones -1 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-11 8:21 UTC (permalink / raw) To: kvm-riscv On Wed, Sep 11, 2024 at 10:21:39AM GMT, Nicholas Piggin wrote: > On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > > clang complains about GNU extensions such as variable sized types not > > being at the end of structs unless -Wno-gnu is used. We may > > eventually want -Wno-gnu, but for now let's just handle the warnings > > as they come. Add -Wno-gnu-variable-sized-type-not-at-end to avoid > > the warning issued for the initrd_dev_path struct. > > You could also make a variant of struct efi_vendor_dev_path with no > vendordata just for initrd_dev_path? > > It's taken from Linux or some efi upstream though so maybe it's annoying > to make such changes here. Okay in that case since it's limited to EFI. I should have mentioned in the commit message that efi_vendor_dev_path is a direct import of the Linux code and that we'd rather keep it that way. I can do that for v2. > > Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Thanks, drew > > > > > > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > > --- > > Makefile | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/Makefile b/Makefile > > index 3d51cb726120..7471f7285b78 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -50,6 +50,8 @@ EFI_CFLAGS += -fshort-wchar > > # EFI applications use PIC as they are loaded to dynamic addresses, not a fixed > > # starting address > > EFI_CFLAGS += -fPIC > > +# Avoid error with the initrd_dev_path struct > > +EFI_CFLAGS += -Wno-gnu-variable-sized-type-not-at-end > > # Create shared library > > EFI_LDFLAGS := -Bsymbolic -shared -nostdlib > > endif > > > -- > kvm-riscv mailing list > kvm-riscv at lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kvm-riscv ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds @ 2024-09-11 8:21 ` Andrew Jones 0 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-11 8:21 UTC (permalink / raw) To: Nicholas Piggin Cc: kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390, pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio On Wed, Sep 11, 2024 at 10:21:39AM GMT, Nicholas Piggin wrote: > On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > > clang complains about GNU extensions such as variable sized types not > > being at the end of structs unless -Wno-gnu is used. We may > > eventually want -Wno-gnu, but for now let's just handle the warnings > > as they come. Add -Wno-gnu-variable-sized-type-not-at-end to avoid > > the warning issued for the initrd_dev_path struct. > > You could also make a variant of struct efi_vendor_dev_path with no > vendordata just for initrd_dev_path? > > It's taken from Linux or some efi upstream though so maybe it's annoying > to make such changes here. Okay in that case since it's limited to EFI. I should have mentioned in the commit message that efi_vendor_dev_path is a direct import of the Linux code and that we'd rather keep it that way. I can do that for v2. > > Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Thanks, drew > > > > > > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > > --- > > Makefile | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/Makefile b/Makefile > > index 3d51cb726120..7471f7285b78 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -50,6 +50,8 @@ EFI_CFLAGS += -fshort-wchar > > # EFI applications use PIC as they are loaded to dynamic addresses, not a fixed > > # starting address > > EFI_CFLAGS += -fPIC > > +# Avoid error with the initrd_dev_path struct > > +EFI_CFLAGS += -Wno-gnu-variable-sized-type-not-at-end > > # Create shared library > > EFI_LDFLAGS := -Bsymbolic -shared -nostdlib > > endif > > > -- > kvm-riscv mailing list > kvm-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kvm-riscv ^ permalink raw reply [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 3/4] configure: Support cross compiling with clang 2024-09-04 10:50 ` Andrew Jones @ 2024-09-04 10:50 ` Andrew Jones -1 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-04 10:50 UTC (permalink / raw) To: kvm-riscv When a user specifies the compiler with --cc assume it's already fully named, even if the user also specifies a cross-prefix. This allows clang to be selected for the compiler, which doesn't use prefixes, but also still provide a cross prefix for binutils. If a user needs a prefix on the compiler that they specify with --cc, then they'll just have to specify it with the prefix prepended. Also ensure user provided cflags are used when testing the compiler, since the flags may drastically change behavior, such as the --target flag for clang. With these changes it's possible to cross compile for riscv with clang after configuring with ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' \ --cross-prefix=riscv64-linux-gnu- Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Andrew Jones <andrew.jones@linux.dev> --- configure | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 27ae9cc89657..337af07374df 100755 --- a/configure +++ b/configure @@ -130,6 +130,7 @@ while [[ "$1" = -* ]]; do ;; --cc) cc="$arg" + cc_selected=yes ;; --cflags) cflags="$arg" @@ -200,6 +201,10 @@ while [[ "$1" = -* ]]; do esac done +if [ -z "$cc_selected" ] && [ "$cross_prefix" ]; then + cc="$cross_prefix$cc" +fi + if [ -z "$efi" ] || [ "$efi" = "n" ]; then [ "$efi_direct" = "y" ] && efi_direct= fi @@ -370,7 +375,7 @@ fi cat << EOF > lib-test.c __UINT32_TYPE__ EOF -u32_long=$("$cross_prefix$cc" -E lib-test.c | grep -v '^#' | grep -q long && echo yes) +u32_long=$("$cc" $cflags -E lib-test.c | grep -v '^#' | grep -q long && echo yes) rm -f lib-test.c # check if slash can be used for division @@ -379,7 +384,7 @@ if [ "$arch" = "i386" ] || [ "$arch" = "x86_64" ]; then foo: movl (8 / 2), %eax EOF - wa_divide=$("$cross_prefix$cc" -c lib-test.S >/dev/null 2>&1 || echo yes) + wa_divide=$("$cc" $cflags -c lib-test.S >/dev/null 2>&1 || echo yes) rm -f lib-test.{o,S} fi @@ -442,7 +447,7 @@ ARCH=$arch ARCH_NAME=$arch_name ARCH_LIBDIR=$arch_libdir PROCESSOR=$processor -CC=$cross_prefix$cc +CC=$cc CFLAGS=$cflags LD=$cross_prefix$ld OBJCOPY=$cross_prefix$objcopy -- 2.46.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 3/4] configure: Support cross compiling with clang @ 2024-09-04 10:50 ` Andrew Jones 0 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-04 10:50 UTC (permalink / raw) To: kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390 Cc: pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio When a user specifies the compiler with --cc assume it's already fully named, even if the user also specifies a cross-prefix. This allows clang to be selected for the compiler, which doesn't use prefixes, but also still provide a cross prefix for binutils. If a user needs a prefix on the compiler that they specify with --cc, then they'll just have to specify it with the prefix prepended. Also ensure user provided cflags are used when testing the compiler, since the flags may drastically change behavior, such as the --target flag for clang. With these changes it's possible to cross compile for riscv with clang after configuring with ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' \ --cross-prefix=riscv64-linux-gnu- Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Andrew Jones <andrew.jones@linux.dev> --- configure | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 27ae9cc89657..337af07374df 100755 --- a/configure +++ b/configure @@ -130,6 +130,7 @@ while [[ "$1" = -* ]]; do ;; --cc) cc="$arg" + cc_selected=yes ;; --cflags) cflags="$arg" @@ -200,6 +201,10 @@ while [[ "$1" = -* ]]; do esac done +if [ -z "$cc_selected" ] && [ "$cross_prefix" ]; then + cc="$cross_prefix$cc" +fi + if [ -z "$efi" ] || [ "$efi" = "n" ]; then [ "$efi_direct" = "y" ] && efi_direct= fi @@ -370,7 +375,7 @@ fi cat << EOF > lib-test.c __UINT32_TYPE__ EOF -u32_long=$("$cross_prefix$cc" -E lib-test.c | grep -v '^#' | grep -q long && echo yes) +u32_long=$("$cc" $cflags -E lib-test.c | grep -v '^#' | grep -q long && echo yes) rm -f lib-test.c # check if slash can be used for division @@ -379,7 +384,7 @@ if [ "$arch" = "i386" ] || [ "$arch" = "x86_64" ]; then foo: movl (8 / 2), %eax EOF - wa_divide=$("$cross_prefix$cc" -c lib-test.S >/dev/null 2>&1 || echo yes) + wa_divide=$("$cc" $cflags -c lib-test.S >/dev/null 2>&1 || echo yes) rm -f lib-test.{o,S} fi @@ -442,7 +447,7 @@ ARCH=$arch ARCH_NAME=$arch_name ARCH_LIBDIR=$arch_libdir PROCESSOR=$processor -CC=$cross_prefix$cc +CC=$cc CFLAGS=$cflags LD=$cross_prefix$ld OBJCOPY=$cross_prefix$objcopy -- 2.46.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 3/4] configure: Support cross compiling with clang 2024-09-04 10:50 ` Andrew Jones @ 2024-09-11 0:24 ` Nicholas Piggin -1 siblings, 0 replies; 26+ messages in thread From: Nicholas Piggin @ 2024-09-11 0:24 UTC (permalink / raw) To: kvm-riscv On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > When a user specifies the compiler with --cc assume it's already > fully named, even if the user also specifies a cross-prefix. This > allows clang to be selected for the compiler, which doesn't use > prefixes, but also still provide a cross prefix for binutils. If > a user needs a prefix on the compiler that they specify with --cc, > then they'll just have to specify it with the prefix prepended. Makes sense. > Also ensure user provided cflags are used when testing the compiler, > since the flags may drastically change behavior, such as the --target > flag for clang. Could be a separate patch but no big deal. > > With these changes it's possible to cross compile for riscv with > clang after configuring with > > ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' \ > --cross-prefix=riscv64-linux-gnu- Nice. Perhaps add a recipe to README? Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Thanks, Nick > > Reviewed-by: Thomas Huth <thuth@redhat.com> > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > --- > configure | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/configure b/configure > index 27ae9cc89657..337af07374df 100755 > --- a/configure > +++ b/configure > @@ -130,6 +130,7 @@ while [[ "$1" = -* ]]; do > ;; > --cc) > cc="$arg" > + cc_selected=yes > ;; > --cflags) > cflags="$arg" > @@ -200,6 +201,10 @@ while [[ "$1" = -* ]]; do > esac > done > > +if [ -z "$cc_selected" ] && [ "$cross_prefix" ]; then > + cc="$cross_prefix$cc" > +fi > + > if [ -z "$efi" ] || [ "$efi" = "n" ]; then > [ "$efi_direct" = "y" ] && efi_direct= > fi > @@ -370,7 +375,7 @@ fi > cat << EOF > lib-test.c > __UINT32_TYPE__ > EOF > -u32_long=$("$cross_prefix$cc" -E lib-test.c | grep -v '^#' | grep -q long && echo yes) > +u32_long=$("$cc" $cflags -E lib-test.c | grep -v '^#' | grep -q long && echo yes) > rm -f lib-test.c > > # check if slash can be used for division > @@ -379,7 +384,7 @@ if [ "$arch" = "i386" ] || [ "$arch" = "x86_64" ]; then > foo: > movl (8 / 2), %eax > EOF > - wa_divide=$("$cross_prefix$cc" -c lib-test.S >/dev/null 2>&1 || echo yes) > + wa_divide=$("$cc" $cflags -c lib-test.S >/dev/null 2>&1 || echo yes) > rm -f lib-test.{o,S} > fi > > @@ -442,7 +447,7 @@ ARCH=$arch > ARCH_NAME=$arch_name > ARCH_LIBDIR=$arch_libdir > PROCESSOR=$processor > -CC=$cross_prefix$cc > +CC=$cc > CFLAGS=$cflags > LD=$cross_prefix$ld > OBJCOPY=$cross_prefix$objcopy ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v2 3/4] configure: Support cross compiling with clang @ 2024-09-11 0:24 ` Nicholas Piggin 0 siblings, 0 replies; 26+ messages in thread From: Nicholas Piggin @ 2024-09-11 0:24 UTC (permalink / raw) To: Andrew Jones, kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390 Cc: pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > When a user specifies the compiler with --cc assume it's already > fully named, even if the user also specifies a cross-prefix. This > allows clang to be selected for the compiler, which doesn't use > prefixes, but also still provide a cross prefix for binutils. If > a user needs a prefix on the compiler that they specify with --cc, > then they'll just have to specify it with the prefix prepended. Makes sense. > Also ensure user provided cflags are used when testing the compiler, > since the flags may drastically change behavior, such as the --target > flag for clang. Could be a separate patch but no big deal. > > With these changes it's possible to cross compile for riscv with > clang after configuring with > > ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' \ > --cross-prefix=riscv64-linux-gnu- Nice. Perhaps add a recipe to README? Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Thanks, Nick > > Reviewed-by: Thomas Huth <thuth@redhat.com> > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > --- > configure | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/configure b/configure > index 27ae9cc89657..337af07374df 100755 > --- a/configure > +++ b/configure > @@ -130,6 +130,7 @@ while [[ "$1" = -* ]]; do > ;; > --cc) > cc="$arg" > + cc_selected=yes > ;; > --cflags) > cflags="$arg" > @@ -200,6 +201,10 @@ while [[ "$1" = -* ]]; do > esac > done > > +if [ -z "$cc_selected" ] && [ "$cross_prefix" ]; then > + cc="$cross_prefix$cc" > +fi > + > if [ -z "$efi" ] || [ "$efi" = "n" ]; then > [ "$efi_direct" = "y" ] && efi_direct= > fi > @@ -370,7 +375,7 @@ fi > cat << EOF > lib-test.c > __UINT32_TYPE__ > EOF > -u32_long=$("$cross_prefix$cc" -E lib-test.c | grep -v '^#' | grep -q long && echo yes) > +u32_long=$("$cc" $cflags -E lib-test.c | grep -v '^#' | grep -q long && echo yes) > rm -f lib-test.c > > # check if slash can be used for division > @@ -379,7 +384,7 @@ if [ "$arch" = "i386" ] || [ "$arch" = "x86_64" ]; then > foo: > movl (8 / 2), %eax > EOF > - wa_divide=$("$cross_prefix$cc" -c lib-test.S >/dev/null 2>&1 || echo yes) > + wa_divide=$("$cc" $cflags -c lib-test.S >/dev/null 2>&1 || echo yes) > rm -f lib-test.{o,S} > fi > > @@ -442,7 +447,7 @@ ARCH=$arch > ARCH_NAME=$arch_name > ARCH_LIBDIR=$arch_libdir > PROCESSOR=$processor > -CC=$cross_prefix$cc > +CC=$cc > CFLAGS=$cflags > LD=$cross_prefix$ld > OBJCOPY=$cross_prefix$objcopy ^ permalink raw reply [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 3/4] configure: Support cross compiling with clang 2024-09-11 0:24 ` Nicholas Piggin @ 2024-09-11 8:24 ` Andrew Jones -1 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-11 8:24 UTC (permalink / raw) To: kvm-riscv On Wed, Sep 11, 2024 at 10:24:34AM GMT, Nicholas Piggin wrote: > On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > > When a user specifies the compiler with --cc assume it's already > > fully named, even if the user also specifies a cross-prefix. This > > allows clang to be selected for the compiler, which doesn't use > > prefixes, but also still provide a cross prefix for binutils. If > > a user needs a prefix on the compiler that they specify with --cc, > > then they'll just have to specify it with the prefix prepended. > > Makes sense. > > > Also ensure user provided cflags are used when testing the compiler, > > since the flags may drastically change behavior, such as the --target > > flag for clang. > > Could be a separate patch but no big deal. > > > > > With these changes it's possible to cross compile for riscv with > > clang after configuring with > > > > ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' \ > > --cross-prefix=riscv64-linux-gnu- > > Nice. Perhaps add a recipe to README? Sure. > > Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Thanks, drew ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v2 3/4] configure: Support cross compiling with clang @ 2024-09-11 8:24 ` Andrew Jones 0 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-11 8:24 UTC (permalink / raw) To: Nicholas Piggin Cc: kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390, pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio On Wed, Sep 11, 2024 at 10:24:34AM GMT, Nicholas Piggin wrote: > On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > > When a user specifies the compiler with --cc assume it's already > > fully named, even if the user also specifies a cross-prefix. This > > allows clang to be selected for the compiler, which doesn't use > > prefixes, but also still provide a cross prefix for binutils. If > > a user needs a prefix on the compiler that they specify with --cc, > > then they'll just have to specify it with the prefix prepended. > > Makes sense. > > > Also ensure user provided cflags are used when testing the compiler, > > since the flags may drastically change behavior, such as the --target > > flag for clang. > > Could be a separate patch but no big deal. > > > > > With these changes it's possible to cross compile for riscv with > > clang after configuring with > > > > ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' \ > > --cross-prefix=riscv64-linux-gnu- > > Nice. Perhaps add a recipe to README? Sure. > > Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Thanks, drew ^ permalink raw reply [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 4/4] riscv: gitlab-ci: Add clang build tests 2024-09-04 10:50 ` Andrew Jones @ 2024-09-04 10:50 ` Andrew Jones -1 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-04 10:50 UTC (permalink / raw) To: kvm-riscv Test building 32 and 64-bit with clang. Throw a test of in- and out- of-tree building in too by swapping which is done to which (32-bit vs. 64-bit) with respect to the gcc build tests. Acked-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Andrew Jones <andrew.jones@linux.dev> --- .gitlab-ci.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67a9a15733f1..b7ad99870e5a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -176,6 +176,49 @@ build-riscv64-efi: | tee results.txt - grep -q PASS results.txt && ! grep -q FAIL results.txt +build-riscv32-clang: + extends: .intree_template + script: + - dnf install -y qemu-system-riscv gcc-riscv64-linux-gnu clang + - ./configure --arch=riscv32 --cc=clang --cflags='--target=riscv32' --cross-prefix=riscv64-linux-gnu- + - make -j2 + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh + selftest + sbi + | tee results.txt + - grep -q PASS results.txt && ! grep -q FAIL results.txt + +build-riscv64-clang: + extends: .outoftree_template + script: + - dnf install -y qemu-system-riscv gcc-riscv64-linux-gnu clang + - mkdir build + - cd build + - ../configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' --cross-prefix=riscv64-linux-gnu- + - make -j2 + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh + selftest + sbi + | tee results.txt + - grep -q PASS results.txt && ! grep -q FAIL results.txt + +build-riscv64-clang-efi: + extends: .intree_template + script: + - dnf install -y edk2-riscv64 qemu-system-riscv gcc-riscv64-linux-gnu clang + - cp /usr/share/edk2/riscv/RISCV_VIRT_CODE.fd . + - truncate -s 32M RISCV_VIRT_CODE.fd + - ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' --cross-prefix=riscv64-linux-gnu- --enable-efi + - make -j2 + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh + selftest + sbi + | tee results.txt + - grep -q PASS results.txt && ! grep -q FAIL results.txt + build-s390x: extends: .outoftree_template script: -- 2.46.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 4/4] riscv: gitlab-ci: Add clang build tests @ 2024-09-04 10:50 ` Andrew Jones 0 siblings, 0 replies; 26+ messages in thread From: Andrew Jones @ 2024-09-04 10:50 UTC (permalink / raw) To: kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390 Cc: pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio Test building 32 and 64-bit with clang. Throw a test of in- and out- of-tree building in too by swapping which is done to which (32-bit vs. 64-bit) with respect to the gcc build tests. Acked-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Andrew Jones <andrew.jones@linux.dev> --- .gitlab-ci.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67a9a15733f1..b7ad99870e5a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -176,6 +176,49 @@ build-riscv64-efi: | tee results.txt - grep -q PASS results.txt && ! grep -q FAIL results.txt +build-riscv32-clang: + extends: .intree_template + script: + - dnf install -y qemu-system-riscv gcc-riscv64-linux-gnu clang + - ./configure --arch=riscv32 --cc=clang --cflags='--target=riscv32' --cross-prefix=riscv64-linux-gnu- + - make -j2 + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh + selftest + sbi + | tee results.txt + - grep -q PASS results.txt && ! grep -q FAIL results.txt + +build-riscv64-clang: + extends: .outoftree_template + script: + - dnf install -y qemu-system-riscv gcc-riscv64-linux-gnu clang + - mkdir build + - cd build + - ../configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' --cross-prefix=riscv64-linux-gnu- + - make -j2 + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh + selftest + sbi + | tee results.txt + - grep -q PASS results.txt && ! grep -q FAIL results.txt + +build-riscv64-clang-efi: + extends: .intree_template + script: + - dnf install -y edk2-riscv64 qemu-system-riscv gcc-riscv64-linux-gnu clang + - cp /usr/share/edk2/riscv/RISCV_VIRT_CODE.fd . + - truncate -s 32M RISCV_VIRT_CODE.fd + - ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' --cross-prefix=riscv64-linux-gnu- --enable-efi + - make -j2 + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh + selftest + sbi + | tee results.txt + - grep -q PASS results.txt && ! grep -q FAIL results.txt + build-s390x: extends: .outoftree_template script: -- 2.46.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v2 4/4] riscv: gitlab-ci: Add clang build tests 2024-09-04 10:50 ` Andrew Jones @ 2024-09-11 0:26 ` Nicholas Piggin -1 siblings, 0 replies; 26+ messages in thread From: Nicholas Piggin @ 2024-09-11 0:26 UTC (permalink / raw) To: kvm-riscv On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > Test building 32 and 64-bit with clang. Throw a test of in- and out- > of-tree building in too by swapping which is done to which (32-bit > vs. 64-bit) with respect to the gcc build tests. > Acked-by: Nicholas Piggin <npiggin@gmail.com> > Acked-by: Thomas Huth <thuth@redhat.com> > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > --- > .gitlab-ci.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 43 insertions(+) > > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml > index 67a9a15733f1..b7ad99870e5a 100644 > --- a/.gitlab-ci.yml > +++ b/.gitlab-ci.yml > @@ -176,6 +176,49 @@ build-riscv64-efi: > | tee results.txt > - grep -q PASS results.txt && ! grep -q FAIL results.txt > > +build-riscv32-clang: > + extends: .intree_template > + script: > + - dnf install -y qemu-system-riscv gcc-riscv64-linux-gnu clang > + - ./configure --arch=riscv32 --cc=clang --cflags='--target=riscv32' --cross-prefix=riscv64-linux-gnu- > + - make -j2 > + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env > + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh > + selftest > + sbi > + | tee results.txt > + - grep -q PASS results.txt && ! grep -q FAIL results.txt > + > +build-riscv64-clang: > + extends: .outoftree_template > + script: > + - dnf install -y qemu-system-riscv gcc-riscv64-linux-gnu clang > + - mkdir build > + - cd build > + - ../configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' --cross-prefix=riscv64-linux-gnu- > + - make -j2 > + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env > + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh > + selftest > + sbi > + | tee results.txt > + - grep -q PASS results.txt && ! grep -q FAIL results.txt > + > +build-riscv64-clang-efi: > + extends: .intree_template > + script: > + - dnf install -y edk2-riscv64 qemu-system-riscv gcc-riscv64-linux-gnu clang > + - cp /usr/share/edk2/riscv/RISCV_VIRT_CODE.fd . > + - truncate -s 32M RISCV_VIRT_CODE.fd > + - ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' --cross-prefix=riscv64-linux-gnu- --enable-efi > + - make -j2 > + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env > + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh > + selftest > + sbi > + | tee results.txt > + - grep -q PASS results.txt && ! grep -q FAIL results.txt > + > build-s390x: > extends: .outoftree_template > script: ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v2 4/4] riscv: gitlab-ci: Add clang build tests @ 2024-09-11 0:26 ` Nicholas Piggin 0 siblings, 0 replies; 26+ messages in thread From: Nicholas Piggin @ 2024-09-11 0:26 UTC (permalink / raw) To: Andrew Jones, kvm, kvm-riscv, kvmarm, linuxppc-dev, linux-s390 Cc: pbonzini, thuth, lvivier, frankja, imbrenda, nrb, atishp, cade.richard, jamestiotio On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > Test building 32 and 64-bit with clang. Throw a test of in- and out- > of-tree building in too by swapping which is done to which (32-bit > vs. 64-bit) with respect to the gcc build tests. > Acked-by: Nicholas Piggin <npiggin@gmail.com> > Acked-by: Thomas Huth <thuth@redhat.com> > Signed-off-by: Andrew Jones <andrew.jones@linux.dev> > --- > .gitlab-ci.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 43 insertions(+) > > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml > index 67a9a15733f1..b7ad99870e5a 100644 > --- a/.gitlab-ci.yml > +++ b/.gitlab-ci.yml > @@ -176,6 +176,49 @@ build-riscv64-efi: > | tee results.txt > - grep -q PASS results.txt && ! grep -q FAIL results.txt > > +build-riscv32-clang: > + extends: .intree_template > + script: > + - dnf install -y qemu-system-riscv gcc-riscv64-linux-gnu clang > + - ./configure --arch=riscv32 --cc=clang --cflags='--target=riscv32' --cross-prefix=riscv64-linux-gnu- > + - make -j2 > + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env > + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh > + selftest > + sbi > + | tee results.txt > + - grep -q PASS results.txt && ! grep -q FAIL results.txt > + > +build-riscv64-clang: > + extends: .outoftree_template > + script: > + - dnf install -y qemu-system-riscv gcc-riscv64-linux-gnu clang > + - mkdir build > + - cd build > + - ../configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' --cross-prefix=riscv64-linux-gnu- > + - make -j2 > + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env > + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh > + selftest > + sbi > + | tee results.txt > + - grep -q PASS results.txt && ! grep -q FAIL results.txt > + > +build-riscv64-clang-efi: > + extends: .intree_template > + script: > + - dnf install -y edk2-riscv64 qemu-system-riscv gcc-riscv64-linux-gnu clang > + - cp /usr/share/edk2/riscv/RISCV_VIRT_CODE.fd . > + - truncate -s 32M RISCV_VIRT_CODE.fd > + - ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' --cross-prefix=riscv64-linux-gnu- --enable-efi > + - make -j2 > + - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env > + - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh > + selftest > + sbi > + | tee results.txt > + - grep -q PASS results.txt && ! grep -q FAIL results.txt > + > build-s390x: > extends: .outoftree_template > script: ^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2024-09-11 8:24 UTC | newest] Thread overview: 26+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-09-04 10:50 [kvm-unit-tests PATCH v2 0/4] Support cross compiling with clang Andrew Jones 2024-09-04 10:50 ` Andrew Jones 2024-09-04 10:50 ` [kvm-unit-tests PATCH v2 1/4] riscv: Drop mstrict-align Andrew Jones 2024-09-04 10:50 ` Andrew Jones 2024-09-11 0:08 ` Nicholas Piggin 2024-09-11 0:08 ` Nicholas Piggin 2024-09-11 8:19 ` Andrew Jones 2024-09-11 8:19 ` Andrew Jones 2024-09-04 10:50 ` [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds Andrew Jones 2024-09-04 10:50 ` Andrew Jones 2024-09-04 10:57 ` Thomas Huth 2024-09-04 10:57 ` Thomas Huth 2024-09-11 0:21 ` Nicholas Piggin 2024-09-11 0:21 ` Nicholas Piggin 2024-09-11 8:21 ` Andrew Jones 2024-09-11 8:21 ` Andrew Jones 2024-09-04 10:50 ` [kvm-unit-tests PATCH v2 3/4] configure: Support cross compiling with clang Andrew Jones 2024-09-04 10:50 ` Andrew Jones 2024-09-11 0:24 ` Nicholas Piggin 2024-09-11 0:24 ` Nicholas Piggin 2024-09-11 8:24 ` Andrew Jones 2024-09-11 8:24 ` Andrew Jones 2024-09-04 10:50 ` [kvm-unit-tests PATCH v2 4/4] riscv: gitlab-ci: Add clang build tests Andrew Jones 2024-09-04 10:50 ` Andrew Jones 2024-09-11 0:26 ` Nicholas Piggin 2024-09-11 0:26 ` Nicholas Piggin
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.