Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade slirp due to newer versions of MSYS2 #262

Open
JosepMaJAZ opened this issue Jun 19, 2024 · 2 comments
Open

Upgrade slirp due to newer versions of MSYS2 #262

JosepMaJAZ opened this issue Jun 19, 2024 · 2 comments

Comments

@JosepMaJAZ
Copy link
Contributor

JosepMaJAZ commented Jun 19, 2024

This is kind of a bug as it seems that now under MSYS2 it is not possible to build with networking enabled.

The networking code on pcem is mostly based on SLiRP for NAT based networking, and on PCAP for independent IP networking.

The SLiRP code is very old and is not even written in ANSI C. Current version of MSYS2 ( mingw32, mingw64 and clang64 included), cannot build this code. (clang finds problems with the function declarations. gcc has problems specifically with the open, close, lseek methods)

The original slirp code is here: https://slirp.sourceforge.net/ , and mirrored here: https://github.com/kost/slirp
There exist a more up-to-date fork from the QEMU devs, here: https://gitlab.freedesktop.org/slirp , https://gitlab.freedesktop.org/slirp/libslirp/-/releases

It seems that we need to move to libslirp in some way (although I am not 100% sure it will work without changes under MSYS2).

@JosepMaJAZ JosepMaJAZ changed the title Upgrade slirp Upgrade slirp due to newer versions of MSYS2 Jun 19, 2024
@roybaer
Copy link

roybaer commented Jun 25, 2024

Technically, it is perfectly valid ANSI C code, but function declarations in K&R style, already a deprecated feature in C89-C17, were finally removed in C23.
As a stop-gap solution, you could let the compiler know that it is processing old code.
A simple -std=c17 should be sufficient.

@JosepMaJAZ
Copy link
Contributor Author

I took that route for now.
Yet, I had to use --std=gnu17 instead of c17, because the code uses some "asm" GNU extensions.
( With SSE instructions, it is better to use intrinsics, but it isn't the case here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants