Message ID | ydd7f8awce3.fsf@CeBiTec.Uni-Bielefeld.DE |
---|---|
State | Superseded |
Headers | show |
On Nov 11, 2016, at 2:15 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote: > The patch passes fixincludes make check (this time for real ;-) and > restores macOS 10.12 bootstrap. No objections from me.
Hi Rainer, Thanks for the patch! > On 11 Nov 2016, at 11:18, Mike Stump <mikestump@comcast.net> wrote: > > On Nov 11, 2016, at 2:15 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote: >> The patch passes fixincludes make check (this time for real ;-) and >> restores macOS 10.12 bootstrap. > > No objections from me. On x86_64-darwin14, there still seem to be fails /usr/include/os/base.h /usr/include/dispatch/dispatch.h /usr/include/dispatch/object.h of kinds __has_extension() and block syntax. (I haven’t had a chance to check any other OS revs yet). Iain
Hi Iain, >> On 11 Nov 2016, at 11:18, Mike Stump <mikestump@comcast.net> wrote: >> >> On Nov 11, 2016, at 2:15 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote: >>> The patch passes fixincludes make check (this time for real ;-) and >>> restores macOS 10.12 bootstrap. >> >> No objections from me. > > On x86_64-darwin14, there still seem to be fails > > /usr/include/os/base.h > /usr/include/dispatch/dispatch.h > /usr/include/dispatch/object.h > > of kinds __has_extension() and block syntax. > > (I haven’t had a chance to check any other OS revs yet). I don't have access to anything but Darwin 11 and 16, so I can't help directly. Maybe, if you can send (or attach to the PR) the specific errors and problematic headers (or point to copies on opensource.apple.com), I can help with the fixincludes part. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University
> On 11 Nov 2016, at 16:50, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote: > > Hi Iain, > >>> On 11 Nov 2016, at 11:18, Mike Stump <mikestump@comcast.net> wrote: >>> >>> On Nov 11, 2016, at 2:15 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote: >>>> The patch passes fixincludes make check (this time for real ;-) and >>>> restores macOS 10.12 bootstrap. >>> >>> No objections from me. >> >> On x86_64-darwin14, there still seem to be fails >> >> /usr/include/os/base.h >> /usr/include/dispatch/dispatch.h >> /usr/include/dispatch/object.h >> >> of kinds __has_extension() and block syntax. >> >> (I haven’t had a chance to check any other OS revs yet). > > I don't have access to anything but Darwin 11 and 16, so I can't help > directly. OK. Only the dispatch/ ones are present on Darwin11 (did that bootstrap OK for you? if so likely 10.6 will be OK too - save me checking). > Maybe, if you can send (or attach to the PR) the specific > errors and problematic headers (or point to copies on > opensource.apple.com), I can help with the fixincludes part. I don’t have a Darwin16 system live at present, so can’t compare, but os/base.h is present on Darwin15 (so i’d expect it to be in the Darwin16 SDK) I’ll see if I can take an initial pass at it over the w/e and post to the PR. Iain
Hi Iain, >> On 11 Nov 2016, at 16:50, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote: >> >> Hi Iain, >> >>>> On 11 Nov 2016, at 11:18, Mike Stump <mikestump@comcast.net> wrote: >>>> >>>> On Nov 11, 2016, at 2:15 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> >>>> wrote: >>>>> The patch passes fixincludes make check (this time for real ;-) and >>>>> restores macOS 10.12 bootstrap. >>>> >>>> No objections from me. >>> >>> On x86_64-darwin14, there still seem to be fails >>> >>> /usr/include/os/base.h >>> /usr/include/dispatch/dispatch.h >>> /usr/include/dispatch/object.h >>> >>> of kinds __has_extension() and block syntax. >>> >>> (I haven’t had a chance to check any other OS revs yet). >> >> I don't have access to anything but Darwin 11 and 16, so I can't help >> directly. > > OK. Only the dispatch/ ones are present on Darwin11 > > (did that bootstrap OK for you? if so likely 10.6 will be OK too - save me > checking). 10.7 did without issues. >> Maybe, if you can send (or attach to the PR) the specific >> errors and problematic headers (or point to copies on >> opensource.apple.com), I can help with the fixincludes part. > > I don’t have a Darwin16 system live at present, so can’t compare, but > os/base.h is present on Darwin15 (so i’d expect it to be in the Darwin16 > SDK) It is indeed. > I’ll see if I can take an initial pass at it over the w/e and post to the PR. Fine. I'm sure we can fix Apple's mistakes here, but it would probably help to file bugs with them for everything we find. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University
On Fri, Nov 11, 2016 at 3:18 AM, Mike Stump <mikestump@comcast.net> wrote: > > No objections from me. > Or me. Thanks!
Hi Jack, > On darwin15, the proposed patch is insufficient to restore the bootstrap > (after running genfixes in the fixincludes directory) unless I also apply > the previously proposed change... no wonder: it's only been tested on darwin16. Care to explain what error you're seeing? Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University
---------- Forwarded message ---------- From: Jack Howarth <howarth.at.gcc@gmail.com> Date: Sun, Nov 13, 2016 at 1:19 PM Subject: Re: [fixincludes] Fix macOS 10.12 <AvailabilityInternal.h> and <os/trace.h> (PR sanitizer/78267) To: Rainer Orth <ro@cebitec.uni-bielefeld.de> Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Bruce Korb <bkorb@gnu.org> On Sun, Nov 13, 2016 at 5:53 AM, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote: > > Hi Jack, > > > On darwin15, the proposed patch is insufficient to restore the bootstrap > > (after running genfixes in the fixincludes directory) unless I also apply > > the previously proposed change... > > no wonder: it's only been tested on darwin16. Care to explain what > error you're seeing? > The failure that I see on darwin15 using your proposed patches and executing genfixes in fixincludes before the build is... libtool: compile: /sw/src/fink.build/gcc7-7.0.0-1/darwin_objdir/./gcc/xgcc -shared-libgcc -B/sw/src/fink.build/gcc7-7.0.0-1/darwin_objdir/./gcc -nostdinc++ -L/sw/src/fink.build/gcc7-7.0.0-1/darwin_objdir/x86_64-apple-darwin15.6.0/libstdc++-v3/src -L/sw/src/fink.build/gcc7-7.0.0-1/darwin_objdir/x86_64-apple-darwin15.6.0/libstdc++-v3/src/.libs -L/sw/src/fink.build/gcc7-7.0.0-1/darwin_objdir/x86_64-apple-darwin15.6.0/libstdc++-v3/libsupc++/.libs -B/sw/lib/gcc7/x86_64-apple-darwin15.6.0/bin/ -B/sw/lib/gcc7/x86_64-apple-darwin15.6.0/lib/ -isystem /sw/lib/gcc7/x86_64-apple-darwin15.6.0/include -isystem /sw/lib/gcc7/x86_64-apple-darwin15.6.0/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -I. -I../../../../gcc-7-20161113/libsanitizer/sanitizer_common -I.. -I ../../../../gcc-7-20161113/libsanitizer/include -isystem ../../../../gcc-7-20161113/libsanitizer/include/system -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/x86_64-apple-darwin15.6.0 -I../../../../gcc-7-20161113/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++11 -g -O2 -MT sanitizer_mac.lo -MD -MP -MF .deps/sanitizer_mac.Tpo -c ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc -fno-common -DPIC -o .libs/sanitizer_mac.o ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:497:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] os_trace("Address Sanitizer reported a failure."); ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:497:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:497:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:500:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] os_trace("Undefined Behavior Sanitizer reported a failure."); ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:500:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:500:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:503:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] os_trace("Thread Sanitizer reported a failure."); ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:503:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:503:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:505:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] os_trace("Sanitizer tool reported a failure."); ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:505:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:505:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:508:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] os_trace("Consult syslog for more information."); ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:508:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:508:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] In file included from ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:39:0: /sw/src/fink.build/gcc7-7.0.0-1/darwin_objdir/gcc/include-fixed/os/trace.h:56:47: error: attributes are not allowed on a function-definition _os_trace_verify_printf(const char *msg, ...) __attribute__((format(printf, 1, 2))) ^~~~~~~~~~~~~ /sw/src/fink.build/gcc7-7.0.0-1/darwin_objdir/gcc/include-fixed/os/trace.h:715:109: error: ‘os_trace_payload_t’ has not been declared _os_trace_with_buffer(void *dso, const char *message, uint8_t type, const void *buffer, size_t buffer_size, os_trace_payload_ payload); ^~~~~~~~~~~~~~~~~ ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc: In function ‘void __sanitizer::LogFullErrorReport(const char*)’: ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:497:7: error: ‘_Static_assert’ was not declared in this scope os_trace("Address Sanitizer reported a failure."); ^ ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:497:7: note: suggested alternative: ‘__cpp_static_assert’ ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:497:7: warning: passing NULL to non-pointer argument 6 of ‘void _os_trace_with_buffer(void*, const char*, uint8_t, const void*, size_t, int)’ [-Wconversion-null] os_trace("Address Sanitizer reported a failure."); ^~~~~~~~ In file included from ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:39:0: ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:500:7: error: ‘_Static_assert’ was not declared in this scope os_trace("Undefined Behavior Sanitizer reported a failure."); ^ ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:500:7: note: suggested alternative: ‘__cpp_static_assert’ ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:500:7: warning: passing NULL to non-pointer argument 6 of ‘void _os_trace_with_buffer(void*, const char*, uint8_t, const void*, size_t, int)’ [-Wconversion-null] os_trace("Undefined Behavior Sanitizer reported a failure."); ^~~~~~~~ In file included from ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:39:0: ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:503:7: error: ‘_Static_assert’ was not declared in this scope os_trace("Thread Sanitizer reported a failure."); ^ ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:503:7: note: suggested alternative: ‘__cpp_static_assert’ ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:503:7: warning: passing NULL to non-pointer argument 6 of ‘void _os_trace_with_buffer(void*, const char*, uint8_t, const void*, size_t, int)’ [-Wconversion-null] os_trace("Thread Sanitizer reported a failure."); ^~~~~~~~ In file included from ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:39:0: ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:505:7: error: ‘_Static_assert’ was not declared in this scope os_trace("Sanitizer tool reported a failure."); ^ ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:505:7: note: suggested alternative: ‘__cpp_static_assert’ ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:505:7: warning: passing NULL to non-pointer argument 6 of ‘void _os_trace_with_buffer(void*, const char*, uint8_t, const void*, size_t, int)’ [-Wconversion-null] os_trace("Sanitizer tool reported a failure."); ^~~~~~~~ In file included from ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:39:0: ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:508:7: error: ‘_Static_assert’ was not declared in this scope os_trace("Consult syslog for more information."); ^ ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:508:7: note: suggested alternative: ‘__cpp_static_assert’ ../../../../gcc-7-20161113/libsanitizer/sanitizer_common/sanitizer_mac.cc:508:7: warning: passing NULL to non-pointer argument 6 of ‘void _os_trace_with_buffer(void*, const char*, uint8_t, const void*, size_t, int)’ [-Wconversion-null] os_trace("Consult syslog for more information."); ^~~~~~~~ make[4]: *** [sanitizer_mac.lo] Error 1 make[3]: *** [all-recursive] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-target-libsanitizer] Error 2 make: *** [all] Error 2 > Rainer > > -- > ----------------------------------------------------------------------------- > Rainer Orth, Center for Biotechnology, Bielefeld University
Hi Jack, > In case it helps, attached is a diff of the os/trace.h header from OS X 11.11 vs that > from MacOS X 11.12. It looks like the context of the changes that you are trying to > apply into are different between the two OS releases and are the cause of the build > failures on darwin15. as I wrote, there are two issues, one a slightly different context, the other a broken function definition (which is gone in Darwin 16), both of which should be fixed by my updated patch. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University
# HG changeset patch # Parent 38420045cf6aa616f517ca5fcfd15f2b55e68cf0 Fix macOS 10.12 <AvailabilityInternal.h> and <os/trace.h> (PR sanitizer/78267) diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -1338,6 +1338,32 @@ fix = { }; /* + * macOS 10.12 <AvailabilityInternal.h> uses __attribute__((availability)) + * unconditionally. + */ +fix = { + hackname = darwin_availabilityinternal; + mach = "*-*-darwin*"; + files = AvailabilityInternal.h; + select = "#define[ \t]+(__API_[ADU]\\([^)]*\\)).*"; + c_fix = format; + c_fix_arg = <<- _EOFix_ + #if defined(__has_attribute) + #if __has_attribute(availability) + %0 + #else + #define %1 + #endif + #else + #define %1 + #endif + _EOFix_; + + test_text = "#define __API_A(x) __attribute__((availability(__API_AVAILABLE_PLATFORM_##x)))\n" + "#define __API_D(msg,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg)))"; +}; + +/* * For the AAB_darwin7_9_long_double_funcs fix to be useful, * you have to not use "" includes. */ @@ -1410,6 +1436,44 @@ fix = { }; /* + * macOS 10.12 <os/trace.h> os_trace_payload_t typedef uses Blocks + * extension without guard. + */ +fix = { + hackname = darwin_os_trace_1; + mach = "*-*-darwin*"; + files = os/trace.h; + select = "typedef.*\\^os_trace_payload_t.*"; + c_fix = format; + c_fix_arg = "#if __BLOCKS__\n%0\n#endif"; + test_text = "typedef void (^os_trace_payload_t)(xpc_object_t xdict);"; +}; + +/* + * In macOS 10.12 <os/trace.h>, need to guard users of os_trace_payload_t + * typedef, too. + */ +fix = { + hackname = darwin_os_trace_2; + mach = "*-*-darwin*"; + files = os/trace.h; + select = <<- _EOSelect_ + __API_.* + OS_EXPORT.* + .* + _os_trace.*os_trace_payload_t payload); + _EOSelect_; + c_fix = format; + c_fix_arg = "#if __BLOCKS__\n%0\n#endif"; + test_text = <<- _EOText_ + __API_AVAILABLE(macosx(10.10), ios(8.0), watchos(2.0), tvos(8.0)) + OS_EXPORT OS_NOTHROW OS_NOT_TAIL_CALLED + void + _os_trace_with_buffer(void *dso, const char *message, uint8_t type, const void *buffer, size_t buffer_size, os_trace_payload_t payload); + _EOText_; +}; + +/* * __private_extern__ doesn't exist in FSF GCC. Even if it did, * why would you ever put it in a system header file? */ @@ -2638,7 +2702,6 @@ fix = { c-fix-arg = "# define UINT_%164_MAX __UINT64_MAX__"; test-text = "# define UINT_FAST64_MAX ULLONG_MAX\n" "# define UINT_LEAST64_MAX ULLONG_MAX\n"; - _EOFix_; }; /* diff --git a/fixincludes/tests/base/AvailabilityInternal.h b/fixincludes/tests/base/AvailabilityInternal.h new file mode 100644 --- /dev/null +++ b/fixincludes/tests/base/AvailabilityInternal.h @@ -0,0 +1,31 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/AvailabilityInternal.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( DARWIN_AVAILABILITYINTERNAL_CHECK ) +#if defined(__has_attribute) + #if __has_attribute(availability) +#define __API_A(x) __attribute__((availability(__API_AVAILABLE_PLATFORM_##x))) + #else + #define __API_A(x) + #endif +#else + #define __API_A(x) +#endif +#if defined(__has_attribute) + #if __has_attribute(availability) +#define __API_D(msg,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg))) + #else + #define __API_D(msg,x) + #endif +#else + #define __API_D(msg,x) +#endif +#endif /* DARWIN_AVAILABILITYINTERNAL_CHECK */ diff --git a/fixincludes/tests/base/os/trace.h b/fixincludes/tests/base/os/trace.h new file mode 100644 --- /dev/null +++ b/fixincludes/tests/base/os/trace.h @@ -0,0 +1,26 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/os/trace.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( DARWIN_OS_TRACE_1_CHECK ) +#if __BLOCKS__ +typedef void (^os_trace_payload_t)(xpc_object_t xdict); +#endif +#endif /* DARWIN_OS_TRACE_1_CHECK */ + + +#if defined( DARWIN_OS_TRACE_2_CHECK ) +#if __BLOCKS__ +__API_AVAILABLE(macosx(10.10), ios(8.0), watchos(2.0), tvos(8.0)) +OS_EXPORT OS_NOTHROW OS_NOT_TAIL_CALLED +void +_os_trace_with_buffer(void *dso, const char *message, uint8_t type, const void *buffer, size_t buffer_size, os_trace_payload_t payload); +#endif +#endif /* DARWIN_OS_TRACE_2_CHECK */