Commit graph

610 commits

Author SHA1 Message Date
Richard Levitte
ef2dfc9902 Refactor linker script generation
The generation of linker scripts was badly balanced, as all sorts of
platform dependent stuff went into the top build.info, when that part
should really be made as simply and generic as possible.

Therefore, we move a lot of the "magic" to the build files templates,
since they are the place for platform dependent things.  What remains
is to parametrize just enough in the build.info file to generate the
linker scripts correctly for each associated library.

"linker script" is a term usually reserved for certain Unix linkers.
However, we only use them to say what symbols should be exported, so
we use the term loosely for all platforms.  The internal extension is
'.ld', and is changed by the build file templates as appropriate for
each target platform.

Note that this adds extra meaning to the value of the shared_target
attribute.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7333)
2018-10-01 09:49:16 +02:00
agnosticdev
46d085096c typo-fixes: miscellaneous typo fixes
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/7277)
2018-09-21 23:55:22 +02:00
Richard Levitte
f09877c12c VMS libtestutil: look for lower case "main"
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7208)
2018-09-14 11:00:38 +02:00
Richard Levitte
2935f6241c VMS: turn on name mangling for all our programs
With the change to have separate object files by intent, VMS name
mangling gets done differently.  While we previously had that for
libraries only, we must now turn that on generally for our programs,
because some of them depend in internal libraries where mangled names
are all that there is.

Dynamic modules are still built with non-mangled names, which is good
enough to show that it's possible to build with our public libraries
using our public headers.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7208)
2018-09-14 11:00:38 +02:00
Richard Levitte
c40af30ec5 VMS build: fix a misspelled 'bin_cflags' and a wrongly coded 'NO_INST_'
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7208)
2018-09-14 11:00:38 +02:00
Richard Levitte
aa343982d2 Update the documentation on libobj2shlib / obj2shlib
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7198)
2018-09-13 00:41:21 +02:00
Richard Levitte
f619622715 VMS: stop trying to build shared libraries from static ones
The possibility to do this was killed when we started producing object
file names with encoded intention (and possibly different builds), and
leads to build errors.

With that, 'libobj2shlib' is renamed to 'obj2shlib' to reflect this
design change.  The old name is still used if the new one isn't
available, for the sake of backward compatibility.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7198)
2018-09-13 00:41:21 +02:00
Richard Levitte
9dfc868025 Build files: Separate 'lib' intent from 'shlib' intent
This is in preparation for having separate CFLAGS variables for static
and for shared library builds.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7159)
2018-09-12 01:59:46 +02:00
Richard Levitte
bec2db1809 Configure: Name object files according to the product they are part of
This will allow to have different object files for different products,
even if they share the same source code, and possibly different builds
for those different object files.

For example, one can have something like this:

    SOURCES[libfoo]=cookie.c
    INCLUDES[libfoo]=include/foo
    SOURCES[libbar]=cookie.c
    INCLUDES[libbar]=include/bar

This would mean that the object files and libraries would be build
somewhat like this:

    $(CC) -Iinclude/foo -o libfoo-lib-cookie.o cookie.c
    $(AR) $(ARFLAGS) libfoo.a libfoo-lib-cookie.o
    $(CC) -Iinclude/bar -o libbar-lib-cookie.o cookie.c
    $(AR) $(ARFLAGS) libbar.a libbar-lib-cookie.o

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7159)
2018-09-12 01:59:45 +02:00
Richard Levitte
609e4be88e Configure: DON'T trickle down includes from products to sources
Instead, use the include settings from the products later in the process,
making it possible to have different includes for two different libraries
that share the same source code.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7159)
2018-09-12 01:59:45 +02:00
Andy Polyakov
d573ff1793 Configurations/unix-Makefile.tmpl: address find portability issue.
-path is non-portable extension, fortunately it's possible to express
.git subdirectory exclusion with -prune.

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7004)
2018-08-24 18:56:24 +02:00
Richard Levitte
9f9a7d60ad Configuration/15-android.conf: slightly move NDK canonisation
This allows the original path to be displayed when it's shown
to be invalid, so the user can relate without question.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6925)
2018-08-12 14:47:05 +02:00
Richard Levitte
18174ba8a3 Configurations/15-android.conf: Make sure that the NDK path is canonical
Extra slashes in paths are permissible in Unix-like platforms...
however, when compared with the result from 'which', which returns
canonical paths, the comparison might fail even though the compared
paths may be equivalent.  We make the NDK path canonical internally to
ensure the equivalence compares as equal, at least for the most
trivial cases.

Fixes #6917

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6924)
2018-08-12 10:19:23 +02:00
Bernd Edlinger
d8a4f8ffd0 Fix uninitialized value $s warning in windows static builds
Fixes: #6826

[extended tests]

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6833)
2018-08-02 19:33:47 +02:00
Andy Polyakov
793f19e47c 00-base-templates.conf: engage x25519-ppc64 module.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6782)
2018-07-26 14:02:31 +02:00
Richard Levitte
8937a4ed8a Configure: print generic advice when dying
On the same note, change the 'NASM not found' message to give specific
advice on how to handle the failure.

Fixes #6765

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6771)
2018-07-24 16:27:50 +02:00
Richard Levitte
d8356e1b0f Make sure the 'tsget' script is called 'tsget.pl' everywhere
The result is that we don't have to produce different names on
different platforms, and we won't have confusion on Windows depending
on if the script was built with mingw or with MSVC.

Partial fix for #3254

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6764)
2018-07-23 18:33:48 +02:00
Richard Levitte
1b6a0a261e Windows: avoid using 'rem' in the nmake makefile
To avoid the possibility that someone creates rem.exe, rem.bat or
rem.cmd, simply don't use it.  In the cases it was used, it was to
avoid empty lines, but it turns out that nmake handles those fine, so
no harm done.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/6686)
2018-07-11 14:49:02 +02:00
Richard Levitte
9abce88b4b Windows: fix echo for nmake
It seems that nmake first tries to run executables on its own, and
only pass commands to cmd if that fails.  That means it's possible to
have nmake run something like 'echo.exe' when the builtin 'echo'
command was expected, which might give us unexpected results.

To get around this, we create our own echoing script and call it
explicitly from the nmake makefile.

Fixes #6670

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/6686)
2018-07-11 14:49:02 +02:00
Bernd Edlinger
fb853fa245 Fix minor windows build issues
[extended tests]

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6661)
2018-07-09 19:18:27 +02:00
Richard Levitte
9e26532295 Keep supporting the env / make variable PERL
OpenSSL 1.1.0 supports the use of this environment variable for
passing to the build files.  For the sake of backward compatibility,
we keep it.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/6668)
2018-07-09 09:21:36 +02:00
Andy Polyakov
8f29569ef3 Configurations/10-main.conf: always pass -bsrv4 to AIX linker.
This makes AIX build procedure behave more like e.g. Solaris. Most
notably this makes it possible to pass -Wl,-R,'$(LIBRPATH)' at config
time to embed installation destination as library search path into
openssl binary. This doesn't imply that other applications have to be
linked with -bsvr4, they are free to choose whatever appropriate for
given circumstances.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6487)
2018-06-22 10:57:31 +02:00
Andy Polyakov
cff89b179c Configurations/unix-Makefile.tmpl: switch to "natural" AIX shared libraries.
AIX treats its shared libraries in unique manner, by placing multiple
shared objects of different versions and bitnesses, into .a file.
So far we have been naively linking with version-less libcrypto|ssl.so,
which poses long-term maintenance problems. One could choose to link
straight with libcrypto.so.X.Y [or libcrypto.X.Y.so], but it would be
inconsistent with the way AIX [or Unix] does things.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6487)
2018-06-22 10:57:01 +02:00
Andy Polyakov
1b712f3fe4 Configurations/10-main.conf: IRIX configs unification.
Add irix-common template that covers even irix-shared from shared-info.pl.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6536)
2018-06-21 14:05:28 +02:00
Dr. Matthias St. Pierre
c4fad5d348 Improve the output of make doc-nits
- Print positive feedback in the case when 'make doc-nits' finds no errors.
- Other than before, keep the 'doc-nits' output file only in case of errors
  and remove it if it is empty.
- Declare 'doc-nits' as a phony make target to facilitate rerunning
  'make doc-nits' without having to remove the output file first.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6517)
2018-06-19 17:13:03 +02:00
Andy Polyakov
82b6b0848c Configurations/10-main.conf: improve Makefile readability on AIX and Solaris.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6477)
2018-06-14 21:24:38 +02:00
Andy Polyakov
0ef40b76e7 Configurations/10-main.conf: move hpux-shared flags to hpux-common.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6477)
2018-06-14 21:23:40 +02:00
Andy Polyakov
d3273ef6c5 Configurations/10-main.conf: replace -bexpall with explicit list on AIX.
[omit even -b:SRE, as it's implied by -G flag.]

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6453)
2018-06-13 10:48:27 +02:00
Andy Polyakov
10aafed3ec Configurations/10-main.conf: AIX configs unification.
Add aix-common template that covers even aix-shared from shared-info.pl,
add -bsymbolic to shared_ldflags.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6453)
2018-06-13 10:48:14 +02:00
Andy Polyakov
dbb85890a8 Configurations/10-main.conf: reinstate soname on Solaris.
The flag was apparently omitted in switch from Makefile.shared to
shared-info.pl. Do put it back! And in the process move all
solaris-shared flags from shared-info.pl to solaris-common.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6446)
2018-06-13 10:43:37 +02:00
Richard Levitte
aa6cc8d33c make errors: use the new util/ck_errf.pl options
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6461)
2018-06-12 12:31:45 +02:00
Andy Polyakov
c8a56217f9 Configurations/*.conf: ios targets face-lift.
Move ios targets to 15-ios.conf and modernize by deploying xcrun.
This excuses user from looking for paths and setting environment
variables. [Thanks to @0neday for hint.]

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6410)
2018-06-08 16:34:24 +02:00
Richard Levitte
246bd8fd05 Windows: don't install __DECC_*.H
This adds the possibility to exclude files by regexp in util/copy.pl

Partial fix for #3254

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6303)
2018-05-20 10:13:08 +02:00
Andy Polyakov
0d9b5fa3b4 windows-makefile.tmpl: delete export library prior link.
LINK can outsmart itself and choose to not update export .lib upon
corresponding .dll re-link. Since dependency is between .lib and all
.obj-s, re-compilation of any .obj makes NMAKE relink .dll and all
.exe-s over and over...

Reviewed-by: Rich Salz <rsalz@openssl.org>
2018-05-15 21:17:03 +02:00
FdaSilvaYY
4ffc1842fa windows-makefile.tmpl: rearrange cleanup commands to avoid ...
deletion of *.exp files in krb5 sub-module.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6186)
2018-05-07 17:16:09 +02:00
Andy Polyakov
0ad4078cd6 Configure: move --noexecstack probe to Configure.
config probe doesn't work in cross-compile scenarios or with clang.
In addition consolidate -Qunused-arguments handling.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6174)
2018-05-05 20:44:56 +02:00
Andy Polyakov
06444da464 Configurations/unix-Makefile.tmpl: harmonize with no-engine.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6106)
2018-04-29 21:39:00 +02:00
Andy Polyakov
7069eaee23 Configurations/10-main.conf: force no-engine on ios targets.
Rationale for enforcing no-engine is because of disconnect between
compile-time config and run-time, which is a per-application sandbox
directory which one can't predict in advance. Besides, none of the
bundled engines actually give an edge on iOS...

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6106)
2018-04-29 21:30:02 +02:00
Matt Caswell
ac98d38602 Don't build AFALG on android
This didn't get built anyway for gcc because it was detected as a cross
compile. But it did get built for clang - even though this is still a cross
compile build. This disables it in all cases for Android.

Fixes #5748

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/6057)
2018-04-24 09:51:56 +01:00
Andy Polyakov
40ab6b8567 00-base-templates.conf: wire keccak1600-armv4 module.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6042)
2018-04-23 17:27:58 +02:00
Andy Polyakov
3571069526 00-base-templates.conf: wire keccak1600-ppc64 module.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6042)
2018-04-23 17:27:49 +02:00
Andy Polyakov
fe46035dbe 00-base-templates.conf: wire keccak1600-s390x module.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6042)
2018-04-23 17:27:45 +02:00
Andy Polyakov
eefc485bda 00-base-templates.conf: wire keccak1600-armv8 module.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6042)
2018-04-23 17:27:40 +02:00
Andy Polyakov
1018a7251e 00-base-templates.conf: wire keccak1600-x86_64 module.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6042)
2018-04-23 17:27:36 +02:00
Andy Polyakov
e4739e31ee Configure: add $target{keccak1600_asm_src}.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6042)
2018-04-23 17:26:54 +02:00
Richard Levitte
918388b5a0 Don't distribute team internal config targets
Configurations/90-team.conf isn't for public consumption, so we rename
it to 90-team.norelease.conf and make sure 'make dist' and 'make tar'
don't include it in the tarball.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5836)
2018-04-19 15:02:19 +02:00
Bernd Edlinger
90b3a620f5 Remove mandatory generated files on VMS too
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5958)
2018-04-16 17:30:21 +02:00
Bernd Edlinger
cf54d00aa8 Remove mandatory generated files on windows too
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5958)
2018-04-16 17:30:21 +02:00
Bernd Edlinger
b0a97931fb Remove mandatory generated files too
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5951)
2018-04-15 08:13:38 +02:00
Bernd Edlinger
49bb4dd049 Fix cygwin make dependencies
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5951)
2018-04-15 08:13:37 +02:00