Check-in [fa022cbc5d]
Overview
Comment:More work towards getting Mac OS X to export only the symbols we care about
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fa022cbc5d3145d5a144087402b5d567edbf5a4a
User & Date: rkeene on 2011-09-08 03:42:02
Other Links: manifest | tags
Context
2011-09-08
03:48
CACKey 0.6.5 check-in: ed5f20c85e user: rkeene tags: 0.6.5, trunk
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: 0.6.4, trunk

Changes

Modified Makefile.in from [62d627a191] to [6f86f7629d].

51
52
53
54
55
56
57
58

59
60
61
62
63
51
52
53
54
55
56
57

58
59
60
61
62
63







-
+





	rm -f libcackey.@SHOBJEXT@.def libcackey_g.@SHOBJEXT@.def
	rm -f libcackey.@SHOBJEXT@.a libcackey_g.@SHOBJEXT@.a
	rm -f cackey.o cackey_g.o
	rm -f test
	rm -f splint-cackey.txt

distclean: clean
	rm -f config.log config.status config.h Makefile
	rm -f config.log config.status config.h Makefile libcackey.syms

mrproper: distclean
	rm -f configure config.h.in aclocal.m4 *~

.PHONY: all clean distclean mrproper install

Modified aclocal/dc_versionscript.m4 from [7b1ee0452b] to [4ebe0b5820].

1
2








3
4
5
6
7
8

9
10
11
12
13
14
15




16
17
18
19
20
21
22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34


+
+
+
+
+
+
+
+





-
+







+
+
+
+







AC_DEFUN(DC_SETVERSIONSCRIPT, [
	VERSIONSCRIPT="$1"
	SYMFILE="$2"

	delete_symfile='0'
	if test ! -f "${SYMFILE}"; then
		delete_symfile='1'

		echo '' > "${SYMFILE}"
	fi

	SAVE_LDFLAGS="${LDFLAGS}"

	AC_MSG_CHECKING([for how to set version script])

	for tryaddldflags in "-Wl,--version-script -Wl,${VERSIONSCRIPT}"; do
	for tryaddldflags in "-Wl,--version-script -Wl,${VERSIONSCRIPT}" "-Wl,-exported_symbols_list -Wl,${SYMFILE}"; do
		LDFLAGS="${SAVE_LDFLAGS} ${tryaddldflags}"
		AC_TRY_LINK([], [], [
			addldflags="${tryaddldflags}"

			break
		])
	done

	if test "${delete_symfile}" = "1"; then
		rm -f "${SYMFILE}"
	fi

	if test -n "${addldflags}"; then
		LDFLAGS="${SAVE_LDFLAGS} ${addldflags}"
		AC_MSG_RESULT($addldflags)
	else
		LDFLAGS="${SAVE_LDFLAGS}"
		AC_MSG_RESULT([don't know])
32
33
34
35
36
37
38

39
40
41
42


43
44
45
46
47
48
49
50
51
52
53
54
55

56
44
45
46
47
48
49
50
51
52
53
54

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71







+



-
+
+













+


	if test "x${STRIP}" = "xfalse"; then
		STRIP="${OBJCOPY}"
	fi

	WEAKENSYMS='true'
	REMOVESYMS='true'
	SYMPREFIX=''

	case $host_os in
		darwin*)
			REMOVESYMS="${STRIP} -s ${SYMFILE}"
			REMOVESYMS="${STRIP} -i -u -s ${SYMFILE}"
			SYMPREFIX="_"
			;;
		*)
			if test "x${OBJCOPY}" != "xfalse"; then
				WEAKENSYMS="${OBJCOPY} --keep-global-symbols=${SYMFILE}"
				REMOVESYMS="${OBJCOPY} --discard-all"
			elif test "x${STRIP}" != "xfalse"; then
				REMOVESYMS="${STRIP} -x"
			fi
			;;
	esac

	AC_SUBST(WEAKENSYMS)
	AC_SUBST(REMOVESYMS)
	AC_SUBST(SYMPREFIX)
])

Modified configure.ac from [f51a90fd29] to [108697b5ff].

139
140
141
142
143
144
145
146

147
148
149
150
151
152
153
154
155

139
140
141
142
143
144
145

146
147
148
149
150
151
152
153
154

155







-
+








-
+
		AC_MSG_RESULT(failed)

		AC_MSG_FAILURE([simple PC/SC program failed])
	]
)

dnl Set version script, to limit the scope of symbols
DC_SETVERSIONSCRIPT(libcackey.vers)
DC_SETVERSIONSCRIPT(libcackey.vers, libcackey.syms)

dnl Upate LDFLAGS to include setting the run-time linker path to the same as our compile-time linker
DC_SYNC_RPATH

dnl If we updated LIBOBJS, update SHLIBOBJS -- must be last.
DC_SYNC_SHLIBOBJS

dnl Produce Makefile
AC_OUTPUT(Makefile)
AC_OUTPUT(Makefile libcackey.syms)

Renamed and modified libcackey.syms [cfac1b7560] to libcackey.syms.in [546f0d7df5].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68








































































































































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