public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch for gcc-10.3.0
@ 2021-04-12 11:16 John Hendry
  2021-04-12 12:29 ` Jonathan Wakely
  0 siblings, 1 reply; 6+ messages in thread
From: John Hendry @ 2021-04-12 11:16 UTC (permalink / raw)
  To: gcc-help


	Dear gcc maintainers,

		I'm trying to install gcc-10.3.0 on a 64-bit PC running Crux Linux 3.5.  Make gives the error "bit_AVX512VPTINTERSECT not declared" in cpuinfo.c, line 392 or so, and then AVX512BF16 is not declared 4 lines later.
	The same thing was happening with 10.2 and I don't know whether I've misconfigured something to do with 32-bit libraries for cross-compiling or whether these bits refer to features of machines more advanced.  Can I switch off support for these technological advances?  I couldn't see anything in help for ../configure.
	The closest thing I could find on the internet was on a gentoo forum but had no acknowledgement of a problem.  The patches I've seen seem to be directed to Intel developers, at least not to ordinary users trying to compile gcc.
	Can you confirm that it needs a patch or suggest some files I might modify?

	Thank you for considering my case,
		John Hendry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for gcc-10.3.0
  2021-04-12 11:16 Patch for gcc-10.3.0 John Hendry
@ 2021-04-12 12:29 ` Jonathan Wakely
  2021-04-12 20:29   ` Jim Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Wakely @ 2021-04-12 12:29 UTC (permalink / raw)
  To: John Hendry; +Cc: gcc-help

On Mon, 12 Apr 2021 at 13:10, John Hendry wrote:
>
>
>         Dear gcc maintainers,
>
>                 I'm trying to install gcc-10.3.0 on a 64-bit PC running Crux Linux 3.5.  Make gives the error "bit_AVX512VPTINTERSECT not declared" in cpuinfo.c, line 392 or so, and then AVX512BF16 is not declared 4 lines later.
>         The same thing was happening with 10.2 and I don't know whether I've misconfigured something to do with 32-bit libraries for cross-compiling or whether these bits refer to features of machines more advanced.  Can I switch off support for these technological advances?  I couldn't see anything in help for ../configure.
>         The closest thing I could find on the internet was on a gentoo forum but had no acknowledgement of a problem.  The patches I've seen seem to be directed to Intel developers, at least not to ordinary users trying to compile gcc.
>         Can you confirm that it needs a patch or suggest some files I might modify?

No patch should be needed. GCC 10.2 and 10.3 have been compiled many,
many times on x86_64-linux.

The constant should be bit_AVX512VP2INTERSECT (not
bit_AVX512VPTINTERSECT as you wrote). If the error is really what you
wrote, it suggests your sources have got corrupted somehow.

The bit_AVX512VP2INTERSECT constant is defined in the cpuid.h header
in the same directory.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for gcc-10.3.0
  2021-04-12 12:29 ` Jonathan Wakely
@ 2021-04-12 20:29   ` Jim Wilson
  2021-04-12 20:34     ` Jonathan Wakely
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Wilson @ 2021-04-12 20:29 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: John Hendry, gcc-help

On Mon, Apr 12, 2021 at 5:30 AM Jonathan Wakely via Gcc-help <
gcc-help@gcc.gnu.org> wrote:

> On Mon, 12 Apr 2021 at 13:10, John Hendry wrote:
> >                 I'm trying to install gcc-10.3.0 on a 64-bit PC running
> Crux Linux 3.5.  Make gives the error "bit_AVX512VPTINTERSECT not declared"
> in cpuinfo.c, line 392 or so, and then AVX512BF16 is not declared 4 lines
> later.
>
> The bit_AVX512VP2INTERSECT constant is defined in the cpuid.h header
> in the same directory.
>

But note that there is more than one cpuid.h file on the system, as there
is also one provided by the OS and/or system compiler, and possibly also by
cross compilers.  I've seen this problem happen for people that have
environment variables set that they forgot about, which are causing the
wrong cpuid.h file to be used.  Or maybe you are using a compiler with a
modified specs file, or maybe something else is going wrong.  The system
compiler one is probably older than the gcc version you are trying to
compile, and hence is missing all of the new entries in the file.  This
macro is new in gcc-10, and thus would not be present in a gcc-9 or earlier
cpuid.h file.  So you need to look at the compiler command for the cpuid.c
file and figure out why it is using the wrong cpuid.h file.  You can use
--save-temps to generate a .i file that will show which cpuid.h file is
being used.  You can add -v to see what header file paths are being used
during the compilation.    You can use --print-search-dirs to see what the
default search paths are.  printenv will show you what environment
variables are set.

Jim

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for gcc-10.3.0
  2021-04-12 20:29   ` Jim Wilson
@ 2021-04-12 20:34     ` Jonathan Wakely
  2021-04-13 19:33       ` Jim Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Wakely @ 2021-04-12 20:34 UTC (permalink / raw)
  To: Jim Wilson; +Cc: John Hendry, gcc-help

On Mon, 12 Apr 2021, 21:29 Jim Wilson, <jimw@sifive.com> wrote:

> On Mon, Apr 12, 2021 at 5:30 AM Jonathan Wakely via Gcc-help <
> gcc-help@gcc.gnu.org> wrote:
>
>> On Mon, 12 Apr 2021 at 13:10, John Hendry wrote:
>> >                 I'm trying to install gcc-10.3.0 on a 64-bit PC running
>> Crux Linux 3.5.  Make gives the error "bit_AVX512VPTINTERSECT not declared"
>> in cpuinfo.c, line 392 or so, and then AVX512BF16 is not declared 4 lines
>> later.
>>
>> The bit_AVX512VP2INTERSECT constant is defined in the cpuid.h header
>> in the same directory.
>>
>
> But note that there is more than one cpuid.h file on the system, as there
> is also one provided by the OS and/or system compiler, and possibly also by
> cross compilers.  I've seen this problem happen for people that have
> environment variables set that they forgot about, which are causing the
> wrong cpuid.h file to be used.  Or maybe you are using a compiler with a
> modified specs file, or maybe something else is going wrong.  The system
> compiler one is probably older than the gcc version you are trying to
> compile, and hence is missing all of the new entries in the file.  This
> macro is new in gcc-10, and thus would not be present in a gcc-9 or earlier
> cpuid.h file.  So you need to look at the compiler command for the cpuid.c
> file and figure out why it is using the wrong cpuid.h file.  You can use
> --save-temps to generate a .i file that will show which cpuid.h file is
> being used.  You can add -v to see what header file paths are being used
> during the compilation.    You can use --print-search-dirs to see what the
> default search paths are.  printenv will show you what environment
> variables are set.
>
>
Thanks, Jim. Shouldn't #include "cpuid.h" mean it prefers the one in the
same directory though?



>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for gcc-10.3.0
  2021-04-12 20:34     ` Jonathan Wakely
@ 2021-04-13 19:33       ` Jim Wilson
  2021-04-13 19:50         ` Jonathan Wakely
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Wilson @ 2021-04-13 19:33 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: John Hendry, gcc-help

On Mon, Apr 12, 2021 at 1:34 PM Jonathan Wakely <jwakely.gcc@gmail.com>
wrote:

> On Mon, 12 Apr 2021, 21:29 Jim Wilson, <jimw@sifive.com> wrote:
>
>> On Mon, Apr 12, 2021 at 5:30 AM Jonathan Wakely via Gcc-help <
>> gcc-help@gcc.gnu.org> wrote:
>>
>>> On Mon, 12 Apr 2021 at 13:10, John Hendry wrote:
>>> >                 I'm trying to install gcc-10.3.0 on a 64-bit PC
>>> running Crux Linux 3.5.  Make gives the error "bit_AVX512VPTINTERSECT not
>>> declared" in cpuinfo.c, line 392 or so, and then AVX512BF16 is not declared
>>> 4 lines later.
>>>
>>
> Thanks, Jim. Shouldn't #include "cpuid.h" mean it prefers the one in the
> same directory though?
>

Normally.  GCC is so complicated that I wouldn't be surprised if there is a
way to accidentally break that.  However, in this case, I think we are
looking at the wrong file.  The error is apparently from
libgcc/config/i386/cpuinfo.c which is including gcc/config/i386/cpuid.h and
in this case you definitely need to get the -I options right or the build
can fail.  Looks like the header file gets copied into gcc/include in the
build dir, and is supposed to be found there.  There is a -B option
pointing at the gcc build tree, which then generates a -I option pointing
to the gcc/include build dir, which is the seventh dir in the include list
I see with the -v option.  If someone has an environment variable or shell
alias adding a -I option pointing to the system compiler's header file,
then it might accidentally include the wrong cpuid.h file.

Jim

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for gcc-10.3.0
  2021-04-13 19:33       ` Jim Wilson
@ 2021-04-13 19:50         ` Jonathan Wakely
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Wakely @ 2021-04-13 19:50 UTC (permalink / raw)
  To: Jim Wilson; +Cc: John Hendry, gcc-help

On Tue, 13 Apr 2021, 20:33 Jim Wilson, <jimw@sifive.com> wrote:

> On Mon, Apr 12, 2021 at 1:34 PM Jonathan Wakely <jwakely.gcc@gmail.com>
> wrote:
>
>> On Mon, 12 Apr 2021, 21:29 Jim Wilson, <jimw@sifive.com> wrote:
>>
>>> On Mon, Apr 12, 2021 at 5:30 AM Jonathan Wakely via Gcc-help <
>>> gcc-help@gcc.gnu.org> wrote:
>>>
>>>> On Mon, 12 Apr 2021 at 13:10, John Hendry wrote:
>>>> >                 I'm trying to install gcc-10.3.0 on a 64-bit PC
>>>> running Crux Linux 3.5.  Make gives the error "bit_AVX512VPTINTERSECT not
>>>> declared" in cpuinfo.c, line 392 or so, and then AVX512BF16 is not declared
>>>> 4 lines later.
>>>>
>>>
>> Thanks, Jim. Shouldn't #include "cpuid.h" mean it prefers the one in the
>> same directory though?
>>
>
> Normally.  GCC is so complicated that I wouldn't be surprised if there is
> a way to accidentally break that.  However, in this case, I think we are
> looking at the wrong file.  The error is apparently from
> libgcc/config/i386/cpuinfo.c which is including gcc/config/i386/cpuid.h and
> in this case you
>

Oh good point! I somehow didn't notice that the first component of those
paths is different, so it's definitely affected by the include search order.


 definitely need to get the -I options right or the build can fail.  Looks
> like the header file gets copied into gcc/include in the build dir, and is
> supposed to be found there.  There is a -B option pointing at the gcc build
> tree, which then generates a -I option pointing to the gcc/include build
> dir, which is the seventh dir in the include list I see with the -v
> option.  If someone has an environment variable or shell alias adding a -I
> option pointing to the system compiler's header file, then it might
> accidentally include the wrong cpuid.h file.
>
> Jim
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-13 19:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 11:16 Patch for gcc-10.3.0 John Hendry
2021-04-12 12:29 ` Jonathan Wakely
2021-04-12 20:29   ` Jim Wilson
2021-04-12 20:34     ` Jonathan Wakely
2021-04-13 19:33       ` Jim Wilson
2021-04-13 19:50         ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).