diff mbox

[PR79562] fix bootstrap on FreeBSD

Message ID 4a2c8871-bd00-6f23-683d-9c8843ceca4b@fgznet.ch
State New
Headers show

Commit Message

Andreas Tobler Feb. 16, 2017, 8:57 p.m. UTC
Hi all,

is this patch ok for trunk?

Fixes bootstrap for x86_64-*-freebsd12 where the internal struct rtentry 
has gone from userland.

TIA,
Andreas

2017-02-16  Andreas Tobler  <andreast@gcc.gnu.org>

	PR sanitizer/79562
	* sanitizer_common/sanitizer_platform_limits_posix.cc: Cherry-pick
	upstream r294806.

Comments

Jakub Jelinek Feb. 16, 2017, 9:03 p.m. UTC | #1
On Thu, Feb 16, 2017 at 09:57:48PM +0100, Andreas Tobler wrote:
> is this patch ok for trunk?
> 
> Fixes bootstrap for x86_64-*-freebsd12 where the internal struct rtentry has
> gone from userland.
> 
> TIA,
> Andreas
> 
> 2017-02-16  Andreas Tobler  <andreast@gcc.gnu.org>
> 
> 	PR sanitizer/79562
> 	* sanitizer_common/sanitizer_platform_limits_posix.cc: Cherry-pick
> 	upstream r294806.

Ok, thanks.

I'm just surprised by the
"The problem was introduced within the last 8 days."
comment in the PR, because this file has been modified last time on
2016-11-08.

> Index: libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
> ===================================================================
> --- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc	(revision 245506)
> +++ libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc	(working copy)
> @@ -21,11 +21,6 @@
>  #ifdef _FILE_OFFSET_BITS
>  #undef _FILE_OFFSET_BITS
>  #endif
> -#if SANITIZER_FREEBSD
> -#define _WANT_RTENTRY
> -#include <sys/param.h>
> -#include <sys/socketvar.h>
> -#endif
>  #include <arpa/inet.h>
>  #include <dirent.h>
>  #include <errno.h>
> @@ -420,6 +415,7 @@
>    unsigned struct_input_absinfo_sz = sizeof(struct input_absinfo);
>    unsigned struct_input_id_sz = sizeof(struct input_id);
>    unsigned struct_mtpos_sz = sizeof(struct mtpos);
> +  unsigned struct_rtentry_sz = sizeof(struct rtentry);
>    unsigned struct_termio_sz = sizeof(struct termio);
>    unsigned struct_vt_consize_sz = sizeof(struct vt_consize);
>    unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes);
> @@ -439,7 +435,6 @@
>    unsigned struct_midi_info_sz = sizeof(struct midi_info);
>    unsigned struct_mtget_sz = sizeof(struct mtget);
>    unsigned struct_mtop_sz = sizeof(struct mtop);
> -  unsigned struct_rtentry_sz = sizeof(struct rtentry);
>    unsigned struct_sbi_instrument_sz = sizeof(struct sbi_instrument);
>    unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
>    unsigned struct_synth_info_sz = sizeof(struct synth_info);


	Jakub
Andreas Tobler Feb. 16, 2017, 9:20 p.m. UTC | #2
On 16.02.17 22:03, Jakub Jelinek wrote:
> On Thu, Feb 16, 2017 at 09:57:48PM +0100, Andreas Tobler wrote:
>> is this patch ok for trunk?
>>
>> Fixes bootstrap for x86_64-*-freebsd12 where the internal struct rtentry has
>> gone from userland.
>>
>> TIA,
>> Andreas
>>
>> 2017-02-16  Andreas Tobler  <andreast@gcc.gnu.org>
>>
>> 	PR sanitizer/79562
>> 	* sanitizer_common/sanitizer_platform_limits_posix.cc: Cherry-pick
>> 	upstream r294806.
>
> Ok, thanks.
>
> I'm just surprised by the
> "The problem was introduced within the last 8 days."
> comment in the PR, because this file has been modified last time on
> 2016-11-08.

Yeah, I understand. This is due to the fact that on FreeBSD trunk (aka. 
*-*-freebsd12) this commit 
(https://svnweb.freebsd.org/base?view=revision&revision=313560) dropped 
the _WANT_RTENTRY from net/route.h.
Iow, all version of FreeBSD < svn commit r313560 will build w/o patch.

Thanks,
Andreas

>
>> Index: libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
>> ===================================================================
>> --- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc	(revision 245506)
>> +++ libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc	(working copy)
>> @@ -21,11 +21,6 @@
>>  #ifdef _FILE_OFFSET_BITS
>>  #undef _FILE_OFFSET_BITS
>>  #endif
>> -#if SANITIZER_FREEBSD
>> -#define _WANT_RTENTRY
>> -#include <sys/param.h>
>> -#include <sys/socketvar.h>
>> -#endif
>>  #include <arpa/inet.h>
>>  #include <dirent.h>
>>  #include <errno.h>
>> @@ -420,6 +415,7 @@
>>    unsigned struct_input_absinfo_sz = sizeof(struct input_absinfo);
>>    unsigned struct_input_id_sz = sizeof(struct input_id);
>>    unsigned struct_mtpos_sz = sizeof(struct mtpos);
>> +  unsigned struct_rtentry_sz = sizeof(struct rtentry);
>>    unsigned struct_termio_sz = sizeof(struct termio);
>>    unsigned struct_vt_consize_sz = sizeof(struct vt_consize);
>>    unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes);
>> @@ -439,7 +435,6 @@
>>    unsigned struct_midi_info_sz = sizeof(struct midi_info);
>>    unsigned struct_mtget_sz = sizeof(struct mtget);
>>    unsigned struct_mtop_sz = sizeof(struct mtop);
>> -  unsigned struct_rtentry_sz = sizeof(struct rtentry);
>>    unsigned struct_sbi_instrument_sz = sizeof(struct sbi_instrument);
>>    unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
>>    unsigned struct_synth_info_sz = sizeof(struct synth_info);
>
>
> 	Jakub
>
Andreas Tobler Feb. 17, 2017, 6:24 a.m. UTC | #3
On 16.02.17 22:20, Andreas Tobler wrote:
> On 16.02.17 22:03, Jakub Jelinek wrote:
>> On Thu, Feb 16, 2017 at 09:57:48PM +0100, Andreas Tobler wrote:
>>> is this patch ok for trunk?
>>>
>>> Fixes bootstrap for x86_64-*-freebsd12 where the internal struct rtentry has
>>> gone from userland.
>>>
>>> TIA,
>>> Andreas
>>>
>>> 2017-02-16  Andreas Tobler  <andreast@gcc.gnu.org>
>>>
>>> 	PR sanitizer/79562
>>> 	* sanitizer_common/sanitizer_platform_limits_posix.cc: Cherry-pick
>>> 	upstream r294806.
>>
>> Ok, thanks.
>>
>> I'm just surprised by the
>> "The problem was introduced within the last 8 days."
>> comment in the PR, because this file has been modified last time on
>> 2016-11-08.
>
> Yeah, I understand. This is due to the fact that on FreeBSD trunk (aka.
> *-*-freebsd12) this commit
> (https://svnweb.freebsd.org/base?view=revision&revision=313560) dropped
> the _WANT_RTENTRY from net/route.h.
> Iow, all version of FreeBSD < svn commit r313560 will build w/o patch.


Is it ok to apply on gcc5 and gcc6 branch too? They are also affected.

TIA,

Andreas
Jakub Jelinek Feb. 17, 2017, 3:21 p.m. UTC | #4
On Fri, Feb 17, 2017 at 07:24:45AM +0100, Andreas Tobler wrote:
> > Yeah, I understand. This is due to the fact that on FreeBSD trunk (aka.
> > *-*-freebsd12) this commit
> > (https://svnweb.freebsd.org/base?view=revision&revision=313560) dropped
> > the _WANT_RTENTRY from net/route.h.
> > Iow, all version of FreeBSD < svn commit r313560 will build w/o patch.
> 
> 
> Is it ok to apply on gcc5 and gcc6 branch too? They are also affected.

Ok.

	Jakub
diff mbox

Patch

Index: libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
===================================================================
--- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc	(revision 245506)
+++ libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc	(working copy)
@@ -21,11 +21,6 @@ 
 #ifdef _FILE_OFFSET_BITS
 #undef _FILE_OFFSET_BITS
 #endif
-#if SANITIZER_FREEBSD
-#define _WANT_RTENTRY
-#include <sys/param.h>
-#include <sys/socketvar.h>
-#endif
 #include <arpa/inet.h>
 #include <dirent.h>
 #include <errno.h>
@@ -420,6 +415,7 @@ 
   unsigned struct_input_absinfo_sz = sizeof(struct input_absinfo);
   unsigned struct_input_id_sz = sizeof(struct input_id);
   unsigned struct_mtpos_sz = sizeof(struct mtpos);
+  unsigned struct_rtentry_sz = sizeof(struct rtentry);
   unsigned struct_termio_sz = sizeof(struct termio);
   unsigned struct_vt_consize_sz = sizeof(struct vt_consize);
   unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes);
@@ -439,7 +435,6 @@ 
   unsigned struct_midi_info_sz = sizeof(struct midi_info);
   unsigned struct_mtget_sz = sizeof(struct mtget);
   unsigned struct_mtop_sz = sizeof(struct mtop);
-  unsigned struct_rtentry_sz = sizeof(struct rtentry);
   unsigned struct_sbi_instrument_sz = sizeof(struct sbi_instrument);
   unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
   unsigned struct_synth_info_sz = sizeof(struct synth_info);