From 76c57595c3e1fde35c52318a0aa834b9210e9a52 Mon Sep 17 00:00:00 2001 From: niftynei Date: Fri, 29 May 2020 16:13:28 -0500 Subject: [PATCH] tools-make: add mock parser for clang ld output According to #3226, it looks like clang's LD error format has changed. This patch adds the new format so we can parse the mocks successfully. Apple clang version 11.0.3 (clang-1103.0.32.29) ``` checking for ANSI C header files... Undefined symbols for architecture x86_64: "_fromwire_amount_msat", referenced from: _fromwire_tlv_test_n1_tlv3 in ccj4zKdV.o "_fromwire_bool", referenced from: _fromwire_test_msg in ccj4zKdV.o _fromwire_test_msg_option_short_id in ccj4zKdV.o _fromwire_test_msg_option_one in ccj4zKdV.o _fromwire_test_msg_option_two in ccj4zKdV.o "_fromwire_test_enum", referenced from: _fromwire_test_msg in ccj4zKdV.o _fromwire_test_msg_option_short_id in ccj4zKdV.o _fromwire_test_msg_option_one in ccj4zKdV.o _fromwire_test_msg_option_two in ccj4zKdV.o "_fromwire_tlvs", referenced from: _fromwire_test_tlv1 in ccj4zKdV.o _fromwire_test_tlv2 in ccj4zKdV.o _fromwire_test_tlv3 in ccj4zKdV.o "_fromwire_tu32", referenced from: _fromwire_tlv_test_n2_tlv2 in ccj4zKdV.o "_fromwire_tu64", referenced from: _fromwire_tlv_test_n1_tlv1 in ccj4zKdV.o _fromwire_tlv_test_n2_tlv1 in ccj4zKdV.o "_fromwire_u16", referenced from: _fromwire_test_features in ccj4zKdV.o _fromwire_subtype_var_assign in ccj4zKdV.o _fromwire_subtype_arrays in ccj4zKdV.o _fromwire_tlv_test_n1_tlv4 in ccj4zKdV.o _fromwire_tlv_test_n3_tlv3 in ccj4zKdV.o _fromwire_test_msg in ccj4zKdV.o _fromwire_test_tlv1 in ccj4zKdV.o ... "_fromwire_u32", referenced from: _fromwire_tlv_test_n3_tlv3 in ccj4zKdV.o _fromwire_test_msg in ccj4zKdV.o _fromwire_test_msg_option_short_id in ccj4zKdV.o _fromwire_test_msg_option_one in ccj4zKdV.o _fromwire_test_msg_option_two in ccj4zKdV.o "_fromwire_u64", referenced from: _fromwire_test_short_id in ccj4zKdV.o _fromwire_tlv_test_n3_tlv3 in ccj4zKdV.o "_fromwire_u8", referenced from: _fromwire_subtype_var_assign in ccj4zKdV.o _fromwire_subtype_var_len in ccj4zKdV.o _fromwire_subtype_varlen_varsize in ccj4zKdV.o _fromwire_tlv_test_n3_tlv3 in ccj4zKdV.o "_fromwire_u8_array", referenced from: _fromwire_test_features in ccj4zKdV.o _fromwire_subtype_arrays in ccj4zKdV.o _fromwire_tlv_test_n3_tlv3 in ccj4zKdV.o _fromwire_test_msg in ccj4zKdV.o _fromwire_test_msg_option_short_id in ccj4zKdV.o _fromwire_test_msg_option_one in ccj4zKdV.o _fromwire_test_msg_option_two in ccj4zKdV.o ... ``` Changelog-Fixed: Build for macOS Catalina / Apple clang v11.0.3 fixed --- tools/mockup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/mockup.sh b/tools/mockup.sh index eb2c14491..c8a8a2215 100755 --- a/tools/mockup.sh +++ b/tools/mockup.sh @@ -14,6 +14,12 @@ if [ $# -eq 0 ]; then # ld: error: undefined symbol: foo() echo "${LINE#*undefined symbol: }" ;; + *,\ referenced\ from:*) + # Apple clang version 11.0.3 (clang-1103.0.32.29) + # "_towire", referenced from: + LINE=${LINE#\"_} + echo "${LINE%\"*}" + ;; *) continue ;;