Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make build succeed on Catalina with Xcode 12.00. #26378

Merged
merged 3 commits into from May 5, 2023

Conversation

mplitkins
Copy link
Contributor

When pulling a fresh fork of the repo under Catalina:

Version 10.15.7 (19H2026)

using Xcode:

mmpmbp01:~ michaelp$ clang --version
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I had the following two errors pop up when building the tree:


[4077/8401] c++ mac_x64_gcc/obj/src/tools/chip-cert/chip-cert.GeneralUtils.cpp.o
FAILED: mac_x64_gcc/obj/src/tools/chip-cert/chip-cert.GeneralUtils.cpp.o
g++ -MMD -MF mac_x64_gcc/obj/src/tools/chip-cert/chip-cert.GeneralUtils.cpp.o.d -Wconversion -target x86_64-apple-macos11.0 -O0 -g2 -fno-common -ffunction-sections -fdata-sections -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -Wall -Werror -Wextra -Wshadow -Wunreachable-code -Wvla -Wformat -Wformat-nonliteral -Wformat-security -Wconversion -Wno-deprecated-declarations -Wno-missing-field-initializers -Wno-unknown-warning-option -Wno-unused-parameter -Wno-cast-function-type -Wno-psabi -Wno-maybe-uninitialized -fdiagnostics-color -fno-strict-aliasing -fmacro-prefix-map=../../= -fobjc-arc -Wconversion -std=gnu++14 -frtti -Wnon-virtual-dtor -DCHIP_HAVE_CONFIG_H=1 -DOPENSSL_NO_ASM=1 -I../../src/include -I../../src -Imac_x64_gcc/gen/include -I../../zzz_generated/app-common -I../../config/standalone -I../../third_party/nlassert/repo/include -I../../third_party/nlio/repo/include -I../../third_party/nlfaultinjection/repo/include -I../../third_party/boringssl/repo/src/include -c ../../src/tools/chip-cert/GeneralUtils.cpp -o mac_x64_gcc/obj/src/tools/chip-cert/chip-cert.GeneralUtils.cpp.o
../../src/tools/chip-cert/GeneralUtils.cpp:237:75: error: use of undeclared identifier 'errno'
fprintf(stderr, "Unable to open %s: %s\n", fileName, strerror(errno));
^
../../src/tools/chip-cert/GeneralUtils.cpp:273:70: error: use of undeclared identifier 'errno'
fprintf(stderr, "Error reading %s: %s\n", fileName, strerror(errno));
^
../../src/tools/chip-cert/GeneralUtils.cpp:286:74: error: use of undeclared identifier 'errno'
fprintf(stderr, "Error reading %s: %s\n", fileName, strerror(errno));
^
../../src/tools/chip-cert/GeneralUtils.cpp:338:90: error: use of undeclared identifier 'errno'
fprintf(stderr, "Unable to write to %s: %s\n", fileName, strerror(ferror(file) ? errno : ENOSPC));
^
../../src/tools/chip-cert/GeneralUtils.cpp:338:98: error: use of undeclared identifier 'ENOSPC'
fprintf(stderr, "Unable to write to %s: %s\n", fileName, strerror(ferror(file) ? errno : ENOSPC));
^
../../src/tools/chip-cert/GeneralUtils.cpp:345:90: error: use of undeclared identifier 'errno'
fprintf(stderr, "Unable to write to %s: %s\n", fileName, strerror(ferror(file) ? errno : ENOSPC));
^
../../src/tools/chip-cert/GeneralUtils.cpp:345:98: error: use of undeclared identifier 'ENOSPC'
fprintf(stderr, "Unable to write to %s: %s\n", fileName, strerror(ferror(file) ? errno : ENOSPC));
^
7 errors generated.
[4094/8401] c++ mac_x64_gcc/obj/examples/chip-tool/chip-tool.main.cpp.o
ninja: build stopped: subcommand failed.

[1959/4312] c++ standalone/obj/examples/platform/linux/app-main.NamedPipeCommands.cpp.o
FAILED: standalone/obj/examples/platform/linux/app-main.NamedPipeCommands.cpp.o
g++ -MMD -MF standalone/obj/examples/platform/linux/app-main.NamedPipeCommands.cpp.o.d -target x86_64-apple-macos11.0 -O0 -g2 -fno-common -ffunction-sections -fdata-sections -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -Wall -Werror -Wextra -Wshadow -Wunreachable-code -Wvla -Wformat -Wformat-nonliteral -Wformat-security -Wconversion -Wno-deprecated-declarations -Wno-missing-field-initializers -Wno-unknown-warning-option -Wno-unused-parameter -Wno-cast-function-type -Wno-psabi -Wno-maybe-uninitialized -fdiagnostics-color -fno-strict-aliasing -fmacro-prefix-map=../../= -fobjc-arc -Wconversion -std=gnu++14 -frtti -Wnon-virtual-dtor -DCHIP_HAVE_CONFIG_H=1 -DOPENSSL_NO_ASM=1 -DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h> -I../../examples/platform/linux -I../../examples/providers -I../../src/include -I../../src -Istandalone/gen/include -I../../zzz_generated/app-common -I../../config/standalone -I../../third_party/nlassert/repo/include -I../../third_party/nlio/repo/include -I../../third_party/boringssl/repo/src/include -I../../examples/common/tracing -I../../third_party/jsoncpp/repo/include -c ../../examples/platform/linux/NamedPipeCommands.cpp -o standalone/obj/examples/platform/linux/app-main.NamedPipeCommands.cpp.o
../../examples/platform/linux/NamedPipeCommands.cpp:40:63: error: use of undeclared identifier 'errno'
VerifyOrReturnError((mkfifo(path.c_str(), 0666) == 0) || (errno == EEXIST), CHIP_ERROR_OPEN_FAILED);
^
../../examples/platform/linux/NamedPipeCommands.cpp:40:72: error: use of undeclared identifier 'EEXIST'
VerifyOrReturnError((mkfifo(path.c_str(), 0666) == 0) || (errno == EEXIST), CHIP_ERROR_OPEN_FAILED);
^
2 errors generated.
[1976/4312] ACTION //examples/thermostat/thermostat-common:thermostat-common_zapgen_zap_pregen(//config/standalone/toolchain:standalone)
ninja: build stopped: subcommand failed.


By simply adding:

#include <errno.h>

to the two source files the issues were resolved.

Rob Szewczyk chimed in via email and added the following bit of information from a system that did not run into these issues:

"
This is the chain of includes that makes it work on the system without embedding your patch:

. ../../src/tools/chip-cert/chip-cert.h
.. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory
... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h
.... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/atomic
..... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__threading_support
...... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/errno.h
....... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/errno.h
........ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/errno.h

The above was generated with

g++ -H -MMD -MF mac_x64_gcc/obj/src/tools/chip-cert/chip-cert.GeneralUtils.cpp.o.d -Wconversion -target x86_64-apple-macos11.0 -O0 -g2 -fno-common -ffunction-sections -fdata-sections -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -Wall -Werror -Wextra -Wshadow -Wunreachable-code -Wvla -Wformat -Wformat-nonliteral -Wformat-security -Wconversion -Wno-deprecated-declarations -Wno-missing-field-initializers -Wno-unknown-warning-option -Wno-unused-parameter -Wno-cast-function-type -Wno-psabi -Wno-maybe-uninitialized -fdiagnostics-color -fno-strict-aliasing -fmacro-prefix-map=../../= -fobjc-arc -Wconversion -std=gnu++14 -frtti -Wnon-virtual-dtor -DCHIP_HAVE_CONFIG_H=1 -DOPENSSL_NO_ASM=1 -I../../src/include -I../../src -Imac_x64_gcc/gen/include -I../../zzz_generated/app-common -I../../config/standalone -I../../third_party/nlassert/repo/include -I../../third_party/nlio/repo/include -I../../third_party/nlfaultinjection/repo/include -I../../third_party/boringssl/repo/src/include -E ../../src/tools/chip-cert/GeneralUtils.cpp -o mac_x64_gcc/obj/src/tools/chip-cert/chip-cert.GeneralUtils.cpp.E

I had also generated a pre-processed GeneralUtils.cpp.E which I am attaching below.

rob
"

@CLAassistant
Copy link

CLAassistant commented May 5, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

github-actions bot commented May 5, 2023

PR #26378: Size comparison from a59ffbd to fc5a4cf

Full report (4 builds for cc32xx, mbed, qpg)
platform target config section a59ffbd fc5a4cf change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 604866 604866 0 0.0
(read/write) 204156 204156 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197568 197568 0 0.0
.comment 206 206 0 0.0
.data 1468 1468 0 0.0
.debug_abbrev 957005 957005 0 0.0
.debug_aranges 101104 101104 0 0.0
.debug_frame 341416 341416 0 0.0
.debug_info 19522697 19522697 0 0.0
.debug_line 2666219 2666219 0 0.0
.debug_line_str 513 513 0 0.0
.debug_loc 33340 33340 0 0.0
.debug_loclists 1488771 1488771 0 0.0
.debug_ranges 4984 4984 0 0.0
.debug_rnglists 94291 94291 0 0.0
.debug_str 3100491 3100491 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104346 104346 0 0.0
.shstrtab 265 265 0 0.0
.stack 2048 2048 0 0.0
.strtab 482872 482872 0 0.0
.symtab 287120 287120 0 0.0
.text 498396 498396 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2494848 2494848 0 0.0
.bss 216296 216296 0 0.0
.data 5144 5144 0 0.0
.text 1457532 1457532 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1167816 1167816 0 0.0
.bss 99632 99632 0 0.0
.data 856 856 0 0.0
.text 614916 614916 0 0.0
lock-app qpg6105+debug (read/write) 1137176 1137176 0 0.0
.bss 94784 94784 0 0.0
.data 852 852 0 0.0
.text 584272 584272 0 0.0

@bzbarsky-apple bzbarsky-apple enabled auto-merge (squash) May 5, 2023 00:49
@github-actions
Copy link

github-actions bot commented May 5, 2023

PR #26378: Size comparison from a59ffbd to 8a8f0aa

Increases above 0.2%:

platform target config section a59ffbd 8a8f0aa change % change
bl702 lighting-app bl702 .debug_info 40749400 40838025 88625 0.2
.debug_str 3675990 3683798 7808 0.2
cc32xx lock CC3235SF_LAUNCHXL .debug_info 19522697 19603115 80418 0.4
.debug_str 3100491 3108084 7593 0.2
Increases (4 builds for bl702, cc32xx, nrfconnect)
platform target config section a59ffbd 8a8f0aa change % change
bl702 lighting-app bl702 .debug_abbrev 1549515 1549572 57 0.0
.debug_info 40749400 40838025 88625 0.2
.debug_line 5293911 5293914 3 0.0
.debug_str 3675990 3683798 7808 0.2
bl702+rpc .debug_abbrev 1702795 1702852 57 0.0
.debug_info 45444506 45534366 89860 0.2
.debug_line 5703342 5703345 3 0.0
.debug_loc 3619114 3619115 1 0.0
.debug_str 4100399 4108207 7808 0.2
cc32xx lock CC3235SF_LAUNCHXL .debug_abbrev 957005 957098 93 0.0
.debug_info 19522697 19603115 80418 0.4
.debug_line 2666219 2666235 16 0.0
.debug_loclists 1488771 1488792 21 0.0
.debug_str 3100491 3108084 7593 0.2
nrfconnect all-clusters-minimal-app nrf52840dk_nrf52840 text 778096 778100 4 0.0
Decreases (3 builds for bl702, qpg)
platform target config section a59ffbd 8a8f0aa change % change
bl702 lighting-app bl702 .debug_loc 3418091 3418075 -16 -0.0
.text 964926 964922 -4 -0.0
bl702+rpc .text 1037316 1037314 -2 -0.0
qpg lock-app qpg6105+debug (read/write) 1137176 1137168 -8 -0.0
.text 584272 584264 -8 -0.0
Full report (11 builds for bl602, bl702, cc32xx, mbed, nrfconnect, qpg)
platform target config section a59ffbd 8a8f0aa change % change
bl602 lighting-app bl602 (read/write) 1354838 1354838 0 0.0
.bss 87886 87886 0 0.0
.data 9648 9648 0 0.0
.text 1035792 1035792 0 0.0
bl602+rpc (read/write) 1401106 1401106 0 0.0
.bss 95934 95934 0 0.0
.data 10040 10040 0 0.0
.text 1067144 1067144 0 0.0
bl702 lighting-app bl702 0 0 0 0.0
(read only) 3358 3358 0 0.0
(read/write) 1185199 1185199 0 0.0
.bleromro 6342 6342 0 0.0
.bleromrw 124 124 0 0.0
.boot2 328 328 0 0.0
.bss 67601 67601 0 0.0
.bss_psram 24368 24368 0 0.0
.comment 48 48 0 0.0
.data 3952 3952 0 0.0
.debug_abbrev 1549515 1549572 57 0.0
.debug_aranges 132776 132776 0 0.0
.debug_frame 487884 487884 0 0.0
.debug_info 40749400 40838025 88625 0.2
.debug_line 5293911 5293914 3 0.0
.debug_loc 3418091 3418075 -16 -0.0
.debug_ranges 372032 372032 0 0.0
.debug_str 3675990 3683798 7808 0.2
.hbn 536 536 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 140 140 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 106272 106272 0 0.0
.rsvd 4 4 0 0.0
.sha_ocram 72 72 0 0.0
.shstrtab 304 304 0 0.0
.stack 2048 2048 0 0.0
.strtab 580333 580333 0 0.0
.symtab 175136 175136 0 0.0
.tcm_data 28 28 0 0.0
.tcmcode 3358 3358 0 0.0
.text 964926 964922 -4 -0.0
bl702+rpc 0 0 0 0.0
(read only) 3358 3358 0 0.0
(read/write) 1272755 1272755 0 0.0
.bleromro 6342 6342 0 0.0
.bleromrw 124 124 0 0.0
.boot2 328 328 0 0.0
.bss 75633 75633 0 0.0
.bss_psram 24768 24768 0 0.0
.comment 48 48 0 0.0
.data 4504 4504 0 0.0
.debug_abbrev 1702795 1702852 57 0.0
.debug_aranges 141000 141000 0 0.0
.debug_frame 515776 515776 0 0.0
.debug_info 45444506 45534366 89860 0.2
.debug_line 5703342 5703345 3 0.0
.debug_loc 3619114 3619115 1 0.0
.debug_ranges 397064 397064 0 0.0
.debug_str 4100399 4108207 7808 0.2
.hbn 536 536 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 156 156 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 120112 120112 0 0.0
.rsvd 4 4 0 0.0
.sha_ocram 72 72 0 0.0
.shstrtab 304 304 0 0.0
.stack 2048 2048 0 0.0
.strtab 640877 640877 0 0.0
.symtab 193424 193424 0 0.0
.tcm_data 28 28 0 0.0
.tcmcode 3358 3358 0 0.0
.text 1037316 1037314 -2 -0.0
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 604866 604866 0 0.0
(read/write) 204156 204156 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197568 197568 0 0.0
.comment 206 206 0 0.0
.data 1468 1468 0 0.0
.debug_abbrev 957005 957098 93 0.0
.debug_aranges 101104 101104 0 0.0
.debug_frame 341416 341416 0 0.0
.debug_info 19522697 19603115 80418 0.4
.debug_line 2666219 2666235 16 0.0
.debug_line_str 513 513 0 0.0
.debug_loc 33340 33340 0 0.0
.debug_loclists 1488771 1488792 21 0.0
.debug_ranges 4984 4984 0 0.0
.debug_rnglists 94291 94291 0 0.0
.debug_str 3100491 3108084 7593 0.2
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104346 104346 0 0.0
.shstrtab 265 265 0 0.0
.stack 2048 2048 0 0.0
.strtab 482872 482872 0 0.0
.symtab 287120 287120 0 0.0
.text 498396 498396 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2494848 2494848 0 0.0
.bss 216296 216296 0 0.0
.data 5144 5144 0 0.0
.text 1457532 1457532 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1176268 1176268 0 0.0
bss 155557 155557 0 0.0
rodata 132780 132780 0 0.0
text 807164 807164 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1123220 1123220 0 0.0
bss 154749 154749 0 0.0
rodata 109764 109764 0 0.0
text 778096 778100 4 0.0
all-clusters-app nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1435980 1435980 0 0.0
bss 135297 135297 0 0.0
rodata 228796 228796 0 0.0
text 777804 777804 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1167816 1167816 0 0.0
.bss 99632 99632 0 0.0
.data 856 856 0 0.0
.text 614916 614916 0 0.0
lock-app qpg6105+debug (read/write) 1137176 1137168 -8 -0.0
.bss 94784 94784 0 0.0
.data 852 852 0 0.0
.text 584272 584264 -8 -0.0

@github-actions
Copy link

github-actions bot commented May 5, 2023

PR #26378: Size comparison from a59ffbd to 348f9ff

Increases above 0.2%:

platform target config section a59ffbd 348f9ff change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 19522697 19603113 80416 0.4
.debug_str 3100491 3108084 7593 0.2
Increases (1 build for cc32xx)
platform target config section a59ffbd 348f9ff change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_abbrev 957005 957098 93 0.0
.debug_info 19522697 19603113 80416 0.4
.debug_line 2666219 2666235 16 0.0
.debug_loclists 1488771 1488792 21 0.0
.debug_str 3100491 3108084 7593 0.2
Full report (1 build for cc32xx)
platform target config section a59ffbd 348f9ff change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 604866 604866 0 0.0
(read/write) 204156 204156 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197568 197568 0 0.0
.comment 206 206 0 0.0
.data 1468 1468 0 0.0
.debug_abbrev 957005 957098 93 0.0
.debug_aranges 101104 101104 0 0.0
.debug_frame 341416 341416 0 0.0
.debug_info 19522697 19603113 80416 0.4
.debug_line 2666219 2666235 16 0.0
.debug_line_str 513 513 0 0.0
.debug_loc 33340 33340 0 0.0
.debug_loclists 1488771 1488792 21 0.0
.debug_ranges 4984 4984 0 0.0
.debug_rnglists 94291 94291 0 0.0
.debug_str 3100491 3108084 7593 0.2
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104346 104346 0 0.0
.shstrtab 265 265 0 0.0
.stack 2048 2048 0 0.0
.strtab 482872 482872 0 0.0
.symtab 287120 287120 0 0.0
.text 498396 498396 0 0.0

@bzbarsky-apple bzbarsky-apple merged commit 3d21708 into project-chip:master May 5, 2023
52 checks passed
@bzbarsky-apple
Copy link
Contributor

@mplitkins Thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants