On 9/24/2020 4:17 PM, Dmitry Kozlyuk wrote:
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: sta...@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dmitry.kozl...@gmail.com>
Reported-by: Khoa To <k...@microsoft.com>
Reported-by: Tal Shnaiderman <tal...@nvidia.com>
Acked-by: Pallavi Kadam <pallavi.ka...@intel.com
<mailto:pallavi.ka...@intel.com>>