mailing list of musl libc
 help / color / mirror / code / Atom feed
* Compiling openssl static with musl
@ 2014-11-06 18:30 Tim Tassonis
  2014-11-06 19:47 ` Szabolcs Nagy
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Tassonis @ 2014-11-06 18:30 UTC (permalink / raw)
  To: musl

Hi all

I just managed to compile an openssl (openssl-1.0.1i) static binary on
64 bit linux which works fine, it seems.

However, it was quite a PITA, as openssl always wanted to link against
-ldl and always ignored my "-static" whichever way i tried to provide it.

I only got successful after I patched openssl's Configure to add the
following line after line 363:

"linux-x86_64-musl", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3
-Wall::-D_REENTRANT::-static:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT
DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",

and then called

./Configure --prefix=$PFX --openssldir=/etc/ssl no-hw zlib no-engines
no-dso no-threads linux-x86_64-musl


Did I miss something or might this be something to document somewhere or
maybe even forward to the openssl people?

Kind regards
Tim


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Compiling openssl static with musl
  2014-11-06 18:30 Compiling openssl static with musl Tim Tassonis
@ 2014-11-06 19:47 ` Szabolcs Nagy
  0 siblings, 0 replies; 2+ messages in thread
From: Szabolcs Nagy @ 2014-11-06 19:47 UTC (permalink / raw)
  To: musl

* Tim Tassonis <stuff@decentral.ch> [2014-11-06 19:30:31 +0100]:
> 
> I just managed to compile an openssl (openssl-1.0.1i) static binary on
> 64 bit linux which works fine, it seems.
> 

good

> However, it was quite a PITA, as openssl always wanted to link against
> -ldl and always ignored my "-static" whichever way i tried to provide it.
> 

-ldl should not be a problem with musl
(it has an empty libdl.a)

> I only got successful after I patched openssl's Configure to add the
> following line after line 363:
> 
> "linux-x86_64-musl", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3
> -Wall::-D_REENTRANT::-static:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT
> DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
> 
> and then called
> 
> ./Configure --prefix=$PFX --openssldir=/etc/ssl no-hw zlib no-engines
> no-dso no-threads linux-x86_64-musl
> 

unfortunately you have to work around their build system

(for musl it would be enough if they used standard interfaces instead
of doing several layers of incorrect configurations and ifdefs)

> 
> Did I miss something or might this be something to document somewhere or
> maybe even forward to the openssl people?
> 

you should report openssl build system bugs to openssl, there are plenty
of open ones, eg you could bump these:

https://rt.openssl.org/Ticket/Display.html?id=2823&user=guest&pass=guest
https://rt.openssl.org/Ticket/Display.html?id=3526&user=guest&pass=guest


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-06 19:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-06 18:30 Compiling openssl static with musl Tim Tassonis
2014-11-06 19:47 ` Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).