Skip to contentSkip to conversation

libunwind: new pacakge

PATCH New ANDY KENNEDY 4 participants 8 messages Jun 25, 2013 – Jul 28, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libunwind: new pacakge

---

package/Config.in 2013-06-21 17:00:21.000000000 -0500 renamed from package/Config.in 2013-06-20 10:32:07.000000000 -0500 +1 -0
diff -Naur a/package/Config.in b/package/Config.in
@@ -612,6 +612,7 @@
 source "package/libtasn1/Config.in"
 source "package/libtpl/Config.in"
 source "package/libseccomp/Config.in"
+source "package/libunwind/Config.in"
 source "package/liburcu/Config.in"
 source "package/linux-pam/Config.in"
 source "package/log4cxx/Config.in"
package/libunwind/Config.in 2013-06-21 17:23:46.000000000 -0500 renamed from package/libunwind/Config.in 1969-12-31 18:00:00.000000000 -0600 +6 -0
diff -Naur a/package/libunwind/Config.in b/package/libunwind/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_LIBUNWIND
+	bool "libunwind"
+	help
+	  C API to determine the call-chain of a program.
+
+	  Project home:  <http://www.nongnu.org/libunwind/index.html>
package/libunwind/libunwind.mk 2013-06-21 17:23:38.000000000 -0500 renamed from package/libunwind/libunwind.mk 1969-12-31 18:00:00.000000000 -0600 +13 -0
diff -Naur a/package/libunwind/libunwind.mk b/package/libunwind/libunwind.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# libunwind
+#
+################################################################################
+
+LIBUNWIND_VERSION = 1.1
+LIBUNWIND_SITE = http://download.savannah.gnu.org/releases/libunwind
+LIBUNWIND_INSTALL_STAGING = YES
+LIBUNWIND_LICENSE_FILES = COPYING
+LIBUNWIND_LICENSE = MIT
+
+$(eval $(autotools-package))
#1 lore raw

PATCH 1/1 libunwind: new pacakge

Dear ANDY KENNEDY,

package/libunwind/Config.in 2013-06-21 17:23:46.000000000 -0500 line 6

Quoted 6 lines · ANDY KENNEDY
package/libunwind/Config.in 2013-06-21 17:23:46.000000000 -0500 renamed from package/libunwind/Config.in 1969-12-31 18:00:00.000000000 -0600 +6 -0
+config BR2_PACKAGE_LIBUNWIND
+	bool "libunwind"
+	help
+	  C API to determine the call-chain of a program.
+
+	  Project home:  <http://www.nongnu.org/libunwind/index.html>

No need to indicate "Project home:", just:

http://www.nongnu.org/libunwind/index.html

Also:

1) Did you check that it builds fine with uClibc? This kind of library tend to use some funky C library features, sometimes not available in uClibc.

2) The libunwind code seems to contain some architecture-specific code. While aarch64, arm, mips, ppc, sh, x86 and x86-64 are supported, some other architectures that Buildroot supports are not supported. So maybe this package should have a "depends on BR2_aarch64 || BR2_arm || BR2_armeb || ..."

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 libunwind: new pacakge

Quoted 3 lines

package/libunwind/Config.in 2013-06-21 17:23:46.000000000 -0500 line 6

Quoted 1 line
package/libunwind/Config.in 2013-06-21 17:23:46.000000000 -0500 renamed from package/libunwind/Config.in 1969-12-31 18:00:00.000000000 -0600 +1 -0
+	  Project home:  <http://www.nongnu.org/libunwind/index.html>

No need to indicate "Project home:", just:

Okay, I can fix that.

Quoted 8 lines

http://www.nongnu.org/libunwind/index.html

Also:

1) Did you check that it builds fine with uClibc? This kind of library tend to use some funky C library features, sometimes not available in uClibc.

Nope, I didn't.

Quoted 6 lines

2) The libunwind code seems to contain some architecture-specific code. While aarch64, arm, mips, ppc, sh, x86 and x86-64 are supported, some other architectures that Buildroot supports are not supported. So maybe this package should have a "depends on BR2_aarch64 || BR2_arm || BR2_armeb || ..."

That is possible as well. I'm really not devoted to owning this package that much. I was merely attempting to push it back as I added it to our usage of BuildRoot. To that end, shall I abandon the process (as I clearly am not willing to do it justice)?

It is no skin off my nose whether it gets put into BuildRoot, I was only pushing it back as I didn't know it was there until someone else I work with pointed out that this *seems* to be the basic library GDB is based off of, thus could be useful in our embedded system.

Anybody willing to carry this flag for me? I'm just not that committed to it.

Andy

#3 lore raw

PATCH 1/1 libunwind: new pacakge

Dear ANDY KENNEDY,

Quoted 5 lines · ANDY KENNEDY
Quoted 3 lines

1) Did you check that it builds fine with uClibc? This kind of library tend to use some funky C library features, sometimes not available in uClibc.

Nope, I didn't.

Then just do a build with a uClibc toolchain. If you don't want to wait for the toolchain to build, you can use
http://autobuild.buildroot.org/toolchains/tarballs/br-arm-basic-2013.05-1.tar.bz2
as an external toolchain. It's a basic ARM uClibc toolchain (with no option enabled: no WCHAR, no largefile, no IPv6, no RPC, no locales).

Quoted 10 lines
Quoted 5 lines

2) The libunwind code seems to contain some architecture-specific code. While aarch64, arm, mips, ppc, sh, x86 and x86-64 are supported, some other architectures that Buildroot supports are not supported. So maybe this package should have a "depends on BR2_aarch64 || BR2_arm || BR2_armeb || ..."

That is possible as well. I'm really not devoted to owning this package that much. I was merely attempting to push it back as I added it to our usage of BuildRoot. To that end, shall I abandon the process (as I clearly am not willing to do it justice)?

No, you shouldn't abandon the process. Your contributions are very welcome! I think you're very close to have something that can be merged, just keep sending new revisions of your patch that takes into account the comments from contributors.

Quoted 4 lines

It is no skin off my nose whether it gets put into BuildRoot, I was only pushing it back as I didn't know it was there until someone else I work with pointed out that this *seems* to be the basic library GDB is based off of, thus could be useful in our embedded system.

Yes, it would certainly be useful.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/1 libunwind: new pacakge

Quoted 11 lines
Quoted 5 lines
Quoted 3 lines

1) Did you check that it builds fine with uClibc? This kind of library tend to use some funky C library features, sometimes not available in uClibc.

Nope, I didn't.

Then just do a build with a uClibc toolchain. If you don't want to wait for the toolchain to build, you can use
http://autobuild.buildroot.org/toolchains/tarballs/br-arm-basic-2013.05-1.tar.bz2
as an external toolchain. It's a basic ARM uClibc toolchain (with no option enabled: no WCHAR, no largefile, no IPv6, no RPC, no locales).

Had some time to fool around with this. A couple of things to note:

execinfo.h STILL doesn't end up in the toolchain when building uClibc. Copying that file over to the toolchain gets past that, however, there are a other errors:

../src/.libs/libunwind.so: undefined reference to sigreturn' ../src/.libs/libunwind.so: undefined reference to setcontext'
collect2: error: ld returned 1 exit status ../src/.libs/libunwind-x86.so: undefined reference to sigreturn' ../src/.libs/libunwind-x86.so: undefined reference to setcontext'
collect2: error: ld returned 1 exit status ../src/.libs/libunwind-x86.so: undefined reference to sigreturn' ../src/.libs/libunwind-x86.so: undefined reference to setcontext'
collect2: error: ld returned 1 exit status

I'm wondering whether these are configuration issues with uClibc, or if these various symbols are never available in uClibc. Anyone know?

Pending the outcome of that question, I'll put in the config a dependency of !BR2_TOOLCHAIN_*_<uclibc>.

Andy

#5 lore raw

PATCH 1/1 libunwind: new pacakge

In reply to Thomas Petazzoni

Hi,

as we are also using libunwind with buildroot, perhaps I can add some of our experiences with it...

Plain libunwind-1.1 won't compile on uClibc x86 as it uses setcontext(). This function is not available in uClibc (at least not in the released versions). I have worked around this by commenting out some code in libunwind (see attached patch), but this is probably not a good solution.

I've also had a build failure at some point in the tests because there is code that includes execinfo.h unconditionally.

I've attached the patches that we are using with libunwind. Perhaps they can be useful for you.

Regards,
Sven

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libunwind-001-disable-code-that-doesn-t-compile-with-uCLibc.patch
Type: text/x-patch
Size: 921 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130626/1a6ad7d3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libunwind-002-tests-don-t-include-execinfo.h-unconditionally.patch
Type: text/x-patch
Size: 1192 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130626/1a6ad7d3/attachment-0001.bin>

#6 lore raw

PATCH 1/1 libunwind: new pacakge

In reply to ANDY KENNEDY

Andy, All,

On 2013-06-25 21:41 +0000, ANDY KENNEDY spake thusly:

Quoted 17 lines

---
diff -Naur a/package/Config.in b/package/Config.in

package/Config.in 2013-06-21 17:00:21.000000000 -0500 renamed from package/Config.in 2013-06-20 10:32:07.000000000 -0500 +1 -0
@@ -612,6 +612,7 @@
 source "package/libtasn1/Config.in"
 source "package/libtpl/Config.in"
 source "package/libseccomp/Config.in"
+source "package/libunwind/Config.in"
 source "package/liburcu/Config.in"
 source "package/linux-pam/Config.in"
 source "package/log4cxx/Config.in"

diff -Naur a/package/libunwind/Config.in b/package/libunwind/Config.in

package/libunwind/Config.in 2013-06-21 17:23:46.000000000 -0500 line 6

Quoted 6 lines
package/libunwind/Config.in 2013-06-21 17:23:46.000000000 -0500 renamed from package/libunwind/Config.in 1969-12-31 18:00:00.000000000 -0600 +6 -0
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_LIBUNWIND
+	bool "libunwind"
+	help
+	  C API to determine the call-chain of a program.
+
+	  Project home:  <http://www.nongnu.org/libunwind/index.html>

In addition to other comments, could you please add a changelog to your patch, and a version number in the subject? Such as:

[PATCH v3] libunwind: new pacakge

sob: you

---
Changes v2->v3:
- blabla
Changes v1->v2:
- blabla
- blabla

This is a least version 3 (or 4?) of this patch, and its hard to tell what changed between revisions, and to check if suggestions were applied.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#7 lore raw

PATCH 1/1 libunwind: new pacakge

In reply to ANDY KENNEDY

Dear ANDY KENNEDY,

Quoted 1 line · ANDY KENNEDY

Thanks, applied with a few additional fixes.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com