tinyproxy und der cross compiler

mathisdt

Neuer User
Mitglied seit
29 Jan 2006
Beiträge
39
Punkte für Reaktionen
0
Punkte
0
Juhu! Busybox ist gebaut. :)

Jetzt wollte ich tinyproxy 1.7.0 konfigurieren und bin streng nach Tutorial vorgegangen. Fehler:
Code:
checking whether the system's regex library is broken... yes
configure: error: Your system's regexec() function is broken.
bei tinyproxy 1.6.3 geht das besser, da kommt die Meldung
Code:
checking whether the system's regex library is broken... yes
configure: Using the included GNU regex instead.
und alles geht zu kompilieren.

Meine Frage (vor allem an olistudent, der 1.7.0 gebaut bekommen hat): was muss ich tun, um diesen Fehler zu umgehen?
 
Da kann ich dir jetzt gar nicht sagen was ich gemacht hab. Wahrscheinlich hab ich das exit im configure-Skript an dieser Stelle auskommentiert.

MfG Oliver
 
mathisdt schrieb:
Code:
checking whether the system's regex library is broken... yes
configure: error: Your system's regexec() function is broken.

merkwürdiger weise verhält sich das configure script sehr defensiv:
Code:
  if test "$cross_compiling" = yes; then
  tinyproxy_cv_regex_broken=yes

daher übergebe ein "tinyproxy_cv_regex_broken=no" und es lässt sich configuren.
;)
 
Eine Odyssee zum verzweifeln, ähh zum TinyProxy kompilieren.

Das letzte Binary, welches ich im Forum gefunden habe, war leider ohne REVERSE_SUPPORT. Also wollte ich 1.8.2 selbst kompilieren und befolge die Anleitung.
"Natürlich" schlägt das fehl, denn ich hatte ja das vergessen (man beachte das letzte Kommentar).
"Natürlich" schlägt es immer noch fehl, denn ich hatte ja das vergessen. Damit funktioniert es "logischerweise" immer noch nicht, denn es wird Wissenstransfer verlangt, dass dasselbe noch für ac_cv_func_realloc_0_nonnull durchzuführen ist.

Am Ende gibt's kein ermunterndes "You did it!", sondern nur das im Verzeichnis X und Y nicht viel zu tun ist. Aha. Dass das tinyproxy-Binary im src-Verzeichnis liegt, sagt das Skript "natürlich" nicht. Aber wer den Quatsch davor hinbekommt, der weiß sowas längst...
Leider funktioniert dieses Binary immer noch nicht. Warum? "file src/tinyproxy" sagt es handelt sich um ein i386-Binary! :mad: Fehler lag darin, dass Freetz-Download und "make menuconfig" noch keine Toolchain erstellt, sondern man erst "make precompiled" aufrufen muss (siehe hier, Abschnitt "Es dürfte allgemein bekannt sein..."). Ein nicht vorhandener, aber angegebener Compiler wird also einfach ignoriert.

Nun erstellt make endlich ein MIPS-Binary. Aber dieses ist trotzdem noch dynamisch gelinkt (libresolv.so.0 müsste man dann dazu packen). Es ist ein weiterer Fehler im configure-Skript, der die Umgebungsvariable überschreibt, statt zu ergänzen. Also im Skript noch den fetten Teil hinzufügen: LDFLAGS="-Wl,-z,defs $LDFLAGS"

Jetzt ist es Zeit für <Klick> :crazy:

---

Wem das alles zu schwierig ist, der nutzt einfach Freetz: "make menuconfig", PP<Enter>T<Enter>, [*] Tinyproxy, [*] Enable reverse, [*] Build statically und raus. "make tinyproxy-precompiled".
 
Zuletzt bearbeitet:
Puh, ist der Thread aber alt, und dann auch noch vom Thema "nice" ;-)

Zum Thema: Der letzte Satz besagt, dass freetz kein statisches Programm gebaut hat, oder dass du nicht weißt, warum es zuvor nicht geklappt hat??
 
Zuletzt bearbeitet:
Es gibt die (inzwischen etwas veraltete) Version 1.7.0 hier zum Download. Vielleicht hilft sie Dir, auch wenn sie noch für DS-MOD gebaut wurde. Auf jeden Fall ist dort Reverse-Support einkompiliert.

Gruß, Mathis
 
Hab es gerade mal versucht, bei mir hat es gebaut (alles ausgewählt und dann "make tinyproxy-precompiled") :
Code:
joerg@joerg-desktop:~/freetz-trunk-new$ 
joerg@joerg-desktop:~/freetz-trunk-new$ PATH=$PATH:~/freetz-trunk-new/toolchain/build/mipsel_gcc-4.4.5_uClibc-0.9.29/mipsel-linux-uclibc/bin
joerg@joerg-desktop:~/freetz-trunk-new$ mipsel-linux-ldd packages/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/root/usr/sbin/tinyproxy	not a dynamic executable
joerg@joerg-desktop:~/freetz-trunk-new$ scp packages/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/root/usr/sbin/tinyproxy [email protected]:/tmp
[email protected]'s password: 
tinyproxy                                                                                                                                                     100%  208KB 207.6KB/s   00:00    
joerg@joerg-desktop:~/freetz-trunk-new$ ssh [email protected]
[email protected]'s password: 
   __  _   __  __ ___ __
  |__ |_) |__ |__  |   /
  |   |\  |__ |__  |  /_

   The fun has just begun ...


BusyBox v1.18.1 (2011-01-14 17:36:14 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

root@fritz:/var/mod/root# cd /tmp
root@fritz:/var/tmp# ./tinyproxy -h
Usage: tinyproxy [options]

Options are:
  -d        Do not daemonize (run in foreground).
  -c FILE   Use an alternate configuration file.
  -h        Display this usage information.
  -l        Display the license.
  -v        Display version information.

Features compiled in:
    XTinyproxy header
    Filtering
    Transparent proxy support
    Reverse proxy support
    Upstream proxy support

For bug reporting instructions, please see:
<https://www.banu.com/tinyproxy/>.
root@fritz:/var/tmp# 
root@fritz:/var/tmp# ./tinyproxy -v
tinyproxy 1.8.2
root@fritz:/var/tmp#

Jörg
 

Anhänge

  • tinyproxy.gz
    96.6 KB · Aufrufe: 36
Hey, vielen Dank für eure zahlreiche Hilfe. Ich hatte mich wohl etwas unklar ausgedrückt. Mit Freetz konnte ich problemlos ein statisches Binary erzeugen. Ich wollte aber die (immer noch groben) Details verstehen und im tinyproxy-Verzeichnis "make" aufrufen können - also nur die Freetz-Toolchain nutzen. Dann entsteht aber ein dynamisches Binary, welches noch eine libresolv benötigt. Das ging im IPPF schon vielen so. Eine Lösung hatte ich bisher nicht gefunden.

Außerdem sollte mein Beitrag mal die typische Linux-Anfänger-Situation beleuchten und an wieviel Stellen es noch zu schrauben gilt, bevor noch unbedarftere Anfänger als ich es bin, Linux nutzen können/wollen/sollen...
 
Zuletzt bearbeitet:
Also...
Im Prinzip musst du dafür sorgen, dass der letzte Aufruf vom Compiler (der eigentlich als "Linker" fungiert, und die Teile zusammenfügt), den Parameter "-static" mit drin hat. Meist reicht es, den Aufruf vom "make" so zu ergänzen, dass der Parameter in den "LDFLAGS" mit drin ist, also insgesamt ein:

make LDFLAGS="-static ...."

Manchmal kann man das auch schon dem "configure" mit übergeben, dann kann man neben dem Setzen des Compilers eben auch die Linker Flags mit setzen. Es hängt aber vom Programm und dem Makefile ab, ob und an welcher Stelle man das mit angeben kann....

"Zur Not" geht eigenlich immer folgendes, wenn das Programm nicht statisch gebaut wurde:
Den letzten Aufruf vom make kopieren und mit einem "-static" ergänzen. Oft fehlen dann am Ende noch die Library dl, also ans Ende noch ein "-ldl". Wenn man sich dazu das Tinyproxy mal ansieht, ist der letzte Aufruf (bei "make V=99"):
Code:
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ ~/freetz-trunk-new/toolchain/build/mipsel_gcc-4.4.5_uClibc-0.9.29/mipsel-linux-uclibc/bin/mipsel-linux-uclibc-gcc -DNDEBUG -Os -pipe -march=4kc -Wa,--trap -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fdiagnostics-show-option -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wfloat-equal -Wundef -Wformat=2 -Wlogical-op -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Waggregate-return -Winit-self -Wpacked --std=c89 -ansi -pedantic -Wc++-compat -Wno-long-long -Wno-overlength-strings -Wdeclaration-after-statement -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-qual -Wcast-align -Wwrite-strings -Wp,-D_FORTIFY_SOURCE=2 -fno-common  -Wl,-z,defs -o tinyproxy acl.o anonymous.o buffer.o child.o conf.o conns.o daemon.o hashmap.o heap.o html-error.o http-message.o log.o network.o reqs.o sock.o stats.o text.o main.o utils.o vector.o upstream.o connect-ports.o filter.o reverse-proxy.o transparent-proxy.o -lresolv -lnsl 
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ 
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ file tinyproxy 
tinyproxy: ELF 32-bit LSB executable, MIPS, MIPS32 version 1,[B] dynamically linked (uses shared libs)[/B], with unknown capability 0xf41 = 0x756e6700, not stripped
Wenn man jetzt das oben genannte anwendet und "-static" hinzufügt, funktioniert das tatsächlich ;-)
Code:
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ 
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ ~/freetz-trunk-new/toolchain/build/mipsel_gcc-4.4.5_uClibc-0.9.29/mipsel-linux-uclibc/bin/mipsel-linux-uclibc-gcc [B]-static[/B] -DNDEBUG -Os -pipe -march=4kc -Wa,--trap -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fdiagnostics-show-option -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wfloat-equal -Wundef -Wformat=2 -Wlogical-op -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Waggregate-return -Winit-self -Wpacked --std=c89 -ansi -pedantic -Wc++-compat -Wno-long-long -Wno-overlength-strings -Wdeclaration-after-statement -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-qual -Wcast-align -Wwrite-strings -Wp,-D_FORTIFY_SOURCE=2 -fno-common  -Wl,-z,defs -o tinyproxy acl.o anonymous.o buffer.o child.o conf.o conns.o daemon.o hashmap.o heap.o html-error.o http-message.o log.o network.o reqs.o sock.o stats.o text.o main.o utils.o vector.o upstream.o connect-ports.o filter.o reverse-proxy.o transparent-proxy.o -lresolv -lnsl [B]-ldl[/B]
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ file tinyproxy 
tinyproxy: ELF 32-bit LSB executable, MIPS, MIPS32 version 1,[B] statically linked[/B], with unknown capability 0xf41 = 0x756e6700, not stripped
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$

Jörg
 
Danke für die Infos. Das probiere ich heute Abend mal. Aber wäre eine saubere Lösung nicht die Anpassung des Makefile (da anscheinend "make LDFLAGS="-static ...."" nicht funktioniert, sonst hätte ich configure.ac gesagt)?
 
Also ganz konkret beim Tinyproxy sollten die LDFLAGS aber funktionieren:
Code:
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ rm tinyproxy 
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ make
  CCLD   tinyproxy
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ file tinyproxy 
tinyproxy: ELF 32-bit LSB executable, MIPS, MIPS32 version 1,[B] dynamically linked (uses shared libs)[/B], with unknown capability 0xf41 = 0x756e6700, not stripped
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ rm tinyproxy 
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ make LDFLAGS="-static"
  CCLD   tinyproxy
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$ file tinyproxy 
tinyproxy: ELF 32-bit LSB executable, MIPS, MIPS32 version 1, [B]statically linked[/B], with unknown capability 0xf41 = 0x756e6700, not stripped
joerg@joerg-desktop:~/freetz-trunk-new/source/target-mipsel_uClibc-0.9.29/tinyproxy-1.8.2/src$

Jörg
 
Wenn das make-File doch den Parameter beachtet, dann musste es ja doch am configure-Teil liegen. Habs eben noch probiert und meine obige Odyssee hat nun endlich ihr Ende gefunden. Vielen Dank für deine Hilfe Jörg! mathisdt könnte jetzt ein [gelöst] in den Threadtitel einbauen.

An alle libresolv.so.0 SuFu-Nutzer: die Lösung steht in #4!
 
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.