[dpdk-dev] [dpdk-stable] [EXTERNAL] [PATCH] eal/windows: use bundled getopt with MinGW

Thomas Monjalon thomas at monjalon.net
Mon Oct 5 09:23:48 CEST 2020


> > Clang builds use getopt.c in librte_eal while MinGW provides
> > implementation as part of the toolchain. Statically linking librte_eal
> > to an application that depends on getopt results in undefined reference
> > errors with MinGW. There are no such errors with Clang, because with
> > Clang librte_eal actually defines getopt functions.
> > 
> > Use getopt.c in EAL with Clang and MinGW to get identical behavior.
> > Adjust code for MinGW. Incidentally, this removes a bug when free() is
> > called on uninitialized memory.
> > 
> > Fixes: 5e373e456e6 ("eal/windows: add getopt implementation")
> > Cc: stable at dpdk.org
> > 
> > Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
> > Reported-by: Khoa To <khot at microsoft.com>
> > Reported-by: Tal Shnaiderman <talshn at nvidia.com>
> > ---
> > 
> > This patch probably supesedes
> > https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatch
> > work.dpdk.org%2Fpatch%2F78574%2F&data=02%7C01%7Ckhot%40micr
> > osoft.com%7C7f6e47a7db0945b2c93708d860dffaa3%7C72f988bf86f141af91a
> > b2d7cd011db47%7C1%7C0%7C637365862839491238&sdata=%2BQPJ2US
> > hknxQLV97rQRVc0sT55TpTNjNTq1m9oj9eFs%3D&reserved=0.
> 
> Acked-by: Khoa To <khot at microsoft.com>

Applied, thanks




More information about the dev mailing list