From: "Andr? Draszik" <git@andred.net>
To: yocto@yoctoproject.org
Subject: [yocto][meta-gplv2][PATCH 1/2] coreutils: fix build with 64bit time_t on 32bit arches
Date: Fri, 10 Jan 2020 17:15:40 +0000 [thread overview]
Message-ID: <20200110171541.31341-1-git@andred.net> (raw)
From: André Draszik <git@andred.net>
| ../../coreutils-6.9/lib/mktime.c: In function 'ydhms_diff':
| ../../coreutils-6.9/lib/mktime.c:105:52: error: size of array 'a' is negative
| 105 | #define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
| | ^
| ../../coreutils-6.9/lib/mktime.c:168:3: note: in expansion of macro 'verify'
| 168 | verify (long_int_year_and_yday_are_wide_enough,
| | ^~~~~~
coreutils tries to determine of mktime() from the c-library
works fine, but when cross-compiling, it unconditionally
assumes buggy behaviour, in which case it will use its own
replacement implementation. These basically are tests for
(g)libc implementation bugs that have existed in ancient
times but aren't relevant anymore.
The alternative implementation makes various assumptions which
don't hold true (and doesn't compile anymore). While more recent
versions of coreutils have fixed those assumptions, it's quite
hard to update the code here without potential licensing issues.
Given mktime() works fine in musl and glibc these days, we can
work-around the issues by simply relying on the c-libraries
mktime() implementation, avoiding all problems with coreutils'
alternative implementation.
I've veryfied this by running the tests both on my musl target,
and my glibc (v2.29) host.
This also reduces code-size slightly.
The ac_cv_func_working_mktime variable here corresponds to the
gl_cv_func_working_mktime variable in more recent versions of
coreutils (gnulib), which is being set in oe-core in meta/site.
Signed-off-by: André Draszik <git@andred.net>
---
recipes-core/coreutils/coreutils_6.9.bb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/recipes-core/coreutils/coreutils_6.9.bb b/recipes-core/coreutils/coreutils_6.9.bb
index 080100d..f6017ec 100644
--- a/recipes-core/coreutils/coreutils_6.9.bb
+++ b/recipes-core/coreutils/coreutils_6.9.bb
@@ -33,7 +33,9 @@ SRC_URI[md5sum] = "c9607d8495f16e98906e7ed2d9751a06"
SRC_URI[sha256sum] = "89c2895ad157de50e53298b22d91db116ee4e1dd3fdf4019260254e2e31497b0"
EXTRA_OECONF += "ac_cv_func_getgroups_works=yes \
- ac_cv_func_strcoll_works=yes"
+ ac_cv_func_strcoll_works=yes \
+ ac_cv_func_working_mktime=yes \
+ "
# acl is not a default feature
#
--
2.23.0.rc1
next reply other threads:[~2020-01-10 17:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 17:15 Andr? Draszik [this message]
2020-01-10 17:15 ` [yocto][meta-gplv2][PATCH 2/2] coreutils: set some more autotools / m4 test results Andr? Draszik
[not found] ` <15E895F472611D11.20149@lists.yoctoproject.org>
2020-01-20 9:02 ` André Draszik
[not found] ` <15EB8CDD7696F9CF.25959@lists.yoctoproject.org>
2020-01-27 11:25 ` André Draszik
[not found] <15E895F47D5A4AF2.20149@lists.yoctoproject.org>
2020-01-20 9:02 ` [yocto][meta-gplv2][PATCH 1/2] coreutils: fix build with 64bit time_t on 32bit arches André Draszik
[not found] ` <15EB8CDACC7333A9.19926@lists.yoctoproject.org>
2020-01-27 11:25 ` André Draszik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200110171541.31341-1-git@andred.net \
--to=git@andred.net \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.