Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 298581 - sys-apps/coreutils-8.2 fails on cross compile, tac needs -lrt
Summary: sys-apps/coreutils-8.2 fails on cross compile, tac needs -lrt
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-27 22:49 UTC by Yuri Vasilevski (RETIRED)
Modified: 2010-01-05 04:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Vasilevski (RETIRED) gentoo-dev 2009-12-27 22:49:47 UTC
When cross compiling sys-apps/coreutils-8.2 for armv4tl-softfloat-linux-gnueabi it fails on tac with the following error:

  CC       tac.o
tac.c: In function 'output':
tac.c:170: warning: ignoring return value of 'fwrite_unlocked', declared with attribute warn_unused_result
tac.c:181: warning: ignoring return value of 'fwrite_unlocked', declared with attribute warn_unused_result
  CCLD     tac
../lib/libcoreutils.a(gethrxtime.o): In function `gethrxtime':
gethrxtime.c:(.text+0xc): undefined reference to `clock_gettime'
../lib/libcoreutils.a(gettime.o): In function `gettime':
gettime.c:(.text+0x10): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status

Something along the lines of the following patch is needed to fix this problem

--- coreutils-8.2/src/Makefile.am.orig  2009-12-27 15:45:07.000000000 -0600
+++ coreutils-8.2/src/Makefile.am       2009-12-27 15:45:55.000000000 -0600
@@ -262,7 +262,7 @@ stty_LDADD = $(LDADD)
 su_LDADD = $(LDADD)
 sum_LDADD = $(LDADD)
 sync_LDADD = $(LDADD)
-tac_LDADD = $(LDADD)
+tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
 tail_LDADD = $(LDADD)
 tee_LDADD = $(LDADD)
 test_LDADD = $(LDADD)


Reproducible: Always

Steps to Reproduce:
Comment 1 SpanKY gentoo-dev 2009-12-29 06:41:57 UTC
i dont think that's correct.  you probably want upstream commit 67bfde6668268.

-# for gethrxtime, randint, randread, gen_tempname
+# for gethrxtime, randint, randread, gen_tempname, mkstemp
 dd_LDADD += $(LIB_GETHRXTIME)
 mktemp_LDADD += $(LIB_GETHRXTIME)
 shred_LDADD += $(LIB_GETHRXTIME)
 shuf_LDADD += $(LIB_GETHRXTIME)
 sort_LDADD += $(LIB_GETHRXTIME)
+tac_LDADD += $(LIB_GETHRXTIME)
Comment 2 Yuri Vasilevski (RETIRED) gentoo-dev 2010-01-04 14:55:46 UTC
Verified, thanks SpanKY, the diff from the commit you mentioned fixed the issue :-)

Commit: http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=67bfde666826888f12934fb610705cf253a72293
Comment 3 Andrew Gaffney (RETIRED) gentoo-dev 2010-01-05 03:55:50 UTC
Can we get this patch added to the tree?