[1/1] vfio: Make buildable with MUSL runtime

Message ID 20230520180730.5789-1-philipp@redfish-solutions.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [1/1] vfio: Make buildable with MUSL runtime |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-unit-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS

Commit Message

Philip Prindeville May 20, 2023, 6:07 p.m. UTC
  From: Philip Prindeville <philipp@redfish-solutions.com>

pread64() and pwrite64() are declared in <unistd.h> in MUSL and
other (i.e. not glibc) C runtimes.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
---
 drivers/bus/pci/linux/pci_vfio.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Anatoly Burakov May 22, 2023, 9:27 a.m. UTC | #1
On 5/20/2023 7:07 PM, Philip Prindeville wrote:
> From: Philip Prindeville <philipp@redfish-solutions.com>
> 
> pread64() and pwrite64() are declared in <unistd.h> in MUSL and
> other (i.e. not glibc) C runtimes.
> 
> Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
> ---
>   drivers/bus/pci/linux/pci_vfio.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
> index fab3483d9f8108fafaff6d022cd41165d1ec5a61..fe83e1a04ec2e7a891425144be3e0aacecb24f09 100644
> --- a/drivers/bus/pci/linux/pci_vfio.c
> +++ b/drivers/bus/pci/linux/pci_vfio.c
> @@ -2,6 +2,7 @@
>    * Copyright(c) 2010-2014 Intel Corporation
>    */
>   
> +#include <unistd.h>
>   #include <string.h>
>   #include <fcntl.h>
>   #include <linux/pci_regs.h>

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  
Thomas Monjalon May 23, 2023, 10:33 a.m. UTC | #2
22/05/2023 11:27, Burakov, Anatoly:
> On 5/20/2023 7:07 PM, Philip Prindeville wrote:
> > From: Philip Prindeville <philipp@redfish-solutions.com>
> > 
> > pread64() and pwrite64() are declared in <unistd.h> in MUSL and
> > other (i.e. not glibc) C runtimes.
> > 
> > Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

It was "buildable" already, and I don't understand how.
In any doubt, I've added Cc: stable@dpdk.org for backports.

Applied, thanks.
  
Philip Prindeville May 23, 2023, 3:46 p.m. UTC | #3
> On May 23, 2023, at 5:33 AM, Thomas Monjalon <thomas@monjalon.net> wrote:
> 
> 22/05/2023 11:27, Burakov, Anatoly:
>> On 5/20/2023 7:07 PM, Philip Prindeville wrote:
>>> From: Philip Prindeville <philipp@redfish-solutions.com>
>>> 
>>> pread64() and pwrite64() are declared in <unistd.h> in MUSL and
>>> other (i.e. not glibc) C runtimes.
>>> 
>>> Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
>> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
> 
> It was "buildable" already, and I don't understand how.
> In any doubt, I've added Cc: stable@dpdk.org for backports.
> 
> Applied, thanks.
> 
> 


Yeah, it builds with glibc just fine.  MUSL is another story...
  
Thomas Monjalon May 23, 2023, 4:36 p.m. UTC | #4
23/05/2023 17:46, Philip Prindeville:
> 
> > On May 23, 2023, at 5:33 AM, Thomas Monjalon <thomas@monjalon.net> wrote:
> > 
> > 22/05/2023 11:27, Burakov, Anatoly:
> >> On 5/20/2023 7:07 PM, Philip Prindeville wrote:
> >>> From: Philip Prindeville <philipp@redfish-solutions.com>
> >>> 
> >>> pread64() and pwrite64() are declared in <unistd.h> in MUSL and
> >>> other (i.e. not glibc) C runtimes.
> >>> 
> >>> Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
> >> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
> > 
> > It was "buildable" already, and I don't understand how.
> > In any doubt, I've added Cc: stable@dpdk.org for backports.
> > 
> > Applied, thanks.
> 
> Yeah, it builds with glibc just fine.  MUSL is another story...

It is also building on Alpine/musl.
I would like to understand why.
Do you have failure logs and versions?
  
Philip Prindeville May 23, 2023, 7 p.m. UTC | #5
> On May 23, 2023, at 11:36 AM, Thomas Monjalon <thomas@monjalon.net> wrote:
> 
> 23/05/2023 17:46, Philip Prindeville:
>> 
>>> On May 23, 2023, at 5:33 AM, Thomas Monjalon <thomas@monjalon.net> wrote:
>>> 
>>> 22/05/2023 11:27, Burakov, Anatoly:
>>>> On 5/20/2023 7:07 PM, Philip Prindeville wrote:
>>>>> From: Philip Prindeville <philipp@redfish-solutions.com>
>>>>> 
>>>>> pread64() and pwrite64() are declared in <unistd.h> in MUSL and
>>>>> other (i.e. not glibc) C runtimes.
>>>>> 
>>>>> Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
>>>> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
>>> 
>>> It was "buildable" already, and I don't understand how.
>>> In any doubt, I've added Cc: stable@dpdk.org for backports.
>>> 
>>> Applied, thanks.
>> 
>> Yeah, it builds with glibc just fine.  MUSL is another story...
> 
> It is also building on Alpine/musl.
> I would like to understand why.
> Do you have failure logs and versions?
> 


Have a look at:

https://github.com/k13132/openwrt-dpdk/pull/9#issuecomment-1556124647
  

Patch

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index fab3483d9f8108fafaff6d022cd41165d1ec5a61..fe83e1a04ec2e7a891425144be3e0aacecb24f09 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -2,6 +2,7 @@ 
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
+#include <unistd.h>
 #include <string.h>
 #include <fcntl.h>
 #include <linux/pci_regs.h>