Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Target/full GDB fails to build statically
@ 2015-08-20 13:10 Alexey Brodkin
  2015-08-20 20:37 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Brodkin @ 2015-08-20 13:10 UTC (permalink / raw)
  To: buildroot

Hello,

I tried to build gdb statically in latest Buildroot but with no luck.
My defconfig is:
----------------->8-----------------
BR2_arm=y
BR2_STATIC_LIBS=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_PTHREAD_DEBUG=y
BR2_PACKAGE_GDB=y
BR2_PACKAGE_GDB_DEBUGGER=y
----------------->8-----------------

And that's what I see in the very end:
----------------->8-----------------
linux-thread-db.c:23:19: fatal error: dlfcn.h: No such file or directory
 #include <dlfcn.h>
                   ^
compilation terminated.
Makefile:1078: recipe for target 'linux-thread-db.o' failed
make[4]: *** [linux-thread-db.o] Error 1
make[4]: *** Waiting for unfinished jobs....
Makefile:8335: recipe for target 'all-gdb' failed
make[3]: *** [all-gdb] Error 2
Makefile:832: recipe for target 'all' failed
make[2]: *** [all] Error 2
----------------->8-----------------

Seeing that GDB is not disabled in case of BR2_STATIC_LIBS=y I had a hope it could
be built. But looks like something is broken.

I tried the same for ARC (where we use pretty recent gdb 7.9.1) and got exactly
the same result.

If BR2_PACKAGE_GDB_DEBUGGER is disabled gdbserver gets built perfectly fine.
----------------->8-----------------
$ file build/gdb-7.8.2/gdb/gdbserver/gdbserver 
build/gdb-7.8.2/gdb/gdbserver/gdbserver: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
----------------->8-----------------

So whether we need to disable building of target/full gdb statically or somebody will need to look into it.
Given close relese of 2015.08 we may want to implement a former approach.

Still thought are much appreciated.

-Alexey

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

* [Buildroot] Target/full GDB fails to build statically
  2015-08-20 13:10 [Buildroot] Target/full GDB fails to build statically Alexey Brodkin
@ 2015-08-20 20:37 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2015-08-20 20:37 UTC (permalink / raw)
  To: buildroot

Dear Alexey Brodkin,

On Thu, 20 Aug 2015 13:10:25 +0000, Alexey Brodkin wrote:

> And that's what I see in the very end:
> ----------------->8-----------------
> linux-thread-db.c:23:19: fatal error: dlfcn.h: No such file or directory
>  #include <dlfcn.h>
>                    ^
> compilation terminated.
> Makefile:1078: recipe for target 'linux-thread-db.o' failed
> make[4]: *** [linux-thread-db.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
> Makefile:8335: recipe for target 'all-gdb' failed
> make[3]: *** [all-gdb] Error 2
> Makefile:832: recipe for target 'all' failed
> make[2]: *** [all] Error 2
> ----------------->8-----------------
> 
> Seeing that GDB is not disabled in case of BR2_STATIC_LIBS=y I had a hope it could
> be built. But looks like something is broken.
> 
> I tried the same for ARC (where we use pretty recent gdb 7.9.1) and got exactly
> the same result.
> 
> If BR2_PACKAGE_GDB_DEBUGGER is disabled gdbserver gets built perfectly fine.
> ----------------->8-----------------
> $ file build/gdb-7.8.2/gdb/gdbserver/gdbserver 
> build/gdb-7.8.2/gdb/gdbserver/gdbserver: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
> ----------------->8-----------------
> 
> So whether we need to disable building of target/full gdb statically or somebody will need to look into it.
> Given close relese of 2015.08 we may want to implement a former approach.

I believe we should mark the full gdb as requiring dynamic library
support. Maybe with threads disabled, dynamic library support is not
mandatory. But I don't think it's really worth the effort: if you want
to do static only, you have tight requirements and you probably can't
fit a full-blown gdb on your target.

So a patch making full gdb "depends on !BR2_STATIC_LIBS" would be fine
for me.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2015-08-20 20:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20 13:10 [Buildroot] Target/full GDB fails to build statically Alexey Brodkin
2015-08-20 20:37 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox