Ok first two commands I get the same output like you.<br><br>The third:<br><br>gcc -m32 -Wl,--build-id=none -nostdlib -nostartfiles -L/usr/lib/<br>
-lcrypto -lssl -static -print-file-name=libcrypto.a<br><br>/usr/bin/ld: no input files<br>collect2: ld returned 1 exit status<br><br><br>The objdump returns elf32-i386 for all<br><br><br>René<br><br><br><div class="gmail_quote">
2009/7/28 Carl-Daniel Hailfinger <span dir="ltr"><<a href="mailto:c-d.hailfinger.devel.2006@gmx.net">c-d.hailfinger.devel.2006@gmx.net</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On 28.07.2009 12:05, René Reuter wrote:<br>
> I've changed that path already, tried every possibility. I even asked the<br>
> gcc guys if they now any possibility how i could provide the lib, but it<br>
> always crashes.<br>
><br>
<br>
</div>(Any commands you have to run are preceded by a #)<br>
<br>
It doesn't crash, it just throws an undefined reference error. Looking<br>
at the undefined reference error, it complains EVP_sha256 is missing.<br>
Next question is why that symbol is missing although you had -lcrypto in<br>
the command line. Run the following command:<br>
# grep -l EVP_sha256 /usr/lib/libcrypto*<br>
<br>
Expected output is:<br>
/usr/lib/libcrypto.a<br>
/usr/lib/libcrypto.so<br>
/usr/lib/libcrypto.so.0.9.8<br>
If /usr/lib/libcrypto.a is missing, it can't work (unless you're on<br>
Debian/Ubuntu with that strange lib layout, and if that is the case,<br>
please complain). Now run<br>
# objdump -a /usr/lib/libcrypto.a|grep format<br>
<br>
Expected output is:<br>
cryptlib.o:     file format elf32-i386<br>
mem.o:     file format elf32-i386<br>
mem_clr.o:     file format elf32-i386<br>
mem_dbg.o:     file format elf32-i386<br>
cversion.o:     file format elf32-i386<br>
ex_data.o:     file format elf32-i386<br>
[...]<br>
If the output differs (maybe showing "file format elf64-x86-64"), it<br>
can't work. Now run<br>
#gcc -m32 -Wl,--build-id=none -nostdlib -nostartfiles -L/usr/lib/<br>
-lcrypto -lssl -static -print-file-name=libcrypto.a<br>
<br>
Expected output is:<br>
/usr/lib/gcc/i586-suse-linux/4.2.1/../../../libcrypto.a<br>
Run the objdump command from above for the file listed in the gcc<br>
output. If the file format is not elf32-i386, it can't work.<br>
<br>
<br>
And now the prize question: How did I arrive at the diagnosis above:<br>
Simple. If the linker can't find some symbols, it means the required<br>
library is not where gcc expects it. Three possible reasons for that:<br>
1. wrong library path<br>
2. wrong library type (dynamic instead of static)<br>
3. wrong architecture (x86_64 instead of i386)<br>
Next, I opened the man page for gcc and searched for nostdlib. First hit<br>
explains how to print the file name for any library you want gcc to use.<br>
If that library does not match what gcc needs for linking your specific<br>
project, gcc will  complain during linking.<br>
<div><div></div><div class="h5"><br>
Regards,<br>
Carl-Daniel<br>
<br>
--<br>
<a href="http://www.hailfinger.org/" target="_blank">http://www.hailfinger.org/</a><br>
<br>
</div></div></blockquote></div><br>