Skip to content

Commit d7cb92a

Browse files
committed
merge bitcoin#28783: remove -bind_at_load usage
1 parent 019c9dd commit d7cb92a

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

configure.ac

+11-1
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,6 @@ dnl "ad_strip" as the symbol for the entry point.
10471047
if test x$TARGET_OS = xdarwin; then
10481048
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"],, [[$LDFLAG_WERROR]])
10491049
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip_dylibs]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"],, [[$LDFLAG_WERROR]])
1050-
AX_CHECK_LINK_FLAG([[-Wl,-bind_at_load]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-bind_at_load"],, [[$LDFLAG_WERROR]])
10511050
AX_CHECK_LINK_FLAG([[-Wl,-fixup_chains]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-fixup_chains"], [], [[$LDFLAG_WERROR]])
10521051
fi
10531052

@@ -1956,6 +1955,17 @@ case ${OS} in
19561955
;;
19571956
esac
19581957

1958+
dnl An old hack similar to a98356fee to remove hard-coded
1959+
dnl bind_at_load flag from libtool
1960+
case $host in
1961+
*darwin*)
1962+
AC_MSG_RESULT([Removing -Wl,bind_at_load from libtool.])
1963+
sed < libtool > libtool-2 '/bind_at_load/d'
1964+
mv libtool-2 libtool
1965+
chmod 755 libtool
1966+
;;
1967+
esac
1968+
19591969
echo
19601970
echo "Options used to compile and link:"
19611971
echo " boost process = $with_boost_process"

contrib/devtools/test-security-check.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ def test_MACHO(self):
129129
(1, executable+': failed NOUNDEFS PIE CONTROL_FLOW'))
130130
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-Wl,-fixup_chains']),
131131
(1, executable+': failed PIE CONTROL_FLOW'))
132-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-bind_at_load','-fstack-protector-all', '-Wl,-fixup_chains']),
132+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-Wl,-fixup_chains']),
133133
(1, executable+': failed PIE CONTROL_FLOW'))
134-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-bind_at_load','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']),
134+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']),
135135
(1, executable+': failed PIE'))
136-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie','-Wl,-bind_at_load','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']),
136+
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']),
137137
(0, ''))
138138
else:
139139
# arm64 darwin doesn't support non-PIE binaries, control flow or executable stacks
@@ -143,7 +143,7 @@ def test_MACHO(self):
143143
(1, executable+': failed NOUNDEFS Canary'))
144144
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fstack-protector-all', '-Wl,-fixup_chains']),
145145
(1, executable+': failed NOUNDEFS'))
146-
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-bind_at_load','-fstack-protector-all', '-Wl,-fixup_chains']),
146+
self.assertEqual(call_security_check(cc, source, executable, ['-fstack-protector-all', '-Wl,-fixup_chains']),
147147
(0, ''))
148148

149149

0 commit comments

Comments
 (0)