[v3,00/15] Build fixes for musl libc
mbox series

Message ID 20190313170657.16688-1-ncopa@alpinelinux.org
Headers show
Series
  • Build fixes for musl libc
Related show

Message

Natanael Copa March 13, 2019, 5:06 p.m. UTC
A set of patches to fix build with musl libc. I also did a few cleanups wrt
macros and fixed a few scary compiler warnings while at it.

Please note that those are only compile tested on x86_64 with musl libc.

v2 has some code style fixes reported by checkpatch
v3 is a full reroll of the entire patch set to enable automatted tests
   and logic for patchwork patchset.

Natanael Copa (15):
  app/testpmd: replace uint with unsigned int
  net/cxgbe: replace uint with unsigned int
  bus/pci: add fallback for out[lwb]_p for non GNU libc
  bus/pci: factor out various ifdefs in pci_uio_ioport_{read,write}
  bus/fslmc: fix compile error with musl libc
  bus/fslmc: remove unused include of error.h
  net/nfp: build fix for musl libc
  app/test: include fcntl.h due to use of O_RDONLY
  app/test: fix setting of -D_GNU_SOURCE with meson
  bus/dpaa: use warn(3) instead of error(3) to improve portability
  bus/dpaa: fix warning: "__WORDSIZE" is not defined, evaluates to 0
  crypto/dpaa2_sec: build fix for musl libc
  crypto/dpaa2_sec: simplify pr_{debug,err,warn} macros
  net/netvsc: fix compile warning for fcntl.h include
  eal/linux: simplify debug message in sigbus_handler

 app/test-pmd/testpmd.h                     |  2 +-
 app/test/meson.build                       |  2 +-
 app/test/test_eal_flags.c                  |  1 +
 drivers/bus/dpaa/base/fman/netcfg_layer.c  |  4 +-
 drivers/bus/dpaa/base/qbman/bman_driver.c  |  6 +-
 drivers/bus/dpaa/base/qbman/qman_driver.c  | 12 ++--
 drivers/bus/dpaa/include/compat.h          |  2 +-
 drivers/bus/dpaa/include/fsl_qman.h        |  3 +-
 drivers/bus/fslmc/qbman/include/compat.h   |  2 +-
 drivers/bus/pci/linux/pci_uio.c            | 82 ++++++++++++++--------
 drivers/crypto/dpaa2_sec/hw/compat.h       | 36 +++++-----
 drivers/net/cxgbe/base/common.h            | 18 ++---
 drivers/net/netvsc/hn_vf.c                 |  2 +-
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c |  2 +
 lib/librte_eal/linux/eal/eal_dev.c         |  4 +-
 15 files changed, 99 insertions(+), 79 deletions(-)

Comments

Andrius Sirvys March 14, 2019, 5:09 p.m. UTC | #1
When I try building I'm still getting this error

/root/dpdk/app/test-pmd/bpf_cmd.c:23:11: error: initialization discards 
'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
     .val = &stdout,

On 13/03/2019 17:06, Natanael Copa wrote:
> A set of patches to fix build with musl libc. I also did a few cleanups wrt
> macros and fixed a few scary compiler warnings while at it.
>
> Please note that those are only compile tested on x86_64 with musl libc.
>
> v2 has some code style fixes reported by checkpatch
> v3 is a full reroll of the entire patch set to enable automatted tests
>     and logic for patchwork patchset.
>
> Natanael Copa (15):
>    app/testpmd: replace uint with unsigned int
>    net/cxgbe: replace uint with unsigned int
>    bus/pci: add fallback for out[lwb]_p for non GNU libc
>    bus/pci: factor out various ifdefs in pci_uio_ioport_{read,write}
>    bus/fslmc: fix compile error with musl libc
>    bus/fslmc: remove unused include of error.h
>    net/nfp: build fix for musl libc
>    app/test: include fcntl.h due to use of O_RDONLY
>    app/test: fix setting of -D_GNU_SOURCE with meson
>    bus/dpaa: use warn(3) instead of error(3) to improve portability
>    bus/dpaa: fix warning: "__WORDSIZE" is not defined, evaluates to 0
>    crypto/dpaa2_sec: build fix for musl libc
>    crypto/dpaa2_sec: simplify pr_{debug,err,warn} macros
>    net/netvsc: fix compile warning for fcntl.h include
>    eal/linux: simplify debug message in sigbus_handler
>
>   app/test-pmd/testpmd.h                     |  2 +-
>   app/test/meson.build                       |  2 +-
>   app/test/test_eal_flags.c                  |  1 +
>   drivers/bus/dpaa/base/fman/netcfg_layer.c  |  4 +-
>   drivers/bus/dpaa/base/qbman/bman_driver.c  |  6 +-
>   drivers/bus/dpaa/base/qbman/qman_driver.c  | 12 ++--
>   drivers/bus/dpaa/include/compat.h          |  2 +-
>   drivers/bus/dpaa/include/fsl_qman.h        |  3 +-
>   drivers/bus/fslmc/qbman/include/compat.h   |  2 +-
>   drivers/bus/pci/linux/pci_uio.c            | 82 ++++++++++++++--------
>   drivers/crypto/dpaa2_sec/hw/compat.h       | 36 +++++-----
>   drivers/net/cxgbe/base/common.h            | 18 ++---
>   drivers/net/netvsc/hn_vf.c                 |  2 +-
>   drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c |  2 +
>   lib/librte_eal/linux/eal/eal_dev.c         |  4 +-
>   15 files changed, 99 insertions(+), 79 deletions(-)
>
Thomas Monjalon March 30, 2019, 11:57 p.m. UTC | #2
13/03/2019 18:06, Natanael Copa:
> A set of patches to fix build with musl libc. I also did a few cleanups wrt
> macros and fixed a few scary compiler warnings while at it.
> 
> Please note that those are only compile tested on x86_64 with musl libc.
> 
> v2 has some code style fixes reported by checkpatch
> v3 is a full reroll of the entire patch set to enable automatted tests
>    and logic for patchwork patchset.
> 
> Natanael Copa (15):
>   app/testpmd: replace uint with unsigned int
>   net/cxgbe: replace uint with unsigned int
>   bus/pci: add fallback for out[lwb]_p for non GNU libc
>   bus/pci: factor out various ifdefs in pci_uio_ioport_{read,write}
>   bus/fslmc: fix compile error with musl libc
>   bus/fslmc: remove unused include of error.h
>   net/nfp: build fix for musl libc
>   app/test: include fcntl.h due to use of O_RDONLY
>   app/test: fix setting of -D_GNU_SOURCE with meson
>   bus/dpaa: use warn(3) instead of error(3) to improve portability
>   bus/dpaa: fix warning: "__WORDSIZE" is not defined, evaluates to 0
>   crypto/dpaa2_sec: build fix for musl libc
>   crypto/dpaa2_sec: simplify pr_{debug,err,warn} macros
>   net/netvsc: fix compile warning for fcntl.h include
>   eal/linux: simplify debug message in sigbus_handler

Thanks for the cleanup.

Some patches may deserve more reviews.
If you send a new version, please use --to-cmd devtools/get-maintainer.sh
so the maintainers will be Cc'ed.

All these patches are fixes and may be interesting to backport them
in the latest LTS or other stable releases.
In order to help with backporting, please fill "Fixes:" tag
and add Cc: stable when relevant.
The exact recommendation is described in this doc chapter:
http://doc.dpdk.org/guides/contributing/patches.html#commit-messages-body

In order to help, I already fixed 7 commit messages and merged them.
The remaining patches, requiring a v4, are:
  app/testpmd: replace uint with unsigned int
  net/cxgbe: replace uint with unsigned int
  bus/pci: add fallback for out[lwb]_p for non GNU libc
  bus/pci: factor out various ifdefs in pci_uio_ioport_{read,write}
  bus/dpaa: use warn(3) instead of error(3) to improve portability
  bus/dpaa: fix warning: "__WORDSIZE" is not defined, evaluates to 0
  crypto/dpaa2_sec: build fix for musl libc
  crypto/dpaa2_sec: simplify pr_{debug,err,warn} macros
David Marchand July 5, 2019, 8:03 a.m. UTC | #3
On Sun, Mar 31, 2019 at 12:57 AM Thomas Monjalon <thomas@monjalon.net>
wrote:

> 13/03/2019 18:06, Natanael Copa:
> > A set of patches to fix build with musl libc. I also did a few cleanups
> wrt
> > macros and fixed a few scary compiler warnings while at it.
> >
> > Please note that those are only compile tested on x86_64 with musl libc.
> >
> > v2 has some code style fixes reported by checkpatch
> > v3 is a full reroll of the entire patch set to enable automatted tests
> >    and logic for patchwork patchset.
> >
> > Natanael Copa (15):
> >   app/testpmd: replace uint with unsigned int
> >   net/cxgbe: replace uint with unsigned int
> >   bus/pci: add fallback for out[lwb]_p for non GNU libc
> >   bus/pci: factor out various ifdefs in pci_uio_ioport_{read,write}
> >   bus/fslmc: fix compile error with musl libc
> >   bus/fslmc: remove unused include of error.h
> >   net/nfp: build fix for musl libc
> >   app/test: include fcntl.h due to use of O_RDONLY
> >   app/test: fix setting of -D_GNU_SOURCE with meson
> >   bus/dpaa: use warn(3) instead of error(3) to improve portability
> >   bus/dpaa: fix warning: "__WORDSIZE" is not defined, evaluates to 0
> >   crypto/dpaa2_sec: build fix for musl libc
> >   crypto/dpaa2_sec: simplify pr_{debug,err,warn} macros
> >   net/netvsc: fix compile warning for fcntl.h include
> >   eal/linux: simplify debug message in sigbus_handler
>
> Thanks for the cleanup.
>
> Some patches may deserve more reviews.
> If you send a new version, please use --to-cmd devtools/get-maintainer.sh
> so the maintainers will be Cc'ed.
>
> All these patches are fixes and may be interesting to backport them
> in the latest LTS or other stable releases.
> In order to help with backporting, please fill "Fixes:" tag
> and add Cc: stable when relevant.
> The exact recommendation is described in this doc chapter:
> http://doc.dpdk.org/guides/contributing/patches.html#commit-messages-body
>
> In order to help, I already fixed 7 commit messages and merged them.
> The remaining patches, requiring a v4, are:
>   app/testpmd: replace uint with unsigned int
>   net/cxgbe: replace uint with unsigned int
>   bus/pci: add fallback for out[lwb]_p for non GNU libc
>   bus/pci: factor out various ifdefs in pci_uio_ioport_{read,write}
>   bus/dpaa: use warn(3) instead of error(3) to improve portability
>   bus/dpaa: fix warning: "__WORDSIZE" is not defined, evaluates to 0
>   crypto/dpaa2_sec: build fix for musl libc
>   crypto/dpaa2_sec: simplify pr_{debug,err,warn} macros
>


If you intend to send a v4, I noticed a few more "uint" in the tree, I
suppose this is worth fixing them:
$ git grep -w uint
app/test-pmd/config.c:                   uint hash_key_len)
examples/tep_termination/vxlan.c:       uint vport_id;
Natanael Copa Nov. 5, 2020, 9:17 p.m. UTC | #4
A set of patches to fix build with musl libc. I also did a few cleanups wrt
macros and fixed a few scary compiler warnings while at it.

Please note that those are only compile tested on x86_64 with musl libc.

v2 has some code style fixes reported by checkpatch

v3 is a full reroll of the entire patch set to enable automatted tests
   and logic for patchwork patchset.

v4 rebase against main and deal with renames/moves.
   fix commit messages to make check-git-log.sh happy.
   improve error(3) -> warn(3) patch and clarify commit message.
   update __WORDSIZE patch to use RTE_ARCH_64
   add "Fixes:" tags
   add a couple of patches fro eal

Sorry that it took so long time to follow up.

Natanael Copa (8):
  app/testpmd: fix uint build error with musl libc
  net/cxgbe: fix uint build error with musl libc
  bus/pci: add fallback for out* for non GNU libc
  bus/dpaa: use warn instead of error to improve portability
  bus/dpaa: fix detection of 64 bit arch
  common/dpaax: build fix for musl libc
  common/dpaax: simplify pr debug/err/warn macros
  eal: add missing include to fix build with musl libc

 app/test-pmd/config.c                     |  2 +-
 app/test-pmd/testpmd.h                    |  2 +-
 drivers/bus/dpaa/base/fman/netcfg_layer.c |  4 +-
 drivers/bus/dpaa/base/qbman/bman_driver.c | 12 ++-
 drivers/bus/dpaa/base/qbman/qman_driver.c | 15 ++--
 drivers/bus/dpaa/include/fsl_qman.h       |  2 +-
 drivers/bus/pci/linux/pci_uio.c           | 95 +++++++++++++++--------
 drivers/common/dpaax/caamflib/compat.h    | 36 ++++-----
 drivers/net/cxgbe/base/common.h           | 18 ++---
 lib/librte_eal/unix/eal_file.c            |  1 +
 10 files changed, 113 insertions(+), 74 deletions(-)

--
2.29.2
Thomas Monjalon Nov. 6, 2020, 10:11 a.m. UTC | #5
05/11/2020 22:17, Natanael Copa:
> v4 rebase against main and deal with renames/moves.
>    fix commit messages to make check-git-log.sh happy.
>    improve error(3) -> warn(3) patch and clarify commit message.
>    update __WORDSIZE patch to use RTE_ARCH_64
>    add "Fixes:" tags
>    add a couple of patches fro eal
> 
> Sorry that it took so long time to follow up.

No problem, that's very good to receive these fixes. Thanks
David Marchand Nov. 6, 2020, 10:44 a.m. UTC | #6
Hello Natanael,

On Thu, Nov 5, 2020 at 10:17 PM Natanael Copa <ncopa@alpinelinux.org> wrote:
>
> A set of patches to fix build with musl libc. I also did a few cleanups wrt
> macros and fixed a few scary compiler warnings while at it.
>
> Please note that those are only compile tested on x86_64 with musl libc.
>
> v2 has some code style fixes reported by checkpatch
>
> v3 is a full reroll of the entire patch set to enable automatted tests
>    and logic for patchwork patchset.
>
> v4 rebase against main and deal with renames/moves.
>    fix commit messages to make check-git-log.sh happy.
>    improve error(3) -> warn(3) patch and clarify commit message.
>    update __WORDSIZE patch to use RTE_ARCH_64
>    add "Fixes:" tags
>    add a couple of patches fro eal
>
> Sorry that it took so long time to follow up.
>
> Natanael Copa (8):
>   app/testpmd: fix uint build error with musl libc
>   net/cxgbe: fix uint build error with musl libc
>   bus/pci: add fallback for out* for non GNU libc
>   bus/dpaa: use warn instead of error to improve portability
>   bus/dpaa: fix detection of 64 bit arch
>   common/dpaax: build fix for musl libc
>   common/dpaax: simplify pr debug/err/warn macros
>   eal: add missing include to fix build with musl libc

- I suppose you got the mails with the build errors from the robot.
Build is broken in dpaa (missing a few <err.h> includes).
https://travis-ci.com/github/ovsrobot/dpdk/jobs/429242867#L1005

- I still see a uint use in drivers/net/igc.
How about:

diff --git a/drivers/net/igc/igc_flow.c b/drivers/net/igc/igc_flow.c
index 1bb64d323c..66053060af 100644
--- a/drivers/net/igc/igc_flow.c
+++ b/drivers/net/igc/igc_flow.c
@@ -656,7 +656,7 @@ igc_parse_action_rss(struct rte_eth_dev *dev,
  * Return the pointer of the flow, or NULL for failed
  **/
 static inline struct rte_flow *
-igc_alloc_flow(const void *filter, enum igc_filter_type type, uint inbytes)
+igc_alloc_flow(const void *filter, enum igc_filter_type type, size_t inbytes)
 {
        /* allocate memory, 8 bytes boundary aligned */
        struct rte_flow *flow = rte_malloc("igc flow filter",