> Hmm, OK. Won’t impact me, as I don’t use non-Apple clang any more, but makes
> sense for the Crypto++ distro.

Check it out... I'm on OS X 10.8.5, fully patched. No more "clang
version" string - only "clang" string:

$ g++ -v
Configured with:
--prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix

$ g++ --version
Configured with:
--prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix

Sadly, I'm the guy who gave the string to Wei :( Its was around 2011
or 2012, back when Apple provided Clang, and the version string was
something like "Apple clang version ...". Now its "Apple LLVM ..."
with a Clang version number. And if you build from scratch (or use a
distro), its only "clang" string.

> # These are required on newer Mac OS X, as somehow they aren't set
> # up automatically even when the native CPU supports them.
> CXXFLAGS += -maes -mpclmul -mavx2

I'm still using older stuff. I refused the OS X 10.9 upgrade because
of moving the KeyChain to the iCloud. I don't do clouds.

Do you know of any OS X machines that are [internet] accessible to test on?

> It does not need CXXFLAGS (I think) because it’s linking only. Thanks for
> catching missing LDFLAGS! I’ve added them.

The compiler driver (CXX) is invoking the linker (LD). The compiler
driver will pick up some flags and automatically perform some linker
magic (like implicitly adding libraries). To convince yourself, change
CXXFLAGS to:

    CXXFLAGS += -stdlib=libc++
    CXXFLAGS += -fsanitize=undefined

And let me know how linking goes ;) You can test it with a `make dynamic`.

> I abhor “-arch x86_64 -arch i386”

I've kinda grown to like it. The fat binaries make it easy to a
library to a project. Maybe I'm getting too lazy in my old age.

Jeff

On Sun, Jan 4, 2015 at 11:39 PM, Mobile Mouse <[email protected]> wrote:
> On Jan 4, 2015, at 21:14 , Jeffrey Walton <[email protected]> wrote:
>
> Hi Mouse,
>
> I'd suggest a couple of small corrections here…
>
>
> Thank you!
>
> Change:
>     CXX=g++
> to:
>      CXX ?= g++
>
> That keeps the makefile from stepping on the compiler set in the
> environment. If its not set, then the  assignment is performed. Its
> particularly painful when cross-compiling.
>
>
> Great point! I’ll do that, and hope Jean-Pierre will do the same.
>
> Ditto for RANLIB.
>
>
> Same.
>
> Change:
>     CLANG_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang
> version")
> To:
>     CLANG_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang”)
>
>
> Hmm, OK. Won’t impact me, as I don’t use non-Apple clang any more, but makes
> sense for the Crypto++ distro.
>
> Apple uses "clang version", while building it from sources does not. So if
> you built your own Clang or used one from a distro, then its usually
> mis-identified.
>
>
> Yeah…
>
> You should make the above change and then try Mac OS X again and see if you
> have the same problems with the assembler.
>
>
> What do you mean? That I wouldn’t need to manually add those “-maes
> -mpclmul” flags? I don’t think so. I’ve experimented on other (not CryptoPP)
> files, and haven’t found a way to have those flags on unless explicitly set.
>
> Am I missing anything here?
>
> Oh, and with the above (and below :) changes it still works fine on Mac OS X
> 10.9.5 (Xcode 6.1).
>
> -Os is usually more useful than -O2 or -O3 because it keeps the code tighter
> and caches hotter.
>
>
> Changed in my makefile, hope Jean-Pierre will do the same. Haven’t noticed
> size changes, haven’t run the benchmarks (yet).
>
> libcryptopp.so target is missing both CXXFLAGS and LDFLAGS.
>
>
> It does not need CXXFLAGS (I think) because it’s linking only. Thanks for
> catching missing LDFLAGS! I’ve added them.
>
>
> By the way, here's a diff of the Makefile I use (it has a few more
> changes):http://pastebin.com/xCYekFQ0
>
>
> Thanks, but no thanks. :-)
>
> I abhor “-arch x86_64 -arch i386”
>
> Here’s the updated makefile:
> ...

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to