Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

If I wanted to build the openssl binary from source code, which free compiler is used nowadays for such things?

4 views
Skip to first unread message

Arlen Holder

unread,
Apr 26, 2020, 4:37:37 PM4/26/20
to
If I wanted to build the openssl binary from source code...
o <https://www.openssl.org/source/> which is currently 1.1.1g:
o <https://www.openssl.org/source/openssl-1.1.1g.tar.gz>
Which free compiler is used nowadays for such things?

It was clearly suggested in this thread just now to compile it myself:
o Which openssl Windows binary do you recommend (to have the latest official version)?
<https://groups.google.com/forum/#!topic/alt.comp.freeware/mZgki-TvHlo>

Bear in mind I haven't compiled from src in a decade.
o But also bear in mind I like to write general purpose tutorials.

So maybe it would be useful to write up a general purpose tutorial to walk
a noob through the steps of compiling that specific src code on Windows.

For starters, the general purpose tutorial would assume the basics:
a. Native Windows 10
b. Canonical freeware

Rest assured I've _tried_ to compile in the past decades a few times,
where, oh, about 50% or 75% of the time it fails miserably.

Often with errors so cryptic that you just want to cry reading them.
Usually because some dependency was assumed that simply doesn't exist.

Anyway, I'm willing to try compiling openssl from source, where the first
question to ask those who actually do compile every once in a while, is
what freeware compiler is the canonical choice nowadays for Windows 10?
--
The high price of freeware is in finding those solutions that work best.

Paul

unread,
Apr 26, 2020, 4:59:25 PM4/26/20
to
The first question you ask, is what did the designers intend ?

On Windows, there are two kinds of executables. If you use
Visual Studio, the EXE can be debugged with WinDBG. If you
use a gcc-based build environment, the executable can only
be debugged with "gdb" in the same kit. Both are loadable
by Windows, so the loading works OK.

Visual Studio builds, they profit from having certain
config files in the build directory. Some yahoos provide
VS tarballs but remove the important files that automate
the build (and then you know the author of the software
is jerking your chain, and there's NO WAY it will build).

Whereas one form of gcc material, may have a "./configure"
executable, that sniffs all the bits and prepares Makefiles.
(A Makefile being similar to the function that at least
some of the Visual Studio stuff provides.)

This means, a buildmeister might keep a fleet of compilers
and junk. For example, some builds will have "CMAKE" and
there's an invocation step involving CMAKE before anything
else. Those builds involve a single tree concept (when a company
like Adobe puts some of the build materials outside the tree,
you'll wanna smack somebody).

So rather than assuming "you're going shopping for N95 masks",
it's not really a shopping trip. The first part of the
exercise is "contemplation of what problem I'm solving".
How screwed up are the provided materials ? The answer
to that will tell you where to look for a compiler.

Of course you could read the INSTALL file in the build
tree (a common feature in FOSS), as well-written text descriptions
may tell you exactly what to do. For example, maybe I'd
find such a thing in Firefox, and the first thing it
would tell me is to discard that tarball, and use hg
or git or something, and pull down the software package
which is 50% larger. They put the weirdest information
in these files sometimes.

You have to be a detective, as much as a CS grad.

The stuff in the INSTALL file, is frequently a portion of
the text on the web page too.

Paul

Gary R. Schmidt

unread,
Apr 26, 2020, 11:04:06 PM4/26/20
to
On 27/04/2020 06:37, Arlen Holder wrote:
> If I wanted to build the openssl binary from source code...
> o <https://www.openssl.org/source/> which is currently 1.1.1g: o
> <https://www.openssl.org/source/openssl-1.1.1g.tar.gz>
> Which free compiler is used nowadays for such things?
>
It depends just why you are building the shared objects.

If it is for sole use on the one peecee (or just those at home), use the
free version of Visual Studio from MS.

If you are shipping the shared objects to customers, then pay for a copy
of Visual Studio.

If you are going to build all of your components from scratch, and are
capable of maintaining them in a convoluted environment, then the Ming-W
compiler, or GCC as included in Cygwin, may be a suitable choice.

Cheers,
Gary B-)

P.S. I've been a commercial software developer for close to forty
years, if I was building something for Windows that was not just for the
peecees at home I would buy the VS license.

--
Waiting for a new signature to suggest itself...

Arlen Holder

unread,
Apr 27, 2020, 1:44:02 AM4/27/20
to
In response to what "Gary R. Schmidt" <grsc...@acm.org> wrote :

> It depends just why you are building the shared objects.

Hi Gary,

Thanks for the information where it's for a free tutorial.
o Nothing more, nothing less.

Everyone is vastly different. I'm not a coder; I'm just a PC user.
o What's different about me is I write general purpose tutorials.

Lots, and lots, and lots, and lost of them.
o Here's just one, for example, just so you get the idea of why I asked.

o Report: My first "hello world" using Android Studio freeware
on Windows worked just fine (in about an hour)
<https://groups.google.com/d/msg/microsoft.public.windowsxp.general/iiBCK8ycEMg/0REDcH8TCQAJ>

I give them away for free as I'll _never_ make a dime on what I do.

> If it is for sole use on the one peecee (or just those at home), use the
> free version of Visual Studio from MS.

All my tutorials are for _everyone_ to use, for free, using freeware.
o If it doesn't use freeware, it's _not_ a general purpose tutorial (IMHO).

For example, here's one on Emulation on Windows, as an example:
o How to get Genymotion Android emulation to work on an AMD Win10Pro desktop
<https://groups.google.com/d/msg/comp.mobile.android/ix9empN-mxg/GvBpgIkOAwAJ>

> If you are shipping the shared objects to customers, then pay for a copy
> of Visual Studio.

I spend 40 hours sometimes on these tutorials, sometimes more, often less.
o I give it all away for free.

If I ever wrote Android apps, they'd _always_ be freeware.
o No ads. No Google. No shenanigans. Just good old fashioned freeware.

Same here.
o All I wanted to do was write a tutorial for compiling openssl.

So that everyone could just cut and paste the commands.
o Like they would do with this tutorial, for example:

o Tutorial: How to connect Android to Windows as a drive letter
over a Wi-Fi LAN for free simple reliable bidirectional copy
<https://groups.google.com/d/msg/comp.mobile.android/9Lu2_dPsu6o/lD5QOkBcAQAJ>

If it's not free, it's worthless (as a general purpose solution).

> If you are going to build all of your components from scratch, and are
> capable of maintaining them in a convoluted environment, then the Ming-W
> compiler, or GCC as included in Cygwin, may be a suitable choice.

I just wanted to write a tutorial so that _others_ could compile the
openssl binary on native Windows, that's all.

If I ever do it, I'll post it here so that _everyone_ can follow the
tutorial but it would have to use freeware 100% or it's worthless.

> P.S. I've been a commercial software developer for close to forty
> years, if I was building something for Windows that was not just for the
> peecees at home I would buy the VS license.

For what I do, I'll never make money.
o I write so many tutorials I can't count them.

Maybe an average of a few a week for twenty years, give or take.
o Not just on Usenet but on other forums like car forums

For example, this isn't a tutorial but you get the idea...
o How to mount and balance your tires at home
<https://groups.google.com/forum/#!topic/rec.autos.tech/J5-7TxdDpBw>
--
If it's not free, it's worthless as a general purpose solution.

Arlen Holder

unread,
Apr 27, 2020, 2:28:00 AM4/27/20
to
In response to what Paul <nos...@needed.invalid> wrote :

> You have to be a detective, as much as a CS grad.

Hi Paul,

You successfully talked me out of it. :)

There must be people who actually enjoy all the problems that come with
compiling from source, but I'm not one of them.
<https://stackoverflow.com/questions/40007633/how-to-compile-openssl-on-windows>

Googling, it seems, as you inferred, it's rather complex to compile the
openssl binary from source code, where, for example, you have to use C and
not C++ compilers, and it matters what version you're compiling.
<https://www.ski-epic.com/2007_notes_on_openssl/>

For example, below OpenSSL version 1.0.2 they use a different build system
than above OpenSSL version 1.1.0 where the instructions are different.

Also, version 1.1.0 and above requires PERL 5.10 or higher, which I don't
have installed (and which I don't feel like installing just to write a
tutorial).
<https://github.com/my-devices/sdk/wiki/Building-OpenSSL-on-Windows>

There are apparently a bunch of gotchas, e.g., if you make a typo and end
up specifying a non-existent option, the configure scripts will proceed
without warning anyway.

In addition, there are platform specific options you have to know about,
apparently, such as Windows Vista needing the "no-async" option for OpenSSL
version 1.1.0 and higher.

Worse, it's mostly on Linux that people build it, so the best Windows
guides were written in 2012 apparently, and hence are only available on the
wayback machine.
o Building OpenSSL for Visual Studio
<https://web.archive.org/web/20161123004257/http://developer.covenanteyes.com/building-openssl-for-visual-studio//>

In summary, it's not going to be easy to write a general purpose tutorial,
and, since I don't have the need for compiling the source, it's not gonna
happen I don't think.

Besides, you need the following _just_ to contemplate compiling it:
o Perl
o GNU C (Cygwin or MinGW)
o NASM (in some cases)

Apparently MS visual Studio for C/C++ would work though.
<https://wiki.openssl.org/index.php/Compilation_and_Installation>
1. Ensure you have perl installed on your machine
(e.g. ActiveState or Strawberry), and available on your %PATH%
2. Ensure you have NASM installed on your machine,
and available on your %PATH%
3. Obtain the source files from <https://www.openssl.org/source/>
4. Extract the source files to your folder
cd c:\myPath\openssl
5. Launch Visual Studio tool x64 Cross Tools Command prompt
6. Goto your defined folder cd c:\myPath\openssl
7. Configure for the target OS with perl Configure VC-WIN64A
or other configurations to be found in the INSTALL file
(e.g. UNIX targets).
For instance: perl Configure VC-WIN64A.
8. (Optional) In case you compiled before on 32 or 64-bits,
make sure you run nmake clean to prevent trouble across 32
and 64-bits which share output folders.
9. Now build with: nmake
10. Output can be found in the root of your folder as
libcrypto-1_1x64.dll and libssl-1_1-x64.dll
(with all the build additionals such as .pdb .lik or static .lib).
You may check this is true 64bit code using the Visual Studio tool
'dumpbin'. For instance
dumpbin /headers libcrypto-1_1x64.dll | more
and look at the FILE HEADER section.
11. Test the code using the 'test' make target, by running nmake test.
12. Reminder, clean your code to prevent issues the next time
you compile for a different target. See step 7.

I'll leave it at that for now since I'm not gonna actually do it,
for two reasons:
a. It's harder than I would have hoped (just to write a tutorial),
b. The pre-compiled binary from xxx work just fine for my needs.
<https://curl.haxx.se/windows/dl-7.69.1_2/openssl-1.1.1g_2-win64-mingw.zip>
<https://curl.haxx.se/windows/dl-7.69.1_2/openssl-1.1.1g_2-win32-mingw.zip>
--
Usenet is a place for adults to gather to politely discuss technical stuff.

Paul

unread,
Apr 27, 2020, 3:16:04 AM4/27/20
to
Arlen Holder wrote:
> In response to what "Gary R. Schmidt" <grsc...@acm.org> wrote :
>
>> It depends just why you are building the shared objects.
>
> Hi Gary,
>
> Thanks for the information where it's for a free tutorial.
> o Nothing more, nothing less.
>
> Everyone is vastly different. I'm not a coder; I'm just a PC user. o
> What's different about me is I write general purpose tutorials.

Building software isn't exactly a tutorial kind of thing.
Depending on the project, the skill set required can be
multidisciplinary.

Learning how, is like apprenticing partly.

Maybe your first project is a "Hello World" with
no Makefile or ./configure provided. That forces
you to run a compiler and/or linker to completion.

If a project involved crypto, and the developer leaves
some "bad" options as available options in the build,
then that's when your second discipline cuts in. Say we
know that some RSA things are compromised, and a crypto
guy would know not to use them. Developers "assume"
certain things about the audience, when they offer
software. They may insulate you entirely from details,
and this would be a "noob-ready" package. Or, they may
offer an unfinished work which "any crypto-expert could build".

Could you put an entire CS degree into a single USENET
post ? I don't think so. Of necessity, tutorial-type
materials have already been "dumbed down" so fewer
people "lose a finger" while working with them.

Part of building, is knowing when you're over your
head, and nothing good will come of it.

Paul

Mayayana

unread,
Apr 27, 2020, 7:57:25 AM4/27/20
to
"Paul" <nos...@needed.invalid> wrote

| Part of building, is knowing when you're over your
| head, and nothing good will come of it.
|

Bingo. Now try to explain that to Arlen. Probably
he'll explain it back to you without having actually
understood anything himself.


Arlen Holder

unread,
Apr 27, 2020, 12:10:02 PM4/27/20
to
In response to what Paul <nos...@needed.invalid> wrote :

> Part of building, is knowing when you're over your
> head, and nothing good will come of it.

Hi Paul,

My philosophy is...

There's merit for humans on doing things (at least) once...
o Like assembling or compiling or linking or emulating...
<https://groups.google.com/d/msg/comp.mobile.android/aW64zYeBtF0/c7TrEvhIAQAJ>

Or building your own KISS simple Android apps even, as we did...
<https://groups.google.com/forum/#!topic/comp.mobile.android/aW64zYeBtF0%5B1-25%5D>

In the case of the Android tutorials, I posted a score of them...
<http://www.bild.me/bild.php?file=7906618app18_01.jpg>

That was enough, imho, for readers to get the basic idea...
o Philosophically, the merit is that some "good" does come of it.

You may think otherwise; and that's fine, as it's a philosophical
difference, and you're always purposefully helpful (unlike most people).

As am I.
--
Doing things once has merit since you learn a lot by actual doing.
0 new messages