Opened 6 years ago

Closed 5 years ago

#58291 closed defect (fixed)

clang-8.0 @8.0.0 building libfuzzer fails on darwin 13 and less

Reported by: kencu (Ken) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version:
Keywords: mountainlion Cc:
Port: clang-8.0

Description

This is a truly weird one. In a part of the clang-8.0 build, cmake chooses to build it against the iPhoneSimulator.sdk with -miphoneos-version-min=8.0 and this fails the thread_local test. clang-7.0 and clang-devel don't build against darwin12 either, most likely for the same reason.

cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-8.0/clang-8.0/work/build/projects/compiler-rt/lib/fuzzer && /opt/local/bin/clang++-mp-3.7  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-8.0/clang-8.0/work/build/projects/compiler-rt/lib/fuzzer -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-8.0/clang-8.0/work/llvm-8.0.0.src/projects/compiler-rt/lib/fuzzer -I//opt/local/include/libxml2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-8.0/clang-8.0/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-8.0/clang-8.0/work/llvm-8.0.0.src/include  -pipe -Os -std=c++11 -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Wall -std=c++11 -DNDEBUG -arch x86_64    -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -fPIC -fno-builtin -fno-exceptions -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -fno-omit-frame-pointer -o CMakeFiles/RTfuzzer.iossim.dir/FuzzerDriver.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-8.0/clang-8.0/work/llvm-8.0.0.src/projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp

In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-8.0/clang-8.0/work/llvm-8.0.0.src/projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:16:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-8.0/clang-8.0/work/llvm-8.0.0.src/projects/compiler-rt/lib/fuzzer/FuzzerInternal.h:151:10: error: thread-local storage is not supported for the current target
  static thread_local bool IsMyThread;
         ^

Attachments (1)

clang-8.0-fail-10.8.log (3.3 MB) - added by kencu (Ken) 6 years ago.

Change History (6)

Changed 6 years ago by kencu (Ken)

Attachment: clang-8.0-fail-10.8.log added

comment:1 Changed 6 years ago by kencu (Ken)

In 4d5d3045665dc3c8138d613e2e26b7f0889ff1e6/macports-ports (master):

clang-7.0/8.0/devel: disable fuzzer on <= 10.8

there is an unusual error in the libfuzzer cmake logic
that makes it build against the iphonesimulator SDK
this fails the thread_local test

see: #58291

comment:2 Changed 5 years ago by ken-cunningham-webuse

In 72fdf7eff7635f11ab5342d86683da10fb08eccd/macports-ports (master):

clang-7.0/8.0/devel: turn off libfuzzer on 10.9

most of the other analyzers are already turned off on 10.9
libfuzzer does not build on 10.9 with our current compiler defaults
which lead it to clang-3.7

it may be possible to rearrange these defaults to use another
macports-clang version to re-enable some of these supporting
features and analyzers on 10.9 (and perhaps earlier) if there
is interest

closes: #58952
see: #58291

comment:3 Changed 5 years ago by kencu (Ken)

It is possible that building with a newer macports clang compiler could fix the build of libfuzzer, and perhaps some other components, on some of these older systems.

comment:4 Changed 5 years ago by kencu (Ken)

Summary: clang-8.0 @8.0.0 build fails on darwin 12 because cmake is building libfuzzer against the iPhoneSimulator instead of MacOS.sdkclang-8.0 @8.0.0 building libfuzzer fails on darwin 13 and less

comment:5 Changed 5 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

fuzzer has been disabled on systems where it doesn't build

Note: See TracTickets for help on using tickets.