Provide static library in libslirp-dev
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libslirp (Debian) |
New
|
Unknown
|
|||
libslirp (Ubuntu) |
Fix Released
|
Undecided
|
Athos Ribeiro | ||
Jammy |
Fix Committed
|
Wishlist
|
Unassigned |
Bug Description
[ Impact ]
* Due to a packaging miss there is no static lib of libslirp.
TBH uses of that are mostly for developer experiments as there
are often better options as outlined by mjt, but then static
builds are a valid use case and the fix here is trivial and
should have the lowest possible regression risk to other use cases.
[ Test Plan ]
# Dependencies
$ apt install libslirp-dev libglib2.0-dev pkg-config
# Using the most simple test of the lib I could think of
$ cat simpleslirp.c
#include <stdio.h>
#include <stdlib.h>
#include "libslirp.h"
int main(int argc, char *argv[]) {
printf("Slirp version %s\n", slirp_version_
}
# Build and run non-static
$ gcc simpleslirp.c $(pkg-config --libs slirp) $(pkg-config --cflags slirp) -o simpleslirp
$ ldd simpleslirp | grep slirp
libslirp.so.0 => /lib/x86_
$ ./simpleslirp
Slirp version 4.6.1
# Actual test - Build and run static
# Without fix
$ gcc simpleslirp.c $(pkg-config --libs slirp) $(pkg-config --cflags --static slirp) -static -o simpleslirp
/usr/bin/ld: cannot find -lslirp: No such file or directory
collect2: error: ld returned 1 exit status
# With fix
$ gcc simpleslirp.c $(pkg-config --libs slirp) $(pkg-config --cflags --static slirp) -static -o simpleslirp
$ ldd simpleslirp
not a dynamic executable
$ ./simpleslirp
Slirp version 4.6.1
[ Where problems could occur ]
* We provide an extra file for static linking, nothing on the
other use of that lib should change. TBH other than "suddenly on rebuild
something unexpected is odd" I can't think of a regression for
existing users this might cause.
[ Other Info ]
* n/a
---
QEMU static builds currently fail (among other reasons) because a static libslirp is missing from libslirp-dev, as is usual for other *-dev packages.
The instructions in https:/
It'd be best if a static library was just provided in every libslirp-dev package.
Related branches
- git-ubuntu bot: Approve
- Athos Ribeiro (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 35 lines (+11/-0)3 files modifieddebian/changelog (+7/-0)
debian/libslirp-dev.install (+1/-0)
debian/rules (+3/-0)
- git-ubuntu bot: Approve
- Sergio Durigan Junior (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 49 lines (+13/-1)4 files modifieddebian/changelog (+7/-0)
debian/control (+2/-1)
debian/libslirp-dev.install (+1/-0)
debian/rules (+3/-0)
tags: | added: server-triage-discuss |
tags: |
added: server-todo removed: server-triage-discuss |
Changed in libslirp (Ubuntu): | |
status: | Confirmed → Triaged |
Changed in libslirp (Ubuntu): | |
assignee: | nobody → Athos Ribeiro (athos-ribeiro) |
Changed in libslirp (Debian): | |
status: | Unknown → New |
Changed in libslirp (Ubuntu Jammy): | |
importance: | Undecided → Wishlist |
status: | New → Triaged |
description: | updated |
Status changed to 'Confirmed' because the bug affects multiple users.