Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static binary? #203

Open
inztar opened this issue Oct 2, 2018 · 5 comments
Open

Static binary? #203

inztar opened this issue Oct 2, 2018 · 5 comments

Comments

@inztar
Copy link
Contributor

inztar commented Oct 2, 2018

Hi!

I can compile sslh in static file?

@yrutschle
Copy link
Owner

yrutschle commented Oct 4, 2018 via email

@LM1LC3N7
Copy link

LM1LC3N7 commented Mar 25, 2019

Static binary will generate a kind of portable application, that can run into a distroless docker image.
It will be great 😄

This should work (source)?

-static-libgcc -static-libstdc++ 

@inztar
Copy link
Contributor Author

inztar commented Apr 6, 2019

I could not get to link libpcreposix.

...
cc -static -static-libgcc -Wall -g  -DENABLE_REGEX -DLIBPCRE -DLIBCONFIG -c argtable3.c
cc -static -static-libgcc -Wall -g  -DENABLE_REGEX -DLIBPCRE -DLIBCONFIG -c sslh-select.c
cc -static -static-libgcc -Wall -g   -o sslh-select sslh-select.o sslh-conf.o common.o sslh-main.o probe.o tls.o argtable3.o  -lpcreposix -lconfig
/usr/bin/ld: common.o: in function `drop_privileges':
/home/itn/Dev/github/inztar/sslh/common.c:767: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: common.o: in function `resolve_split_name':
/home/itn/Dev/github/inztar/sslh/common.c:517: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libpcreposix.a(libpcreposix_la-pcreposix.o): in function `pcreposix_regfree':
(.text+0xf5): undefined reference to `pcre_free'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libpcreposix.a(libpcreposix_la-pcreposix.o): in function `pcreposix_regcomp':
(.text+0x174): undefined reference to `pcre_compile2'
/usr/bin/ld: (.text+0x199): undefined reference to `pcre_fullinfo'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/libpcreposix.a(libpcreposix_la-pcreposix.o): in function `pcreposix_regexec':
(.text+0x323): undefined reference to `pcre_exec'
collect2: error: ld returned 1 exit status

I don't know how to tie them.

@LM1LC3N7
Copy link

LM1LC3N7 commented Apr 7, 2019

And did you try this?

https://stackoverflow.com/q/6509834

@ffontaine
Copy link
Contributor

Should be fixed by #280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants