Check-in [521abe23e2]
Overview
Comment:CACKey 0.6.4

Moved determining how to weaken and strip symbols into an autoconf macro

Added support for stripping symbols to Mac OS X builds

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | 0.6.4
Files: files | file ages | folders
SHA1:521abe23e2c179bdeb1f870d690ee7f18b61d757
User & Date: rkeene on 2011-09-08 03:01:24
Other Links: manifest | tags
Context
2011-09-08
03:42
More work towards getting Mac OS X to export only the symbols we care about check-in: fa022cbc5d user: rkeene tags: trunk
03:01
CACKey 0.6.4

Moved determining how to weaken and strip symbols into an autoconf macro

Added support for stripping symbols to Mac OS X builds check-in: 521abe23e2 user: rkeene tags: trunk, 0.6.4

01:51
CACKey 0.6.3

Fixed typo in last commit check-in: 9d554f2765 user: rkeene tags: trunk, 0.6.3

Changes

Modified Makefile.in from [5df2f0ed55] to [62d627a191].

     5      5   DEBUGCPPFLAGS = @CPPFLAGS@ -DCACKEY_DEBUG=1 -I./pkcs11/ @DEFS@
     6      6   LDFLAGS = @LDFLAGS@
     7      7   LIBS = @LIBS@ @PTHREAD_LIBS@
     8      8   SHOBJFLAGS = @SHOBJFLAGS@
     9      9   SHOBJLDFLAGS = @SHOBJLDFLAGS@
    10     10   AR = @AR@
    11     11   RANLIB = @RANLIB@
    12         -STRIP = @STRIP@
    13         -OBJCOPY = @OBJCOPY@
    14     12   prefix = @prefix@
    15     13   exec_prefix = @exec_prefix@
    16     14   libdir = @libdir@
    17     15   @SET_MAKE@
    18     16   
    19     17   all:
    20     18   	$(MAKE) libcackey.@SHOBJEXT@
................................................................................
    24     22   	$(CC) $(SHOBJFLAGS) $(CPPFLAGS) $(CFLAGS) -o cackey.o -c cackey.c
    25     23   
    26     24   cackey_g.o: cackey.c cackey_builtin_certs.h sha1.c sha1.h md5.c md5.h asn1-x509.c asn1-x509.h config.h
    27     25   	$(CC) $(SHOBJFLAGS) $(DEBUGCPPFLAGS) $(DEBUGCFLAGS) -o cackey_g.o -c cackey.c
    28     26   
    29     27   libcackey.@SHOBJEXT@: cackey.o
    30     28   	$(CC) $(SHOBJFLAGS) $(CPPFLAGS) $(CFLAGS) $(SHOBJLDFLAGS) $(LDFLAGS) -o libcackey.@SHOBJEXT@ cackey.o $(LIBS)
    31         -	-$(OBJCOPY) --wildcard --keep-global-symbol 'C_*' libcackey.@SHOBJEXT@
    32         -	-$(STRIP) -x "libcackey.@SHOBJEXT@"
           29  +	-@WEAKENSYMS@ "libcackey.@SHOBJEXT@"
           30  +	-@REMOVESYMS@ "libcackey.@SHOBJEXT@"
    33     31   
    34     32   libcackey_g.@SHOBJEXT@: cackey_g.o
    35     33   	$(CC) $(SHOBJFLAGS) $(DEBUGCPPFLAGS) $(DEBUGCFLAGS) $(SHOBJLDFLAGS) $(LDFLAGS) -o libcackey_g.@SHOBJEXT@ cackey_g.o $(LIBS)
    36         -	-$(OBJCOPY) --wildcard --keep-global-symbol 'C_*' libcackey.@SHOBJEXT@
           34  +	-@WEAKENSYMS@ "libcackey_g.@SHOBJEXT@"
    37     35   
    38     36   test: test.c libcackey_g.@SHOBJEXT@
    39     37   	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test test.c -Wl,-R,. libcackey_g.@SHOBJEXT@
    40     38   
    41     39   splint-cackey.txt: cackey.c cackey_builtin_certs.h asn1-x509.c asn1-x509.h config.h
    42     40   	splint $(DEBUGCPPFLAGS) -DCACKEY_PARANOID=1 -weak +posixlib -I/usr/include/PCSC -Ipkcs11 cackey.c > splint-cackey.txt
    43     41   

Modified aclocal/dc_versionscript.m4 from [1249f626fd] to [7b1ee0452b].

    18     18   		LDFLAGS="${SAVE_LDFLAGS} ${addldflags}"
    19     19   		AC_MSG_RESULT($addldflags)
    20     20   	else
    21     21   		LDFLAGS="${SAVE_LDFLAGS}"
    22     22   		AC_MSG_RESULT([don't know])
    23     23   	fi
    24     24   ])
           25  +
           26  +AC_DEFUN(DC_FIND_STRIP_AND_REMOVESYMS, [
           27  +	SYMFILE="$1"
           28  +
           29  +	dnl Determine how to strip executables
           30  +	AC_CHECK_TOOL(OBJCOPY, objcopy, [false])
           31  +	AC_CHECK_TOOL(STRIP, strip, [false])
           32  +
           33  +	if test "x${STRIP}" = "xfalse"; then
           34  +		STRIP="${OBJCOPY}"
           35  +	fi
           36  +
           37  +	WEAKENSYMS='true'
           38  +	REMOVESYMS='true'
           39  +
           40  +	case $host_os in
           41  +		darwin*)
           42  +			REMOVESYMS="${STRIP} -s ${SYMFILE}"
           43  +			;;
           44  +		*)
           45  +			if test "x${OBJCOPY}" != "xfalse"; then
           46  +				WEAKENSYMS="${OBJCOPY} --keep-global-symbols=${SYMFILE}"
           47  +				REMOVESYMS="${OBJCOPY} --discard-all"
           48  +			elif test "x${STRIP}" != "xfalse"; then
           49  +				REMOVESYMS="${STRIP} -x"
           50  +			fi
           51  +			;;
           52  +	esac
           53  +
           54  +	AC_SUBST(WEAKENSYMS)
           55  +	AC_SUBST(REMOVESYMS)
           56  +])

Modified configure.ac from [6faadc7dde] to [f51a90fd29].

     1         -AC_INIT(cackey, 0.6.3) 
            1  +AC_INIT(cackey, 0.6.4) 
     2      2   AC_CONFIG_HEADERS(config.h)
     3      3   
     4      4   dnl Locate standard tools
     5      5   AC_PROG_CC
     6      6   AC_PROG_MAKE_SET
     7      7   AC_PROG_INSTALL
     8      8   AC_AIX
................................................................................
    18     18   	AC_MSG_WARN([Can not figure out how to compile with pthreads support, run-time will likely fail.])
    19     19   ])
    20     20   
    21     21   dnl Determine how to create static archives on this platform
    22     22   AC_CHECK_TOOL(AR, ar)
    23     23   AC_CHECK_TOOL(RANLIB, ranlib)
    24     24   
    25         -dnl Determine how to strip executables
    26         -AC_CHECK_TOOL(OBJCOPY, objcopy)
    27         -AC_CHECK_TOOL(STRIP, strip, [$OBJCOPY])
           25  +dnl Determine how to strip executables and remove symbols
           26  +DC_FIND_STRIP_AND_REMOVESYMS(libcackey.syms)
    28     27   
    29     28   dnl Check for all required headers
    30     29   AC_CHECK_HEADERS(arpa/inet.h inttypes.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/socket.h sys/types.h sys/un.h time.h unistd.h pthread.h zlib.h limits.h,,[
    31     30   	AC_WARN([Required header missing, compilation will likely fail.])
    32     31   ], [
    33     32   #ifdef HAVE_ARPA_INET_H
    34     33   #  include <arpa/inet.h>

Added libcackey.syms version [cfac1b7560].

            1  +C_CancelFunction
            2  +C_CloseAllSessions
            3  +C_CloseSession
            4  +C_CopyObject
            5  +C_CreateObject
            6  +C_Decrypt
            7  +C_DecryptDigestUpdate
            8  +C_DecryptFinal
            9  +C_DecryptInit
           10  +C_DecryptUpdate
           11  +C_DecryptVerifyUpdate
           12  +C_DeriveKey
           13  +C_DestroyObject
           14  +C_Digest
           15  +C_DigestEncryptUpdate
           16  +C_DigestFinal
           17  +C_DigestInit
           18  +C_DigestKey
           19  +C_DigestUpdate
           20  +C_Encrypt
           21  +C_EncryptFinal
           22  +C_EncryptInit
           23  +C_EncryptUpdate
           24  +C_Finalize
           25  +C_FindObjects
           26  +C_FindObjectsFinal
           27  +C_FindObjectsInit
           28  +C_GenerateKey
           29  +C_GenerateKeyPair
           30  +C_GenerateRandom
           31  +C_GetAttributeValue
           32  +C_GetFunctionList
           33  +C_GetFunctionStatus
           34  +C_GetInfo
           35  +C_GetMechanismInfo
           36  +C_GetMechanismList
           37  +C_GetObjectSize
           38  +C_GetOperationState
           39  +C_GetSessionInfo
           40  +C_GetSlotInfo
           41  +C_GetSlotList
           42  +C_GetTokenInfo
           43  +C_InitPIN
           44  +C_InitToken
           45  +C_Initialize
           46  +C_Login
           47  +C_Logout
           48  +C_OpenSession
           49  +C_SeedRandom
           50  +C_SetAttributeValue
           51  +C_SetOperationState
           52  +C_SetPIN
           53  +C_Sign
           54  +C_SignEncryptUpdate
           55  +C_SignFinal
           56  +C_SignInit
           57  +C_SignRecover
           58  +C_SignRecoverInit
           59  +C_SignUpdate
           60  +C_UnwrapKey
           61  +C_Verify
           62  +C_VerifyFinal
           63  +C_VerifyInit
           64  +C_VerifyRecover
           65  +C_VerifyRecoverInit
           66  +C_VerifyUpdate
           67  +C_WaitForSlotEvent
           68  +C_WrapKey