Commit graph

729 commits

Author SHA1 Message Date
Rob Percival
0cea8832df Public API for Certificate Transparency
Reviewed-by: Ben Laurie <ben@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-26 14:57:29 -05:00
Richard Levitte
56b10d8824 Remove comments saying you must do 'make -f Makefile.in TABLE'
Since the configs were remade into hash tables, this isn't needed
any more.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-26 17:39:19 +01:00
Richard Levitte
0f2d3e4e4e Unified on VMS - add %disabled in vmsconfig.pm (util/dofile.pl demands it)
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-26 15:06:46 +01:00
Richard Levitte
bdcd83e127 Configure - neater looking add() and add_before()
They now default to " " as separator, but that can be overridden by
having a hash with parameters as last argument.  The only currently
recognised parameter is `separator'.

The special separator `undef' will force the result to become a list
rather than a concatenated string.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-26 09:00:25 +01:00
Richard Levitte
28a55a873d Make it possible to build even if dependency files can't be generated
If the local system doesn't have GNU C or clang, and not even
makedepend, the build will stop because the call of 'makedepend'
fails.  This changes so the build won't stop because of such failure.
The result will be empty .d files, and that's ok.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-25 14:48:52 +01:00
Richard Levitte
893fe73a63 Remove all -march= from configs
These flags are limitting needlessly, are often patched by packagers,
and should be specified on the configuration command line by anyone
who desires for it to be specific rather than forced by us.

This work was already done with mingw when those configs were worked
on, now it gets applied to the remaining configs.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-23 00:47:52 +01:00
Richard Levitte
84af1bae68 Clean away $config{no_shared} since we have $disabled{shared}
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-22 16:36:58 +01:00
Richard Levitte
f8d9d6e48b Check that any dependency file is newer than Makefile before concatenating
On slower file systems, this makes a huge difference

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-21 16:26:06 +01:00
Richard Levitte
ea80a25e81 Avoid GNU make re-exec when adding dependencies to Makefile
GNU make will re-exec if (it thinks that) the Makefile has changed.
Just having the target Makefile seems to make it think it has, so we
end up in a look where GNU make re-execs for ever.

The fix is easy, just remove the Makefile target and have the depend
target run the recipe on its own instead of depending on Makefile.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-21 00:33:54 +01:00
Ben Laurie
834aae2a99 Remove OBJ_EXT and friends.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-20 21:07:29 +00:00
Ben Laurie
58f2b0ae58 Missing extension on dependency, .d file is not always made (e.g. when input
is a .s).

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-20 16:56:44 +00:00
Richard Levitte
f27f64e17a Unified on VMS - install dynamic engines if there are any
Don't check for no_shared

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-20 16:51:31 +01:00
Richard Levitte
45502bfe19 Always build library object files with shared library cflags
This takes us away from the idea that we know exactly how our static
libraries are going to get used.  Instead, we make them available to
build shareable things with, be it other shared libraries or DSOs.

On the other hand, we also have greater control of when the shared
library cflags.  They will never be used with object files meant got
binaries, such as apps/openssl or test/test*.

With unified, we take this a bit further and prepare for having to
deal with extra cflags specifically to be used with DSOs (dynamic
engines), libraries and binaries (applications).

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-20 16:51:31 +01:00
Richard Levitte
5ee719da04 apps_extra_src changed name to apps_aux_src, rename everywhere
One spot was forgotten.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-20 09:28:16 +01:00
Richard Levitte
ef3c88cf89 VMS static libraries have the extension .OLB, not .LIB
Object LiBrary

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-20 09:27:21 +01:00
Richard Levitte
874efa9f81 Unified 'make depend' has to cleanup after itself
It failed to remove lingering Makefile.new

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-19 23:34:25 +01:00
Richard Levitte
ce5ed82f82 Fix Configurations/unix-Makefile.tmpl
It was turning off output again in two place where it should have
turned it on.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-19 22:39:08 +01:00
Richard Levitte
0fb3b62902 Make sure the linked programs have the correct extension
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:52:16 +01:00
Richard Levitte
520f434b42 Big rename fest of MingW shared libraries
So far, MingW shared libraries were named like this

  libeay32.dll + libeay32.dll.a
  ssleay32.dll + ssleay32.dll.a

That naming scheme is antiquated, a reminicense of SSLeay.  We're
therefore changing the scheme to something that's more like the rest
of OpenSSL.

There are two factors to remember:

  - Windows libraries have no recorded SOvers, which means that the
    shared library version must be encoded in the name.  According to
    some, it's unwise to encode extra periods in a Windows file name,
    so we convert version number periods to underscores.
  - MingW has multilib ability.  However, DLLs need to reside with the
    binaries that use them, so to allow both 32-bit and 64-bit DLLs to
    reside in the same place, we add '-x64' in the name of the 64-bit
    ones.

The resulting name scheme (for SOver 1.1) is this:

  on x86:
  libcrypto-1_1.dll + libcrypto.dll.a
  libssl-1_1.dll + libssl.dll.a

  on x86_64:
  libcrypto-1_1-x64.dll + libcrypto.dll.a
  libssl-1_1-x64.dll + libssl.dll.a

An observation is that the import lib is the same for both
architectures.  Not to worry, though, as they will be installed in
PREFIX/lib/ for x86 and PREFIX/lib64/ for x86_64.

As a side effect, MingW got its own targets in Makefile.shared.
link_dso.mingw-shared and link_app.mingw-shared are aliases for the
corresponding cygwin-shared targets.  link_shlib.mingw-shared is,
however, a target separated from the cygwin one.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:52:16 +01:00
Richard Levitte
f99f91f121 Misc small fixes.
Better libclean that removes the exact files that have been built,
nothing more and nothing less.

Corrected typo

A couple of editorial changes.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:52:15 +01:00
Richard Levitte
98e5534e65 Try removing installation directories after having uninstalled files
Of course, if there are remaining files in a directory, it won't be removed.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:52:15 +01:00
Richard Levitte
5386287cfc Small rename fest in unified, obj2dynlib -> obj2dso
Since we're using the acronym DSO everywhere else and that's a common
name for that kind of object, we might as well do so here as well.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:52:15 +01:00
Richard Levitte
c8c2b77900 Remake the installation of shared libraries in unix-Makefile.tmpl
Instead of having the installation recipe rely on special knowledge,
feed it with information, including what shared library files belong
together.  For Cygwin and Mingw, that's the .dll and its import
library .dll.a.  For Unixen, it's the shared library file name with SO
version and the one without.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:52:15 +01:00
Richard Levitte
e048fd5171 Big rename fest in makefile.shared: link_a / link_o -> link_shlib / link_dso
Originally, the Makefile.shared targets described what they used as
input for a shared object, be it a shared library or a DSO.  It turned
out, however, that the link_o targets were used exclusively for
engines and the link_a targets were for libcrypto and libssl.

This rename fest turns and indication on the kind of input the targets
get to the intention with using them.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:51:23 +01:00
Richard Levitte
f5c174ff93 Centralise the shared library / dso name info in unix-Makefile.tmpl
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:51:23 +01:00
Richard Levitte
e987f9f271 Let Configure figure out the diverse shared library and DSO extensions
Then it can pass around the information where it belongs.  The
Makefile templates pick it up along with other target data, the
DSO module gets to pick up the information through
crypto/include/internal/dso_conf.h

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:51:23 +01:00
Richard Levitte
a8a421b113 VMS fixed in unified build
- install_sw had a display of text that belongs under the install target
- previous layout installed architecture dependent files in
  dev:['prefix'.'arch'.LIB], dev:['prefix'.'arch'.EXE] and
  dev:['prefix'.'arch'.ENGINES].  Changed to dev:['prefix'.LIB.'arch'],
  dev:['prefix'.EXE.'arch'] and dev:['prefix'.ENGINES.'arch'] instead.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:14:06 +01:00
Richard Levitte
f0c93a8593 Unified - don't install the ossltest engine
This is done with a simple file name comparison.  We could think of
something more elegant in the future.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:12:33 +01:00
Richard Levitte
8be7bdb5c6 Unified - do a better job when uninstalling
Some directories weren't removed.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:12:33 +01:00
Richard Levitte
3a55c92bba Rethink the uplink / applink story
Adding uplink and applink to some builds was done by "magic", the
configuration for "mingw" only had a macro definition, the Configure
would react to its presence by adding the uplink source files to
cpuid_asm_src, and crypto/build.info inherited dance to get it
compiled, and Makefile.shared made sure applink.o would be
appropriately linked in.  That was a lot under the hood.

To replace this, we create a few template configurations in
Configurations/00-base-templates.conf, inherit one of them in the
"mingw" configuration, the rest is just about refering to the
$target{apps_aux_src} / $target{apps_obj} in the right places.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:06:54 +01:00
Richard Levitte
5be5e56c09 VMS: rather use a quick file comparison than DIFF
VMS DIFF tries to calculate all the differences, which is slower than
just reading the files and stopping at the first difference.  The
latter doesn't exist as a command, so the problem is solved with perl
and File::Compare (has been in core perl since very early version 5).

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-19 08:58:09 +01:00
Richard Levitte
70ef905779 VMS: produce dependency files just like you produce object files
We need to do the same dance as when object files are created.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-19 08:57:59 +01:00
Richard Levitte
1576663231 Fix casing on VMS
DCL may be in extended parsing style, which makes it less case
insensitive, so when removing a string from another, make sure to get
casing correctly.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-19 02:32:22 +01:00
Richard Levitte
27f42b4679 Don't use config.timestamp, we already have configdata.pm
The benefit with using configdata.pm is that Configure writes it for
us.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-19 02:30:51 +01:00
Richard Levitte
c058fcd798 Automatic 'make depend' for the unified build scheme
This isn't the fully featured combination of compiler generated
dependency files and Makefile include directives, but a cheaper
variant of the same.

The dependency files are generated automatically, but then we have the
usual "depend" target.  However, we depend on it in the bigger phony
targets that are the most likely to be used.  That make this feature
automatic enough.

A side effect is that we can't use the build file's timestamp to check
if reconfiguring might be in order.  In its place, we use a flag file
that depends on Configure and the build file template and depend on it
in spots where it makes sense to check for the need to reconfigure.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 23:48:52 +01:00
Richard Levitte
f325fba50c Set EXE_EXT environment variable when testing
When cross compiling, we may end up with someting like apps/openssl.exe
and a number of test/*.exe.  However, util/shlib_wrap.sh doesn't know
what the executable extension should be, if any, so we need to make
sure it has access to that information when testing, since
OpenSSL::Test uses that script to execute all programs.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 23:45:44 +01:00
Richard Levitte
ce192ebed0 Remove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPEND
All those flags existed because we had all the dependencies versioned
in the repository, and wanted to have it be consistent, no matter what
the local configuration was.  Now that the dependencies are gone from
the versioned Makefile.ins, it makes much more sense to use the exact
same flags as when compiling the object files.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 23:43:09 +01:00
Richard Levitte
88297284ad Don't treat .d (depend) files separately from object files
.d (.MMS in the VMS world) files with just dependencies are built from
exactly the same conditions as the object files.  Therefore, the rules
for them can be built at the same time as the rules for the
corresponding object files.

This removes the requirement for a src2dep function in the build file
templates, and for common.tmpl to call it.  In the end, the existence
of depend files is entirely up to the build file.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 23:42:09 +01:00
Richard Levitte
7d1037661a Fix the makedepend constructor in unix-Makefile.tmpl
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 23:41:29 +01:00
Rich Salz
e4ef2e25f1 Remove "experimental" in code and comments, too.
Thanks to Viktor for additional review.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-17 21:12:30 -05:00
Richard Levitte
29d0932721 Fix spelling
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 00:32:13 +01:00
Richard Levitte
6ba5dd341b Fix spelling
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 00:11:18 +01:00
Richard Levitte
d9dc3e1d28 Add -lresolv to the Solaris ex_libs
The reason is that we use hstrerror() and other resolver functions.

Reporter: Erik Forsberg <erik@efca.com>

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 00:07:54 +01:00
Richard Levitte
b0c93ee747 Fix use of add() and add_before() in Configurations/*.conf
These two functions take a separator to concatenat the strings with as
first argument.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-16 02:48:18 +01:00
Richard Levitte
3544091ae0 MANSUFFIX should be left empty
That variable isn't for us, it's for any user, distributor or package
builder that wants one after the section number.  "ssl" seems to be
popular...

Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-15 14:16:07 +01:00
Ben Laurie
ecd44a3c1e Address comments.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-15 12:15:45 +00:00
Ben Laurie
18c7e6dda8 Tests depend on everything.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-15 12:09:58 +00:00
Andy Polyakov
6762a14779 Configurations/00-base-templates.conf: typos in [chacha|poly1305]_asm_src.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-14 21:24:25 +01:00
Richard Levitte
ba327ade80 Have dofile.pl say where it was run, for real this time
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-14 08:47:47 +01:00
Richard Levitte
4b799ceaa2 Have dofile.pl say where it was run
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-14 08:33:21 +01:00
Richard Levitte
68a5f1a278 Don't build test programs by default, add convenience targets for unified build
Test programs are now only built when running "make test" or "make
build_tests".

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 18:32:01 +01:00
Richard Levitte
dde10ab4d2 Have the same installation directories in unified as in unixmake
unix-Makefile.tmpl was lagging behind on this point.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 18:32:01 +01:00
Andy Polyakov
b3214008e4 Configurations: engage PPC ChaCha20 and Poly1305 modules.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-13 17:22:20 +01:00
Richard Levitte
af093bf485 Add SHARED_RCFLAGS in unified Makefile template
Also remove a spurious extra $(LDFLAGS)

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 16:03:31 +01:00
Richard Levitte
3af104f3cc The unified build may delete installed manual files
The installation of man files and html files alike didn't properly
check that file names with different casing could be the same on
case-insensitive file systems.  This change fixes that.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 15:12:24 +01:00
Richard Levitte
dac494d2a8 In templates, output_on() must be used the same way as output_off()
Otherwise, there will be an unbalance.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 13:59:10 +01:00
Andy Polyakov
f4e175e4af C64x+ assembly pack: add ChaCha20 and Poly1305 modules.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-13 12:34:29 +01:00
Andy Polyakov
647097e17d Configurations: engage ARM ChaCha20 and Poly1305 modules.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-13 12:08:25 +01:00
Richard Levitte
03ed5e9906 We need the linked utils after a full build.
We really needs a better util/shlib_wrap.sh, but will have to do for now.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-12 23:06:41 +01:00
Richard Levitte
50e83cdde6 Unified build - fix make depend
There was a catch 22, where 'make depend' directly after configuring
in an otherwise pristine build tree would fail because buildinf.h
didn't exist yet.

This change has the depend building targets depend on the same other
targets as the object file building targets, so the generation of
buildinf.h and similar files would kick in during 'make depend'.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-12 23:05:43 +01:00
Richard Levitte
3c65577f1a Rename INSTALL_PREFIX to DESTDIR, remove option --install_prefix
INSTALL_PREFIX is a confusing name, as there's also --prefix.
Instead, tag along with the rest of the open source world and adopt
the Makefile variable DESTDIR to designate the desired staging
directory.

The Configure option --install_prefix is removed, the only way to
designate a staging directory is with the Makefile variable (this is
also implemented for VMS' descrip.mms et al).

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-12 21:54:07 +01:00
Richard Levitte
fb3e2a88ee Generate progs.h from a bunch of files instead of internal knowledge
apps/progs.pl counted on the caller to provide the exact command
files.  The unified build doesn't have that knowledge, and the easier
and more flexible thing to do is to feed it all the apps/*.c files and
let it figure out the command names by looking inside (looking for
/int ([a-z0-9][a-z0-9_]*)_main\(int argc,/).

Also, add it to the generate command, since it's a versioned file.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-12 04:42:22 +01:00
Richard Levitte
6bb2106e24 Add the generate mechanism from unixmake to unix-Makefile.tmpl
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 20:10:44 +01:00
Rich Salz
f3f1cf8444 Move to REF_DEBUG, for consistency.
Add utility macros REF_ASSERT_NOT and REF_PRINT_COUNT
This is also RT 4181

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11 12:40:32 -05:00
Richard Levitte
cedbb1462a Make shared library targets more consistent
On Windows POSIX layers, two files are produced for a shared library,
there's {shlibname}.dll and there's the import library {libname}.dll.a

On some/most Unix platforms, a {shlibname}.{sover}.so and a symlink
{shlibname}.so are produced.

For each of them, unix-Makefile.tmpl was entirely consistent on which
to have as a target when building a shared library or which to use as
dependency.

This change clears this up and makes it consistent, we use the
simplest form possible, {lib}.dll.a on Windows POSIX layers and
{shlibname}.so on Unix platforms.  No exception.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 17:08:38 +01:00
Richard Levitte
64c443e3f0 Add support for shared_rcflag, useful for windres (Cygwin and Mingw)
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 16:50:01 +01:00
Richard Levitte
68ab559a50 Modernise the mingw cflags and ldflags
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 16:50:01 +01:00
Rich Salz
330fad61af BIO_PAIR_DEBUG did nothing; remove it.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-10 15:28:18 -05:00
Richard Levitte
076e596ffb Quote the CFLAG in Unixly Makefiles, for buildinf.h
Because the command line definitions of OPENSSLDIR and ENGINESDIR
contain quotes, we need a variant of CFLAG where backslashes and
quotes are escaped when we produce buildinf.h

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 19:36:48 +01:00
Richard Levitte
e84193e43d unified build scheme: add a "unified" template for VMS descrip.mms
As part of this, change util/mkdef.pl to stop adding libraries to
depend on in its output.  mkdef.pl should ONLY output a symbol
vector.

Because symbol names can't be longer than 31 characters, we use the
compiler to shorten those that are longer down to 23 characters plus
an 8 character CRC.  To make sure users of our header files will pick
up on that automatically, add the DEC C supported extra headers files
__decc_include_prologue.h and __decc_include_epilogue.h.

Furthermore, we add a config.com, so VMS people can configure just as
comfortably as any Unix folks, thusly:

    @config

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 14:36:32 +01:00
Richard Levitte
fcf80c469a unified build scheme: add the tweaks to build on Cygwin & Mingw
Cygwin and Mingw name their libraries a bit differently from the rest
of the POSIXly universe, we need to adapt to that.

In Makefile.tmpl, it means that some hunks will only be output
conditionally.

This also means that shared_extension for the Cygwin and Mingw
configurations in Configurations/10-main.conf are changing from .dll.a
to .dll.  Makefile.shared does a fine job without having them
specified, and it's much easier to work with tucking an extra .a at
the end of files in the installation recipes than any amount of name
rewrites, especially with the support of the SHARED_NAME in the top
build.info.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 14:36:04 +01:00
Richard Levitte
567a9e6fe0 unified build scheme: add a "unified" template for Unix Makefile
This also adds all the raw sections needed for some files.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 14:36:04 +01:00
Richard Levitte
bcb1977b7f Configure et al: treat C defines separately
With some compilers, C macros are defined differently on the command
line than on Unix.  It could be that the flad to define them isn't -D,
it could also be that they need to be grouped together and not be mixed
in with the other compiler flags (that's how it's done on VMS, for
example).

On Unix family platform configurations, we can continue to have macro
definitions mixed in with the rest of the flags, so the changes in
Configurations/*.conf are kept to an absolute minimum.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 14:34:06 +01:00
Andy Polyakov
5d1f03f29e Configurations: engage x86[_64] ChaCha20 and Poly1305 modules.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 10:31:37 +01:00
Andy Polyakov
6407ef7c49 Configurations: engage s390x ChaCha20 and Poly1305 modules.
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-09 22:34:24 +01:00
Richard Levitte
f83133a5ed unified build scheme: add a design document
This documents describes the three steps from build.info files via the
%unified_info database to the build-file templates, along with some
examples showing how the data gets processed along the way.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-09 01:25:00 +01:00
Richard Levitte
ddf1847dc8 unified build scheme: add and document the "unified" driving engine
common.tmpl will be used together with the template build file, and is
the engine that connects the information gathered from all the
build.info files with making the build file itself.

This file expects there to be a template section in the build file
template that defines a number perl functions designed to return
strings with appropriate lines for the build system at hand.  The
exact functions, what they can expect as arguments and what output
they're expected to produce is documented in Configurations/README.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-09 01:25:00 +01:00
Andy Polyakov
c7c3c8b917 Configurations/00-base-templates.conf: harmonize extensions.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-08 15:53:22 +01:00
Richard Levitte
c86ddbe613 Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs.  These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.

Unfortunately, that conclusion wasn't entirely accurate.  Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.

Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.

Also, documentation is changed in Configurations/README.  This was
previously forgotten.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-06 17:57:19 +01:00
Richard Levitte
8ffdf7ffd7 unified build scheme: add a personal configuration to test it
Nothing else will run the unified scheme for now.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-01 12:46:58 +01:00
Richard Levitte
9fe2bb77c4 unified build scheme: a first introduction
The "unified" build scheme revolves around small information files,
build.info, which each describe their own bit of everything that needs
to be built, using a mini-language described in Configurations/README.

The information in build.info file contain references to source files
and final result.  Object files are not mentioned at all, they are
simply from source files.  Because of this, all the *_obj items in
Configurations/*.conf are renamed to *_asm_src and the files listed
in the values are change from object files to their corresponding
source files.  For the sake of the other build schemes, Configure
generates corresponding *_obj entries in %target.

Furthermore, the "unified" build scheme supports having a build
directory tree separate from the source directry tree.

All paths in a build.info file is assumed to be relative to its
location, either within the source tree or within the build tree.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-01 12:46:58 +01:00
Andy Polyakov
81e03785f7 Engage poly1305-sparcv9 module.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-31 22:50:10 +01:00
Richard Levitte
04b08fbc3d Complete the lflags -> lflags/ex_libs transition
Some last lflags to convert to ex_libs or a combo of lflags and ex_libs

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-29 19:28:05 +01:00
Richard Levitte
1740c16265 Configure et al: split up the lflags configuration item into two
The lflags configuration had a weird syntax with a % as separator.  If
it was present, whatever came before ended up as PEX_LIBS in Makefile
(usually, this is LDFLAGS), while whatever came after ended up as
EX_LIBS.

This change splits that item into lflags and ex_libs, making their use
more explicit.

Also, PEX_LIBS in all the Makefiles are renamed to LDFLAGS.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-29 18:36:57 +01:00
Richard Levitte
ddf47a10cd Make use of add() and add_before() in Configurations/
A few more sub-joins could be replaced with calls to add() and add_before()

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-29 18:17:30 +01:00
Emilia Kasper
d8ca44ba41 Always DPURIFY
The use of the uninitialized buffer in the RNG has no real security
benefits and is only a nuisance when using memory sanitizers.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-29 16:33:13 +01:00
Rich Salz
a01dab9462 Remove x86_gcc_des,x86_gcc_opts
This is a followin from !1738, we no longer need those variables.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-29 10:30:57 -05:00
Rich Salz
3e9e810f2e Remove outdated legacy crypto options
Many options for supporting optimizations for legacy crypto on legacy
platforms have been removed.  This simplifies the source code and
does not really penalize anyone.
        DES_PTR (always on)
        DES_RISC1, DES_RISC2 (always off)
        DES_INT (always 'unsigned int')
        DES_UNROLL (always on)
        BF_PTR (always on) BF_PTR2 (removed)
        MD2_CHAR, MD2_LONG (always 'unsigned char')
        IDEA_SHORT, IDEA_LONG (always 'unsigned int')
        RC2_SHORT, RC2_LONG (always 'unsigned int')
        RC4_LONG (only int and char (for assembler) are supported)
        RC4_CHUNK (always long), RC_CHUNK_LL (removed)
        RC4_INDEX (always on)
And also make D_ENCRYPT macro more clear (@appro)

This is done in consultation with Andy.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-01-27 19:05:50 -05:00
Richard Levitte
f0bd468675 Small cleanups in Configure
- Small rearrangement of the TABLE and HASH printouts, and adding
  printout of the "build_scheme" item
- Renamed "engines_obj" to "padlock_obj"
- Moved the runs of dofile down...  it didn't quite make sense to have
  that in the middle of a printout

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-25 21:51:22 +01:00
Richard Levitte
107b5792b2 Refactor file writing - Remake Makefile.org into a template
It is time for Makefile.org to fold into the new regime and have a run
through util/dofile.pl.  This forces some information out of there and
into Configure, which isn't a bad thing, it makes Configure
increasingly the center of build information, which is as it should
be.

A few extra defaults were needed in the BASE template to get rid of
warnings about missing values.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-25 19:07:11 +01:00
Richard Levitte
df71f0b824 String configs are truly deprecated, not even somewhat supported any more
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-23 21:21:03 +01:00
Richard Levitte
c5f9317fb5 Configurations - no_asm_filler is long gone, don't use it
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-22 18:37:50 +01:00
Richard Levitte
88087414de Refactor config - @MK1MF_Builds out, general build scheme in
Time to get rid of @MK1MF_Builds and introduce a more flexible
'build_scheme' configuration key.  Its value may be a string or an
array of strings, meaning we need to teach resolve_config how to
handle ARRAY referenses.

The build scheme is a word that selects a function to create the
appropriate result files for a certain configuration.  Currently valid
build schemes aer "mk1mf" and "unixmake", the plan is however to add
at least one other for a more universal build scheme.

Incidently, this also adds the functions 'add' and 'add_before', which
can be used in a configuration, so instead of having to repeatedly
write a sub like this:

	key1 => sub { join(" ", @_, "myvalues"); },
	key2 => sub { join(" ", "myvalues", @_); },

one could write this:

	key1 => add(" ", "myvalues"),
	key2 => add_before(" ", "myvalues"),

The good point with 'add' and 'add_before' is that they handle
inheritances where the values are a misture of scalars and ARRAYs.  If
there are any ARRAY to be found, the resulting value will be an ARRAY,
otherwise it will be a scalar with all the incoming valued joined
together with the separator given as first argument to add/add_before.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-22 00:58:56 +01:00
Richard Levitte
9e0724a180 Refactor config - move templates and template docs to Configurations
Move the documentation of the target configuration form to
Configurations/README.

Move initial assembler object templates to
Configurations/00-BASE-templates.conf.

Furthermore, remove all variables containing the names of the
non-assembler object files and make a BASE template of them instead.
The  values from this templates are used as defaults as is.  The
remaining manipulation of data when assembler modules are used is done
only when $no_asm is false.

While doing this, clean out some other related variables that aren't
used anywhere.

Also, we had to move the resolution of the chosen target a bit, or the
function 'asm' would never catch a true $no_asm...  this hasn't
mattered before we've moved it all to the BASE template, but now it
does.

At the same time, add the default for the 'unistd' key to the BASE
template.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-22 00:55:44 +01:00
Richard Levitte
b9ee2dacbc Add some extra Cygwin targets as aliases for Cygwin-x86
Cygwin was used for x86 before, so let's keep it around for those who
still use it (it make Configure reconf possible).
Cygwin-i[3456]86 for those that might generate and pass a target name
directly to Configure.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-18 16:16:00 +01:00
Richard Levitte
3f54296955 Adjust the configuration target name from Cygwin-i686 to Cygwin-x86
This is to reflect that it's not limited to just i686.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-18 16:16:00 +01:00
Corinna Vinschen
a717c110d2 Fix configuration system to support different architectures on Cygwin.
This patch allows to recognize the architectures supported by Cygwin
and to choose the right configuration from there.  Drop -march to
use default architecture on 32 bit x86.

Drop pre-Cygwin-1.3 recognition since it's long gone and there's no
valid configuration for this anymore.

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-18 16:16:00 +01:00
Rich Salz
d10dac1187 Move Makefiles to Makefile.in
Create Makefile's from Makefile.in
Rename Makefile.org to Makefile.in
Rename Makefiles to Makefile.in
Address review feedback from Viktor and Richard

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-12 16:26:56 -05:00
Viktor Dukhovni
c2e27310c7 Enable/disable crypto-mdebug just like other features
Also always abort() on leak failure.

Reviewed-by: Stephen Henson <steve@openssl.org>
2016-01-11 02:41:16 +00:00
Rich Salz
bbd86bf542 mem functions cleanup
Only two macros CRYPTO_MDEBUG and CRYPTO_MDEBUG_ABORT to control this.
If CRYPTO_MDEBUG is not set, #ifdef out the whole debug machinery.
        (Thanks to Jakob Bohm for the suggestion!)
Make the "change wrapper functions" be the only paradigm.
Wrote documentation!
Format the 'set func' functions so their paramlists are legible.
Format some multi-line comments.
Remove ability to get/set the "memory debug" functions at runtme.
Remove MemCheck_* and CRYPTO_malloc_debug_init macros.
Add CRYPTO_mem_debug(int flag) function.
Add test/memleaktest.
Rename CRYPTO_malloc_init to OPENSSL_malloc_init; remove needless calls.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-07 15:14:18 -05:00
Viktor Dukhovni
b311b74d78 Fix erroneous SO suffix in darwin64-debug-test-64-clang target
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-13 22:43:29 -05:00
Andy Polyakov
80b1247fe6 Configurations/10-main.conf: fix typos in mingw/cygwin configs.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-11 21:04:02 +01:00
Andy Polyakov
f6739c3db4 Configuratons: add -DFILIO_H to harmonized Solaris targets.
Triggered by RT#4144.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-11-24 23:06:13 +01:00
Jacob Bandes-Storch
f4d8f03755 Add perl modeline to Configure scripts
Encourages GitHub to perform proper syntax highlighting.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-11-24 13:12:57 +01:00
Dr. Stephen Henson
043b93d732 add -pthread to debug-steve*
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-11-21 12:44:39 +00:00
Matt Caswell
757d14905e Add pthread support
The forthcoming async code needs to use pthread thread local variables. This
updates the various Configurations to add the necessary flags. In many cases
this is an educated guess as I don't have access to most of these
environments! There is likely to be some tweaking needed.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-11-20 23:19:16 +00:00
Andy Polyakov
dc8980957b Configurations: move -Wno-pedantic-ms-format to .travis.yml.
The option is not available in older toolchains and would cause breakage.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-12 12:07:29 +02:00
Alessandro Ghedini
2d28462373 Fix travis builds on master
-Allow mingw debug builds to fail on Travis CI
-Fix Travis email notifications config
-Rename a variable to avoid a bogus warning with old GCC
 error: declaration of ``dup'' shadows a global declaration [-Werror=shadow]
-Disable pedantic ms-format warnings with mingw
-Properly define const DH parameters
-Restore --debug flag in Travis CI builds; -d would get incorrectly passed
 to ./Configure in mingw debug builds.

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-10-06 12:30:47 -04:00
Alessandro Ghedini
a2c1dedc5d Properly format linux-arm64ilp32 target config
Otherwise the ./config script fails with errors like:

> Operating system: x86_64-whatever-linux2
> This system (linux-x86_64) is not supported. See file INSTALL for details.

The failure was introduced by a93d3e0.

RT#4062

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-09-25 14:59:18 +01:00
Andy Polyakov
a93d3e06a9 Configurations: add linux-arm64ilp32 target.
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-25 13:39:02 +02:00
David Woodhouse
4d60c7e10f RT3969: Add OPENSSL_SYS_UEFI
This provides support for building in the EDK II reference implementation
of UEFI. Most UEFI firmware in existence uses OpenSSL for implementing
the core cryptographic functionality needed for Secure Boot.

This has always previously been handled with external patches to OpenSSL
but we are now making a concerted effort to eliminate those.

In this mode, we don't actually use the OpenSSL makefiles; we process
the MINFO file generated by 'make files' and incorporate it into the
EDK2 build system.

Since EDK II builds for various targets with varying word size and we
need to have a single prepackaged configuration, we deliberately don't
hard-code the setting of SIXTY_FOUR_BIT vs. THIRTY_TWO_BIT in
opensslconf.h. We bypass that for OPENSSL_SYS_UEFI and allow EDK II
itself to set those, depending on the architecture.

For x86_64, EDK II sets SIXTY_FOUR_BIT and thus uses 'long long' for the
64-bit type, even when building with GCC where 'long' is also 64-bit. We
do this because the Microsoft toolchain has 32-bit 'long'.

Signed-off-by: Rich Salz <rsalz@akamai.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-08 23:14:36 -04:00
Ben Laurie
d237a2739c Build with --strict-warnings on FreeBSD.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-08-02 02:21:46 +01:00
Andy Polyakov
f8a35ccc57 Configure: replace -mv8 with -mcpu=v8 in SPARC config lines.
RT#3860

Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-26 10:19:10 +02:00
Andy Polyakov
d11582f133 Configurations/10-main.conf: update iOS commentary.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-13 17:11:28 +02:00
Ben Laurie
190c8c60c1 Fix build on MacOS.
Reviewed-by: Andy Polyakov
2015-05-01 17:46:17 +01:00
Andy Polyakov
313e6ec11f Add assembly support for 32-bit iOS.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-20 15:06:22 +02:00
Andy Polyakov
5a3d915d77 Configure: add initial support for 64-bit Android.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-20 14:49:16 +02:00
Emilia Kasper
13efe9d17e Use -Wall -Wextra with clang
The disabled set of -Weverything is hard to maintain across versions.
Use -Wall -Wextra but also document other useful warnings that currently trigger.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-17 18:17:50 +02:00
Dr. Stephen Henson
5621e7aaf3 Remove obsolete options for debug-steve*
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-15 13:58:38 +01:00
Andy Polyakov
449e3f2601 Configure: android-arm facelift.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-02 09:36:32 +02:00
Andy Polyakov
1818572d83 Configure: remove unused variables.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-28 15:36:40 +01:00
Andy Polyakov
7ead0c8918 Configure: fold related configurations more aggressively and clean-up.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-18 16:27:00 +01:00
Richard Levitte
a5250ec02f Configuration cleanup: personal configs
Move obviously personal configurations to personal files.

Note: those files should really not be in the main repo at all

Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-03-16 22:18:08 +01:00
Richard Levitte
7910044064 Find debug- targets that can be combined with their non-debug counterparts and do so
Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-03-16 22:16:31 +01:00
Richard Levitte
5e1b23536a Change all the main configurations to the new format.
As part of this, remove some levitte examples that never were relevant.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-03-16 22:16:30 +01:00
Richard Levitte
70e4f10346 Provide a few examples by converting my own strings to hash table configurations
Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-03-16 22:16:30 +01:00
Richard Levitte
97a0cc5281 Move Configurations* out of the way and rename them.
Configure would load the glob "Configurations*".  The problem with
this is that it also loads all kinds of backups of those
configurations that some editors do, like emacs' classic
'Configurations~'.  The solution is to give them an extension, such as
'.conf', and make sure to end the glob with that.

Also, because 'Configurations.conf' makes for a silly name, and
because a possibly large number of configurations will become clutter,
move them to a subdirectory 'Configurations/', and rename them to
something more expressive, as well as something that sets up some form
of sorting order.  Thus:

    Configurations	->	Configurations/10-main.conf
    Configurations.team	->	Configurations/90-team.conf

Finally, make sure that Configure sorts the list of files that 'glob'
produces, and adapt Makefile.org.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-03-11 12:07:25 +01:00
Richard Levitte
4a577300c2 Cleanup spaces
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-03-06 10:22:43 +01:00
Rich Salz
f09e7ca94b Move build config table to separate files.
Move the build configuration table into separate files.  The Configurations
file is standard configs, and Configurations.team is for openssl-team
members.  Any other file, Configurations*, found in the same directory
as the Configure script, is loaded.

To add another file, use --config=FILE flags (which should probably be
an absolute path).

Written by Stefen Eissing <stefan.eissing@greenbytes.de> and Rich Salz
<rsalz@openssl.org>, contributed by Akamai Technologies.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-02-24 17:40:22 -05:00