summaryrefslogtreecommitdiffstats
path: root/Configurations/README
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-02-05 11:47:14 +0100
committerRichard Levitte <levitte@openssl.org>2016-02-06 17:57:19 +0100
commitc86ddbe61323e371f6ac88728581481a1aa6f0e6 (patch)
tree1cc940589c78f16480486d89223fb2a2775ac470 /Configurations/README
parentb438f0ed8f3ff1df59698b868e7bdbdaa215e7e1 (diff)
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>
Diffstat (limited to 'Configurations/README')
-rw-r--r--Configurations/README46
1 files changed, 34 insertions, 12 deletions
diff --git a/Configurations/README b/Configurations/README
index ecf2b7908b..fb94aa723e 100644
--- a/Configurations/README
+++ b/Configurations/README
@@ -39,25 +39,22 @@ In each table entry, the following keys are significant:
compiling for shared libraries, typically
something like "-fPIC".
- ld => the linker command, usually not defined
+ (linking is a complex thing, see [3] below)
+ ld => Linker command, usually not defined
(meaning the compiler command is used
instead).
(NOTE: this is here for future use, it's
not implemented yet)
- lflags => the flags that are used at all times when
- linking. These can have a % sign in them
- showing where the OpenSSL libraries should
- appear, otherwise these flags will come
- last. So in a typical links situation,
- this is a quick table of results:
-
- "-foo%-bar" > -foo -lssl -lcrypto -bar
- "-foo%" > -foo -lssl -lcrypto
- "-foo" > -lssl -lcrypto -foo
+ lflags => Flags that are used when linking apps.
+ shared_ldflag => Flags that are used when linking shared
+ or dynamic libraries.
+ plib_lflags => Extra linking flags to appear just before
+ the libraries on the command line.
+ ex_libs => Extra libraries that are needed when
+ linking.
debug_lflags => Like debug_cflags, but used when linking.
release_lflags => Like release_cflags, but used when linking.
- shared_lflags => Like shared_cflags, but used when linking.
ar => The library archive command, the default is
"ar".
@@ -253,6 +250,31 @@ In each table entry, the following keys are significant:
be "(unknown)", in which case the user MUST give some compilation
flags to Configure.
+[3] OpenSSL has three types of things to link from object files or
+ static libraries:
+
+ - shared libraries; that would be libcrypto and libssl.
+ - shared objects (sometimes called dynamic libraries); that would
+ be the engines.
+ - applications; those are apps/openssl and all the test apps.
+
+ Very roughly speaking, linking is done like this (words in braces
+ represent the configuration settings documented at the beginning
+ of this file):
+
+ shared libraries:
+ {ld} $(CFLAGS) {shared_ldflag} -shared -o libfoo.so \
+ -Wl,--whole-archive libfoo.a -Wl,--no-whole-archive \
+ {plib_lflags} -lcrypto {ex_libs}
+
+ shared objects:
+ {ld} $(CFLAGS) {shared_ldflag} -shared -o libeng.so \
+ blah1.o blah2.o {plib_lflags} -lcrypto {ex_libs}
+
+ applications:
+ {ld} $(CFLAGS) {lflags} -o app \
+ app1.o utils.o {plib_lflags} -lssl -lcrypto {ex_libs}
+
Historically, the target configurations came in form of a string with
values separated by colons. This use is deprecated. The string form