* [Buildroot] [PATCH] package/gdb: fix gnulib issue with musl and uClibc toolchains
@ 2016-07-23 16:50 Romain Naour
2016-07-24 13:55 ` Thomas Petazzoni
0 siblings, 1 reply; 6+ messages in thread
From: Romain Naour @ 2016-07-23 16:50 UTC (permalink / raw)
To: buildroot
gnulib whant to use rpl_gettimeofday due bad guessing when
cross-compiling with musl and uClibc toolchains.
tracepoint-ipa.o: In function `get_timestamp':
tracepoint.c:(.text+0x147): undefined reference to `rpl_gettimeofday'
Makefile:329: recipe for target 'libinproctrace.so' failed
reported upstream:
https://sourceware.org/bugzilla/show_bug.cgi?id=19798
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
...fix-bad-guessing-when-cross-compiling-wit.patch | 65 ++++++++++++++++++++++
1 file changed, 65 insertions(+)
create mode 100644 package/gdb/7.11.1/0001-gdb-gnulib-fix-bad-guessing-when-cross-compiling-wit.patch
diff --git a/package/gdb/7.11.1/0001-gdb-gnulib-fix-bad-guessing-when-cross-compiling-wit.patch b/package/gdb/7.11.1/0001-gdb-gnulib-fix-bad-guessing-when-cross-compiling-wit.patch
new file mode 100644
index 0000000..1ad0f5c
--- /dev/null
+++ b/package/gdb/7.11.1/0001-gdb-gnulib-fix-bad-guessing-when-cross-compiling-wit.patch
@@ -0,0 +1,65 @@
+From 5696f95f7a6c214319a10edbdb4037ebec7a02f7 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Sat, 23 Jul 2016 18:39:15 +0200
+Subject: [PATCH] gdb/gnulib: fix bad guessing when cross-compiling with musl
+ and uClibc toolchains
+
+Commit b2234a55a9065eeb2aba8d26706c63facd34f3ef disable gettimeofday
+replacement with rpl_gettimeofday for glibc toolchains but the same
+fix is needed for musl and uClibc toolchains.
+
+Otherwise the build fail with this error:
+tracepoint-ipa.o: In function `get_timestamp':
+tracepoint.c:(.text+0x147): undefined reference to `rpl_gettimeofday'
+Makefile:329: recipe for target 'libinproctrace.so' failed
+
+"It's a bit nasty. Basically there are a lot of configure tests being
+done in order to figure out if the used runtime routines adhere to the
+standard(s). A couple of those tests concern gettimeofday(). The last
+one wants to check if gettimeofday() and localtime() share a static
+buffer (apparently a MacOS X issue)" [2]
+
+[1] https://sourceware.org/bugzilla/show_bug.cgi?id=19798
+[2] http://www.riscos.info/pipermail/gcc/2014-April/006093.html
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ gdb/gnulib/configure | 4 +++-
+ gdb/gnulib/import/m4/gettimeofday.m4 | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/gnulib/configure b/gdb/gnulib/configure
+index 540bad3..c5f6078 100644
+--- a/gdb/gnulib/configure
++++ b/gdb/gnulib/configure
+@@ -13520,8 +13520,10 @@ else
+ if test "$cross_compiling" = yes; then :
+ # When cross-compiling:
+ case "$host_os" in
+- # Guess all is fine on glibc systems.
++ # Guess all is fine on glibc/musl/uClibc systems.
+ *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
++ *-musl*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
++ *-uclibc*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
+ esac
+diff --git a/gdb/gnulib/import/m4/gettimeofday.m4 b/gdb/gnulib/import/m4/gettimeofday.m4
+index ce246e1..7984252 100644
+--- a/gdb/gnulib/import/m4/gettimeofday.m4
++++ b/gdb/gnulib/import/m4/gettimeofday.m4
+@@ -109,8 +109,10 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
+ [gl_cv_func_gettimeofday_clobber=yes],
+ [# When cross-compiling:
+ case "$host_os" in
+- # Guess all is fine on glibc systems.
++ # Guess all is fine on glibc/musl/uClibc systems.
+ *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
++ *-musl*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
++ *-uclibc*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
+ esac
+--
+2.5.5
+
--
2.5.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] package/gdb: fix gnulib issue with musl and uClibc toolchains
2016-07-23 16:50 [Buildroot] [PATCH] package/gdb: fix gnulib issue with musl and uClibc toolchains Romain Naour
@ 2016-07-24 13:55 ` Thomas Petazzoni
2016-07-24 14:13 ` Romain Naour
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2016-07-24 13:55 UTC (permalink / raw)
To: buildroot
Hello,
On Sat, 23 Jul 2016 18:50:22 +0200, Romain Naour wrote:
> gnulib whant to use rpl_gettimeofday due bad guessing when
> cross-compiling with musl and uClibc toolchains.
>
> tracepoint-ipa.o: In function `get_timestamp':
> tracepoint.c:(.text+0x147): undefined reference to `rpl_gettimeofday'
> Makefile:329: recipe for target 'libinproctrace.so' failed
I tested the following defconfig:
BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_VFP=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-cortex-a9-musl-2016.05-1162-g94c7298.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_6=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_GDB=y
BR2_PACKAGE_GDB_SERVER=y
BR2_PACKAGE_GDB_DEBUGGER=y
# BR2_TARGET_ROOTFS_TAR is not set
and did not encounter any problem.
If you can still reproduce the problem, isn't it solved by:
GDB_CONF_ENV += gl_cv_func_gettimeofday_clobber=no
?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] package/gdb: fix gnulib issue with musl and uClibc toolchains
2016-07-24 13:55 ` Thomas Petazzoni
@ 2016-07-24 14:13 ` Romain Naour
2016-07-24 14:17 ` Thomas Petazzoni
0 siblings, 1 reply; 6+ messages in thread
From: Romain Naour @ 2016-07-24 14:13 UTC (permalink / raw)
To: buildroot
Hi Thomas,
Le 24/07/2016 ? 15:55, Thomas Petazzoni a ?crit :
> Hello,
>
> On Sat, 23 Jul 2016 18:50:22 +0200, Romain Naour wrote:
>> gnulib whant to use rpl_gettimeofday due bad guessing when
>> cross-compiling with musl and uClibc toolchains.
>>
>> tracepoint-ipa.o: In function `get_timestamp':
>> tracepoint.c:(.text+0x147): undefined reference to `rpl_gettimeofday'
>> Makefile:329: recipe for target 'libinproctrace.so' failed
>
> I tested the following defconfig:
>
> BR2_arm=y
> BR2_cortex_a9=y
> BR2_ARM_ENABLE_VFP=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
> BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-cortex-a9-musl-2016.05-1162-g94c7298.tar.bz2"
> BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
> BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_6=y
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
> BR2_TOOLCHAIN_EXTERNAL_CXX=y
> BR2_INIT_NONE=y
> BR2_SYSTEM_BIN_SH_NONE=y
> # BR2_PACKAGE_BUSYBOX is not set
> BR2_PACKAGE_GDB=y
> BR2_PACKAGE_GDB_SERVER=y
> BR2_PACKAGE_GDB_DEBUGGER=y
> # BR2_TARGET_ROOTFS_TAR is not set
>
> and did not encounter any problem.
>
> If you can still reproduce the problem, isn't it solved by:
>
> GDB_CONF_ENV += gl_cv_func_gettimeofday_clobber=no
Ha! yes, gdb build fine with this! (musl and uClibc)
Do you want to fix this locally (Reported-by) or I should resend a patch ?
Thanks,
Romain
>
> ?
>
> Thanks,
>
> Thomas
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] package/gdb: fix gnulib issue with musl and uClibc toolchains
2016-07-24 14:13 ` Romain Naour
@ 2016-07-24 14:17 ` Thomas Petazzoni
2016-07-24 14:24 ` Romain Naour
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2016-07-24 14:17 UTC (permalink / raw)
To: buildroot
Hello Romain,
On Sun, 24 Jul 2016 16:13:30 +0200, Romain Naour wrote:
> > I tested the following defconfig:
> >
> > BR2_arm=y
> > BR2_cortex_a9=y
> > BR2_ARM_ENABLE_VFP=y
> > BR2_TOOLCHAIN_EXTERNAL=y
> > BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
> > BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> > BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-cortex-a9-musl-2016.05-1162-g94c7298.tar.bz2"
> > BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
> > BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_6=y
> > BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
> > BR2_TOOLCHAIN_EXTERNAL_CXX=y
> > BR2_INIT_NONE=y
> > BR2_SYSTEM_BIN_SH_NONE=y
> > # BR2_PACKAGE_BUSYBOX is not set
> > BR2_PACKAGE_GDB=y
> > BR2_PACKAGE_GDB_SERVER=y
> > BR2_PACKAGE_GDB_DEBUGGER=y
> > # BR2_TARGET_ROOTFS_TAR is not set
> >
> > and did not encounter any problem.
Seems like you missed this part of my e-mail. I was *not* able to
reproduce the build problem.
> > If you can still reproduce the problem, isn't it solved by:
> >
> > GDB_CONF_ENV += gl_cv_func_gettimeofday_clobber=no
>
> Ha! yes, gdb build fine with this! (musl and uClibc)
>
> Do you want to fix this locally (Reported-by) or I should resend a patch ?
Please send a patch, but please indicate which configuration fails for
you, as I was unable to reproduce the issue.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] package/gdb: fix gnulib issue with musl and uClibc toolchains
2016-07-24 14:17 ` Thomas Petazzoni
@ 2016-07-24 14:24 ` Romain Naour
2016-07-24 14:26 ` Thomas Petazzoni
0 siblings, 1 reply; 6+ messages in thread
From: Romain Naour @ 2016-07-24 14:24 UTC (permalink / raw)
To: buildroot
Hi Thomas,
Le 24/07/2016 ? 16:17, Thomas Petazzoni a ?crit :
> Hello Romain,
>
> On Sun, 24 Jul 2016 16:13:30 +0200, Romain Naour wrote:
>
>>> I tested the following defconfig:
>>>
>>> BR2_arm=y
>>> BR2_cortex_a9=y
>>> BR2_ARM_ENABLE_VFP=y
>>> BR2_TOOLCHAIN_EXTERNAL=y
>>> BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
>>> BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
>>> BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-cortex-a9-musl-2016.05-1162-g94c7298.tar.bz2"
>>> BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
>>> BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_6=y
>>> BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
>>> BR2_TOOLCHAIN_EXTERNAL_CXX=y
>>> BR2_INIT_NONE=y
>>> BR2_SYSTEM_BIN_SH_NONE=y
>>> # BR2_PACKAGE_BUSYBOX is not set
>>> BR2_PACKAGE_GDB=y
>>> BR2_PACKAGE_GDB_SERVER=y
>>> BR2_PACKAGE_GDB_DEBUGGER=y
>>> # BR2_TARGET_ROOTFS_TAR is not set
>>>
>>> and did not encounter any problem.
>
> Seems like you missed this part of my e-mail. I was *not* able to
> reproduce the build problem.
Sorry...
>
>>> If you can still reproduce the problem, isn't it solved by:
>>>
>>> GDB_CONF_ENV += gl_cv_func_gettimeofday_clobber=no
>>
>> Ha! yes, gdb build fine with this! (musl and uClibc)
>>
>> Do you want to fix this locally (Reported-by) or I should resend a patch ?
>
> Please send a patch, but please indicate which configuration fails for
> you, as I was unable to reproduce the issue.
The issue appear with gdb 7.11.1 only, that's due to bundled gnulib version has
been updated.
We didn't see this issue in the autobuilders since gdb 7.11.1 is not tested (not
the default Kconfig choice)
Anyway, I tested your proposal with gdb 7.11.1 and it working well :)
I'll resend the patch in a moment.
Best regards,
Romain
>
> Thanks!
>
> Thomas
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] package/gdb: fix gnulib issue with musl and uClibc toolchains
2016-07-24 14:24 ` Romain Naour
@ 2016-07-24 14:26 ` Thomas Petazzoni
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2016-07-24 14:26 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 24 Jul 2016 16:24:37 +0200, Romain Naour wrote:
> The issue appear with gdb 7.11.1 only, that's due to bundled gnulib version has
> been updated.
> We didn't see this issue in the autobuilders since gdb 7.11.1 is not tested (not
> the default Kconfig choice)
Aah, ok! I indeed tested with gdb 7.10 and not 7.11. I think the fact
that it happens only starting with gdb 7.11 was missing in your commit
log :-)
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-07-24 14:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-23 16:50 [Buildroot] [PATCH] package/gdb: fix gnulib issue with musl and uClibc toolchains Romain Naour
2016-07-24 13:55 ` Thomas Petazzoni
2016-07-24 14:13 ` Romain Naour
2016-07-24 14:17 ` Thomas Petazzoni
2016-07-24 14:24 ` Romain Naour
2016-07-24 14:26 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox