Ich habe versucht, eine statisch verknüpfte Version von vips zu erstellen, konnte dies aber nicht. Ist es möglich, einen statisch verknüpften vips-Befehl zu erstellen?Statisch verknüpfte vips (libvips) binär
Die Plattform, auf der ich kompiliere, ist Ubuntu 16.04.
Der Befehl make Ich betreiben:
make LDFLAGS=-all-static
ich nicht konfigurieren, dass Python oder imagemagick zu verwenden, (die Show "no" in der Config-Ausgabe). Der Fehler Ich erhalte ist:
/usr/bin/ld: cannot find -lgdk_pixbuf-2.0
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libgio-2.0.a(libgio_2_0_la-glocalfileinfo.o): In function `lookup_gid_name':
(.text+0x11d7): warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libgio-2.0.a(libgio_2_0_la-glocalvfs.o): In function `g_local_vfs_parse_name':
(.text+0x1cd): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libglib-2.0.a(libglib_2_0_la-gutils.o): In function `g_get_user_database_entry':
(.text+0x249): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libglib-2.0.a(libglib_2_0_la-gutils.o): In function `g_get_user_database_entry':
(.text+0xcf): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libgio-2.0.a(libgio_2_0_la-glocalfileinfo.o): In function `lookup_uid_data':
(.text+0x1054): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libxml2.a(nanohttp.o): In function `xmlNanoHTTPConnectHost':
(.text+0x924): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libxml2.a(nanohttp.o): In function `xmlNanoHTTPConnectHost':
(.text+0x9f4): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libgio-2.0.a(libgio_2_0_la-gnetworkaddress.o): In function `g_network_address_parse':
(.text+0xc39): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libgio-2.0.a(libgio_2_0_la-gnetworkaddress.o): In function `g_network_address_parse':
(.text+0xc4e): warning: Using 'endservent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: error: ld returned 1 exit status
Makefile:597: recipe for target 'vips' failed
make[2]: *** [vips] Error 1
make[2]: Leaving directory '/usr/local/src/vips-8.4.1/tools'
Makefile:631: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/usr/local/src/vips-8.4.1'
Makefile:536: recipe for target 'all' failed
make: *** [all] Error 2
Von dem, was ich gefunden habe auf, zum Beispiel hier: Create statically-linked binary that uses getaddrinfo? ist, dass dies ein Problem mit libnss. Aber in der ./configure --help Ausgabe gibt es kein --enable-static-Flag. Trotzdem habe ich das versucht und es hat mein Problem nicht gelöst.
Die Bibliotheken Ich Verknüpfung mit (nach dem Config-Ausgang, habe ich es abgeschnitten): Gibt es
build radiance support: yes
build analyze support: yes
build PPM support: yes
use fftw3 for FFT: yes
accelerate loops with orc: yes
ICC profile support with lcms: yes (lcms2)
SVG import with librsvg-2.0: yes
zlib: yes
file import/export with libwebp: yes
file import/export with libpng: yes (pkg-config libpng >= 1.2.9)
file import/export with libtiff: yes (pkg-config libtiff-4)
file import/export with giflib: yes (found by search)
file import/export with libjpeg: yes
use libexif to load/save JPEG metadata: yes
eine bestimmte Bibliothek Ich bin gegen die Verknüpfung, dass das Problem verursacht?
Ich hatte gehofft, es in einem minimalistischen Docker Container zu verwenden, der auch statische Versionen von ffmpeg und ffprobe hat. Ich glaube, ich war mir nicht sicher, warum ein Bildkonvertierungsprogramm Aufrufe wie getservbyname benötigt, also hoffte ich, dass es eine Abhängigkeit gab, die ich fallen lassen konnte. – SjB
vips verwendet glib, um die Portabilität zu verbessern, und glib hat eine Menge Zeug. Sie könnten versuchen, Ihre eigene glib mit einigen entfernten Dingen zu machen, könnte es helfen. Ich denke, die statische binäre ^^^^ würde in jeder 16.04-Installation funktionieren, was etwas ist, aber es würde wahrscheinlich nicht auf einer sehr minimalen Linux-Installation funktionieren. OpenWRT hat ein libvips-Paket und das ist sehr minimal, vielleicht könntest du das anpassen? – user894763
Ich denke, mit etwas wie DiätLibc könnte funktionieren, aber noch keine Chance gehabt, noch einmal zu besuchen. – SjB