Re: Compiling on Mac OS X UNIX

1 view
Skip to first unread message

Indridi Bjornsson

unread,
Apr 15, 2002, 2:08:11 PM4/15/02
to crypto...@eskimo.com

Hi Adam.

You need to use the flag -fno-coalesce-static-vtables in order to link
correctly on MacOS X.
Add this to the GNUmakefile:

----- cut here -----
ifeq ($(UNAME),Darwin) # for MacOS X, c++ compiler from Apple (based on
gcc version 2.95.2)
CXX = c++
CXXFLAGS += -fno-coalesce-static-vtables
endif
----- cut here -----

Just below:
ifeq ($(UNAME),SunOS)
LDLIBS = -lnsl -lsocket
endif

And cryptest.exe should link and run correct.

Regards,
Indridi

Adam Dershowitz

unread,
Apr 15, 2002, 5:10:13 PM4/15/02
to crypto...@eskimo.com, Indridi Bjornsson
Thanks,
That actually does not do the job. But I did find a solution. It
seems that there were two different problems.
1) I need -fno-coalesce-templates (instead of the suggestion below)
2) I also needed to explicitly link with stdc++, by adding to the
build line -lstdc++

I was able to search around, and find that 1) is due to a bug in the
mac compiler. And part of the bug is that this flag is not
compatible with -O2 so I can't build an optimized version.
I am not sure why I need 2) and it is not in the make file, but it
does the job.

again thanks Indridi,

--Adam

Indridi Bjornsson

unread,
Apr 16, 2002, 7:17:09 AM4/16/02
to crypto...@eskimo.com
Hi Adam.

I admit that I haven't tried to compile an optimized version of
cryptest.exe but I was able to compile a debug version using the
-fno-coalesce-static-vtables. I didn't need to add stdc++ library. I did
run the "cryptest.exe v" and it passed all tests.

I was compiling the 4.2 version of cryptlib on MacOS-X version 10.1.3
using
gcc version gcc-932.1, based on gcc version 2.95.2 19991024 (release).

I vaguely remember that with one project I had on MacOS-X I needed to
add stdc++ library. If I can remember it correctly it was because I was
using fstream.

Regards,
Indridi

Reply all
Reply to author
Forward
0 new messages