Re: makefile patches from MacPorts

Jeffrey Walton <[email protected]> Sun, 5 Apr 2015 20:01:42 -0400
Newsgroups gmane.comp.encryption.cryptlib
Message-ID <CAH8yC8kX1fSUTAd6o_3roCrWEF8PEG1eNs6msKsxv7NCcA9pPA@mail.gmail.com>
On Thu, Apr 2, 2015 at 11:41 PM, Ryan Schmidt <[email protected]> wrote:
> ...
> When creating the dylib, we remove the "@" at the beginning of the line, because the "@" suppresses the display of the actual command that's run, but seeing the actual command that's run is essential to figuring out why something isn't working. We had to add $(LDFLAGS) to this linker invocation, since the LDFLAGS we provide at the command line are needed. We also added the -install_name argument, specifying the absolute path to the library's final install location; this is required for OS X libraries; without this, programs linking with the library will not be able to find it. We introduce a new variable PREFIX to support this, and another later change. A default value for PREFIX should probably be set earlier in the makefile, such as PREFIX=/usr/local or PREFIX=/opt/cryptlib.
> ...
There's another hidden issue that's not readily apparent. That's
calling LD directly rather than allowing the compiler driver to invoke
it.

If someone tries to cross-compile out of the box by specifying CFLAGS
and CXXFLAGS (like CFLAGS += --sysroot=...), or someone uses Clang's
sanitizers to test the library (CFLAGS += -fsanitize=undefined
-fsanitize=address), then the linker will fail the link due to missing
libraries.

Passing sysroot and sanitizers through CFLAGS and CXXFLAGS and using
the compiler driver to invoke the linker ensures everything is passed
correctly. You can do it invoking LD directly, its just much more
painful.

I perform sanitizer checks and cross compiles frequently on libraries.
This is a recurring problem in nearly every library I acceptance test
and port.

_______________________________________________
Cryptlib mailing list
[email protected] via Mail: [email protected]
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.