From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla@dpdk.org Subject: [Bug 35] Does not compile with musl libc: drivers/bus/pci/linux/pci_uio.c Date: Thu, 03 May 2018 10:33:14 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable To: dev@dpdk.org Return-path: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" https://dpdk.org/tracker/show_bug.cgi?id=3D35 Bug ID: 35 Summary: Does not compile with musl libc: drivers/bus/pci/linux/pci_uio.c Product: DPDK Version: 18.05 Hardware: All OS: All Status: CONFIRMED Severity: normal Priority: Normal Component: ethdev Assignee: dev@dpdk.org Reporter: dpdk@stormmq.com Target Milestone: --- This does not compile on X86 because it assumes the presence of the glibc-o= nly functions `outl_p`, `outw_p` and `outb_p`. This can be fixed reliably for a= ll c libraries and operating systems by simply importing our own definitions, vi= z:- ``` #if defined(RTE_ARCH_X86) #include // Used in pci_uio_ioport_write, these functions are present in glibc // in (without the pci_uio_ prefix) but not in the // musl lib c. static __inline void pci_uio_outl_p(unsigned int value, unsigned short int port) { __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (value), "Nd" (port)); } static __inline void pci_uio_outw_p(unsigned short int value, unsigned short int port) { __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (value), "Nd" (port)); } static __inline void pci_uio_outb_p(unsigned char value, unsigned short int port) { __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value), "Nd" (port)); } ``` And then prefixing the usages of the glibc-only functions with `pci_uio_`, = eg `outl_p` becomes `pci_uio_outlw_p`. --=20 You are receiving this mail because: You are the assignee for the bug.=