public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Errors cross-compiling gdbserver with glibc-2.34
@ 2021-08-09  9:29 Chris Packham
  2021-08-09  9:46 ` Florian Weimer
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Packham @ 2021-08-09  9:29 UTC (permalink / raw)
  To: libc-help

Hi,

I'm looking at updating crosstool-ng to add glibc-2.34. I can generate a 
toolchain fine but when I try to build gdbserver (which can be enabled 
as part of the crosstool-ng build) I get some odd gnulib build errors.

https://github.com/crosstool-ng/crosstool-ng/pull/1570#issuecomment-893784531

I can disable building gdbserver as part of crosstool-ng and 
successfully generate a toolchain. But when I use that toolchain to 
manually build gdbserver I get the same error (included below as it has 
a bit more useful output than on the link above).

   CXX    amd64-linux-siginfo.o
In file included from 
/home/ctng/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/bits/sigstksz.h:24,
                  from 
/home/ctng/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/signal.h:328,
                  from build-gnulib-gdbserver/import/signal.h:52,
                  from 
../../../gdb-9.2/gdb/gdbserver/../nat/amd64-linux-siginfo.c:20:
build-gnulib-gdbserver/import/unistd.h:135:3: error: #error "Please 
include config.h first."
   135 |  #error "Please include config.h first."
       |   ^~~~~
In file included from 
/home/ctng/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/bits/sigstksz.h:24,
                  from 
/home/ctng/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/signal.h:328,
                  from build-gnulib-gdbserver/import/signal.h:52,
                  from 
../../../gdb-9.2/gdb/gdbserver/../nat/amd64-linux-siginfo.c:20:
build-gnulib-gdbserver/import/unistd.h:137:1: error: 
'_GL_INLINE_HEADER_BEGIN' does not name a type
   137 | _GL_INLINE_HEADER_BEGIN
       | ^~~~~~~~~~~~~~~~~~~~~~~
build-gnulib-gdbserver/import/unistd.h:1929:1: error: 
'_GL_INLINE_HEADER_END' does not name a type
  1929 | _GL_INLINE_HEADER_END
       | ^~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:635: amd64-linux-siginfo.o] Error 1

Everything works fine with the same configuration under glibc-2.33.

Any clues as to what might be going on? I'm kind of thinking there must 
be some difference in include paths between glibc-2.33 and glibc-2.34.

Thanks,
Chris


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

* Re: Errors cross-compiling gdbserver with glibc-2.34
  2021-08-09  9:29 Errors cross-compiling gdbserver with glibc-2.34 Chris Packham
@ 2021-08-09  9:46 ` Florian Weimer
  2021-08-09 21:10   ` Chris Packham
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2021-08-09  9:46 UTC (permalink / raw)
  To: Chris Packham via Libc-help; +Cc: Chris Packham

* Chris Packham via Libc-help:

> I'm looking at updating crosstool-ng to add glibc-2.34. I can generate a 
> toolchain fine but when I try to build gdbserver (which can be enabled 
> as part of the crosstool-ng build) I get some odd gnulib build errors.
>
> https://github.com/crosstool-ng/crosstool-ng/pull/1570#issuecomment-893784531
>
> I can disable building gdbserver as part of crosstool-ng and 
> successfully generate a toolchain. But when I use that toolchain to 
> manually build gdbserver I get the same error (included below as it has 
> a bit more useful output than on the link above).
>
>    CXX    amd64-linux-siginfo.o
> In file included from 
> /home/ctng/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/bits/sigstksz.h:24,
>                   from 
> /home/ctng/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/signal.h:328,
>                   from build-gnulib-gdbserver/import/signal.h:52,
>                   from 
> ../../../gdb-9.2/gdb/gdbserver/../nat/amd64-linux-siginfo.c:20:
> build-gnulib-gdbserver/import/unistd.h:135:3: error: #error "Please 
> include config.h first."

gnulib apparently overrides <unistd.h> with an incompatible header.
There is nothing that glibc can do about this.

Thanks,
Florian


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

* Re: Errors cross-compiling gdbserver with glibc-2.34
  2021-08-09  9:46 ` Florian Weimer
@ 2021-08-09 21:10   ` Chris Packham
  2021-08-11 10:36     ` Szabolcs Nagy
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Packham @ 2021-08-09 21:10 UTC (permalink / raw)
  To: Florian Weimer, Chris Packham via Libc-help


On 9/08/21 9:46 pm, Florian Weimer wrote:
> * Chris Packham via Libc-help:
>
>> I'm looking at updating crosstool-ng to add glibc-2.34. I can generate a
>> toolchain fine but when I try to build gdbserver (which can be enabled
>> as part of the crosstool-ng build) I get some odd gnulib build errors.
>>
>> https://github.com/crosstool-ng/crosstool-ng/pull/1570#issuecomment-893784531
>>
>> I can disable building gdbserver as part of crosstool-ng and
>> successfully generate a toolchain. But when I use that toolchain to
>> manually build gdbserver I get the same error (included below as it has
>> a bit more useful output than on the link above).
>>
>>     CXX    amd64-linux-siginfo.o
>> In file included from
>> /home/ctng/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/bits/sigstksz.h:24,
>>                    from
>> /home/ctng/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/signal.h:328,
>>                    from build-gnulib-gdbserver/import/signal.h:52,
>>                    from
>> ../../../gdb-9.2/gdb/gdbserver/../nat/amd64-linux-siginfo.c:20:
>> build-gnulib-gdbserver/import/unistd.h:135:3: error: #error "Please
>> include config.h first."
> gnulib apparently overrides <unistd.h> with an incompatible header.
> There is nothing that glibc can do about this.

Yes I came to the same conclusion after I send my initial email.

As of glibc commit 6c57d32048 ("sysconf: Add 
_SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305]") there is a new include chain 
from signal.h to unistd.h. There's nothing wrong with that it just 
happens that unistd.h is one of the headers that the gnulib bundled with 
gdb overrides.

It's likely that I'll end up needing to patch gdb to fix this (currently 
no idea what the patch would look like). I haven't attempted to compile 
a newer gdb so I don't know if this is something already dealt with 
(there is a source code re-arrangement in gdb-10 that requires some 
changes in crosstool-ng that I haven't got round to). If anyone that 
works with gnulib and/or gdb is on this list I'd like to know if you've 
already encountered this.

Hopefully this is at least a breadcrumb for future web searchers to follow.

> Thanks,
> Florian

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

* Re: Errors cross-compiling gdbserver with glibc-2.34
  2021-08-09 21:10   ` Chris Packham
@ 2021-08-11 10:36     ` Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2021-08-11 10:36 UTC (permalink / raw)
  To: Chris Packham; +Cc: Florian Weimer, Chris Packham via Libc-help

The 08/09/2021 21:10, Chris Packham via Libc-help wrote:
> 
> On 9/08/21 9:46 pm, Florian Weimer wrote:
> > * Chris Packham via Libc-help:
> >
> >> I'm looking at updating crosstool-ng to add glibc-2.34. I can generate a
> >> toolchain fine but when I try to build gdbserver (which can be enabled
> >> as part of the crosstool-ng build) I get some odd gnulib build errors.
> >>
> >> https://github.com/crosstool-ng/crosstool-ng/pull/1570#issuecomment-893784531
> >>
> >> I can disable building gdbserver as part of crosstool-ng and
> >> successfully generate a toolchain. But when I use that toolchain to
> >> manually build gdbserver I get the same error (included below as it has
> >> a bit more useful output than on the link above).
> >>
> >>     CXX    amd64-linux-siginfo.o
> >> In file included from
> >> /home/ctng/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/bits/sigstksz.h:24,
> >>                    from
> >> /home/ctng/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/signal.h:328,
> >>                    from build-gnulib-gdbserver/import/signal.h:52,
> >>                    from
> >> ../../../gdb-9.2/gdb/gdbserver/../nat/amd64-linux-siginfo.c:20:
> >> build-gnulib-gdbserver/import/unistd.h:135:3: error: #error "Please
> >> include config.h first."
> > gnulib apparently overrides <unistd.h> with an incompatible header.
> > There is nothing that glibc can do about this.
> 
> Yes I came to the same conclusion after I send my initial email.

what makes gnulib want to override unistd.h?
(usually there is some portability check that fails)

i think you should look at that. (it may affect more
than just old gdb builds)

> 
> As of glibc commit 6c57d32048 ("sysconf: Add 
> _SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305]") there is a new include chain 
> from signal.h to unistd.h. There's nothing wrong with that it just 
> happens that unistd.h is one of the headers that the gnulib bundled with 
> gdb overrides.
> 
> It's likely that I'll end up needing to patch gdb to fix this (currently 
> no idea what the patch would look like). I haven't attempted to compile 
> a newer gdb so I don't know if this is something already dealt with 
> (there is a source code re-arrangement in gdb-10 that requires some 
> changes in crosstool-ng that I haven't got round to). If anyone that 
> works with gnulib and/or gdb is on this list I'd like to know if you've 
> already encountered this.
> 
> Hopefully this is at least a breadcrumb for future web searchers to follow.
> 
> > Thanks,
> > Florian

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

end of thread, other threads:[~2021-08-11 10:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09  9:29 Errors cross-compiling gdbserver with glibc-2.34 Chris Packham
2021-08-09  9:46 ` Florian Weimer
2021-08-09 21:10   ` Chris Packham
2021-08-11 10:36     ` Szabolcs Nagy

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).