From 23e520143d94304c0d6cf977196bf388e817a345 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Sun, 25 Mar 2018 23:47:15 +0100 Subject: [PATCH 1/6] Make DLEXT var configurable in library/Makefile --- library/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/Makefile b/library/Makefile index de51e58ae..35c1fa377 100644 --- a/library/Makefile +++ b/library/Makefile @@ -35,9 +35,8 @@ SOEXT_TLS=so.10 SOEXT_X509=so.0 SOEXT_CRYPTO=so.0 -DLEXT=so -# OSX shared library extension: -# DLEXT=dylib +# Set DLEXT=dylib to compile as a shared library for Mac OS X +DLEXT ?= so # Windows shared library extension: ifdef WINDOWS_BUILD From b3ac0ff722932b61732af1298721554bc1ca2066 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Sun, 25 Mar 2018 23:48:39 +0100 Subject: [PATCH 2/6] Allow overriding ar param prefix in library/Makefile --- library/Makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/library/Makefile b/library/Makefile index 35c1fa377..cfb873c93 100644 --- a/library/Makefile +++ b/library/Makefile @@ -38,6 +38,10 @@ SOEXT_CRYPTO=so.0 # Set DLEXT=dylib to compile as a shared library for Mac OS X DLEXT ?= so +# Set AR_DASH= (empty string) to use an ar implentation that does not accept +# the - prefix for command line options (e.g. llvm-ar) +AR_DASH ?= - + # Windows shared library extension: ifdef WINDOWS_BUILD DLEXT=dll @@ -88,9 +92,9 @@ shared: libmbedcrypto.$(DLEXT) libmbedx509.$(DLEXT) libmbedtls.$(DLEXT) # tls libmbedtls.a: $(OBJS_TLS) echo " AR $@" - $(AR) -rc $@ $(OBJS_TLS) + $(AR) $(AR_DASH)rc $@ $(OBJS_TLS) echo " RL $@" - $(AR) -s $@ + $(AR) $(AR_DASH)s $@ libmbedtls.$(SOEXT_TLS): $(OBJS_TLS) libmbedx509.so echo " LD $@" @@ -111,9 +115,9 @@ libmbedtls.dll: $(OBJS_TLS) libmbedx509.dll # x509 libmbedx509.a: $(OBJS_X509) echo " AR $@" - $(AR) -rc $@ $(OBJS_X509) + $(AR) $(AR_DASH)rc $@ $(OBJS_X509) echo " RL $@" - $(AR) -s $@ + $(AR) $(AR_DASH)s $@ libmbedx509.$(SOEXT_X509): $(OBJS_X509) libmbedcrypto.so echo " LD $@" @@ -134,9 +138,9 @@ libmbedx509.dll: $(OBJS_X509) libmbedcrypto.dll # crypto libmbedcrypto.a: $(OBJS_CRYPTO) echo " AR $@" - $(AR) -rc $@ $(OBJS_CRYPTO) + $(AR) $(AR_DASH)rc $@ $(OBJS_CRYPTO) echo " RL $@" - $(AR) -s $@ + $(AR) $(AR_DASH)s $@ libmbedcrypto.$(SOEXT_CRYPTO): $(OBJS_CRYPTO) echo " LD $@" From 83bffd353e99f863e4e5dab2e74e07eef41c56ff Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Mon, 26 Mar 2018 00:15:21 +0100 Subject: [PATCH 3/6] Add ChangeLog entry for library/makefile changes --- ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 45c07fe04..1506b68b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ mbed TLS ChangeLog (Sorted per branch, date) += mbed TLS x.x.x branch released xxxx-xx-xx + +Changes + * Allow configuring the prefix operator for the archiver tool when compiling + the library using the makefile. Found and fixed by Alex Hixon. + * Allow configuring the shared library extension by setting the DLEXT + variable when using the project makefile. + = mbed TLS 2.1.11 branch released 2018-03-16 Default behavior changes From bc00667a90ea5873af72931ed95f6e4938d423ec Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 27 Mar 2018 19:14:24 +0100 Subject: [PATCH 4/6] Improve ChangeLog for DLEXT and AR_DASH changes --- ChangeLog | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1506b68b0..64d3c5259 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,10 +3,11 @@ mbed TLS ChangeLog (Sorted per branch, date) = mbed TLS x.x.x branch released xxxx-xx-xx Changes - * Allow configuring the prefix operator for the archiver tool when compiling - the library using the makefile. Found and fixed by Alex Hixon. + * Add an option in the makefile to support ar utilities where the operation + letter must not be prefixed by '-', such as LLVM. Found and fixed by + Alex Hixon. * Allow configuring the shared library extension by setting the DLEXT - variable when using the project makefile. + environment variable when using the project makefiles. = mbed TLS 2.1.11 branch released 2018-03-16 From 9b2c5b720291d5459aa8f02b659fc465fe1b594d Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 27 Mar 2018 19:17:21 +0100 Subject: [PATCH 5/6] Make DLEXT var configurable in programs and tests makefiles --- programs/Makefile | 2 +- tests/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/Makefile b/programs/Makefile index 544a2d8f9..db85eee0b 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -35,7 +35,7 @@ ifdef SHARED SHARED_SUFFIX=.$(DLEXT) endif else -DLEXT=so +DLEXT ?= so EXEXT= SHARED_SUFFIX= endif diff --git a/tests/Makefile b/tests/Makefile index e97887ae1..40e65fab0 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -35,7 +35,7 @@ ifdef SHARED SHARED_SUFFIX=.$(DLEXT) endif else -DLEXT=so +DLEXT ?= so EXEXT= SHARED_SUFFIX= endif From aa3ff98b1dc3079d0c367787b033633ffc557f49 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Tue, 27 Mar 2018 19:57:58 +0100 Subject: [PATCH 6/6] Fix shared library lookup on Mac OS X when running tests --- tests/scripts/run-test-suites.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/scripts/run-test-suites.pl b/tests/scripts/run-test-suites.pl index b91355d30..5b55faccd 100644 --- a/tests/scripts/run-test-suites.pl +++ b/tests/scripts/run-test-suites.pl @@ -11,6 +11,7 @@ die "$0: no test suite found\n" unless @suites; # in case test suites are linked dynamically $ENV{'LD_LIBRARY_PATH'} = '../library'; +$ENV{'DYLD_LIBRARY_PATH'} = '../library'; my $prefix = $^O eq "MSWin32" ? '' : './';