Package: libc6-dev
Severity: normal
Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
Programs can't be statically linked against OpenSSL in Debian Stretch.
* What exactly did you do (or not do) that was effective (or
ineffective)?
Try to compile this program with this command:
gcc -static hello.c -lssl -lcrypto -ldl -pthread
#include <stdio.h>
#include <stdlib.h>
#include <openssl/ssl.h>
int main(void)
{
OpenSSL_add_ssl_algorithms();
printf("Hello World!\n");
return 0;
}
* What was the outcome of this action?
If you run the statically linked program, you get a crash in glibc startup code:
#0 0x0000000000000000 in ?? ()
#1 0x00000000006296c6 in __register_frame_info.part.4 ()
#2 0x00000000004017fd in frame_dummy ()
#3 0x000000000058c2d7 in __libc_csu_init ()
#4 0x000000000058b95b in generic_start_main ()
#5 0x000000000058bc3e in __libc_start_main ()
#6 0x000000000040172a in _start ()
* What outcome did you expect instead?
The compiled program should work.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 70:27:58 |
Calls: | 6,656 |
Calls today: | 2 |
Files: | 12,200 |
Messages: | 5,332,151 |
Posted today: | 1 |