ASAN build errors on Mac without hermetic toolchain |
||
Issue descriptionPer https://www.chromium.org/developers/testing/addresssanitizer I made a gn file on my Mac with three lines: is_asan = true enable_nacl = false # Necessary until NaCl GN build is more complete. is_debug = false # Release build. I started building and got: /V/s/c/src (stack)> ninja -C out/releaseasan all -j 500 -l 23 -k 100 ninja: Entering directory `out/releaseasan' [45086/419/488] CXX obj/buildtools/third_party/libc++/libc++/chrono.o FAILED: obj/buildtools/third_party/libc++/libc++/chrono.o ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/buildtools/third_party/libc++/libc++/chrono.o.d -DV8_DEPRECATION_WARNINGS -DNO_TCMALLOC -DMEMORY_TOOL_REPLACES_ALLOCATOR -DMEMORY_SANITIZER_INITIAL_SIZE -DADDRESS_SANITIZER -DDISABLE_NACL -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=\"300839-1\" -DCR_XCODE_VERSION=0821 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DLIBCXX_BUILDING_LIBCXXABI -I../.. -Igen -fno-strict-aliasing -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -fcolor-diagnostics -arch x86_64 -O2 -fno-omit-frame-pointer -gdwarf-2 -fno-standalone-debug -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.9 -gline-tables-only -gcolumn-info -fno-omit-frame-pointer -fsanitize=address -fno-sanitize-address-use-after-scope -mllvm -asan-globals=0 -fsanitize-blacklist=../../tools/memory/asan/blacklist.txt -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-auto-raw-pointer -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -fPIC -fstrict-aliasing -pthread -Werror -Wall -Wno-unused-variable -Wpartial-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -fvisibility=default -fvisibility-inlines-hidden -std=c++11 -stdlib=libc++ -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -std=c++11 -frtti -c ../../buildtools/third_party/libc++/trunk/src/chrono.cpp -o obj/buildtools/third_party/libc++/libc++/chrono.o ../../buildtools/third_party/libc++/trunk/src/chrono.cpp:41:14: error: 'clock_gettime' is only available on macOS 10.12 or newer [-Werror,-Wunguarded-availability] if (0 != clock_gettime(CLOCK_REALTIME, &tp)) ^~~~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:177:5: note: 'clock_gettime' has been explicitly marked partial here int clock_gettime(clockid_t __clock_id, struct timespec *__tp); ^ ../../buildtools/third_party/libc++/trunk/src/chrono.cpp:41:14: note: enclose 'clock_gettime' in an @available check to silence this warning if (0 != clock_gettime(CLOCK_REALTIME, &tp)) ^~~~~~~~~~~~~ ../../buildtools/third_party/libc++/trunk/src/chrono.cpp:78:14: error: 'clock_gettime' is only available on macOS 10.12 or newer [-Werror,-Wunguarded-availability] if (0 != clock_gettime(CLOCK_MONOTONIC, &tp)) ^~~~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:177:5: note: 'clock_gettime' has been explicitly marked partial here int clock_gettime(clockid_t __clock_id, struct timespec *__tp); ^ ../../buildtools/third_party/libc++/trunk/src/chrono.cpp:78:14: note: enclose 'clock_gettime' in an @available check to silence this warning if (0 != clock_gettime(CLOCK_MONOTONIC, &tp)) ^~~~~~~~~~~~~ 2 errors generated.
,
May 10 2017
This sounds like the 10.12 SDK has marked clock_gettime as partial availability. If you're on a corp machine, you should be forced onto hermetic - I can tell you're using non-hermetic based on the path of the SDK. Try export DEVELOPER_DIR=<path_to_chromium>/src/build/mac_files/Xcode.app and then running the commands again. This seems like something we'll need to fix before migrating to 10.12 SDK though.
,
May 12 2017
[mac triage] Does this mean building on 10.12 is broken for non-Googlers? (if so I think we treat that as Pri-0.5, but maybe not if it's just ASAN?) Could this be a regression from rolling buildtools (last done in r465683) But.. libc++ hasn't been rolled for ages - https://codereview.chromium.org/2089613003 ?
,
May 12 2017
On Mac we're supposed to use system libc++ iirc (65% sure). Why are we building the buildtools one? And not being able to build with the 10.12 SDK is a high priority regression. I'll take a look when I'm in. |
||
►
Sign in to add a comment |
||
Comment 1 by sdy@chromium.org
, May 10 2017