Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 73855 - xfsprogs-2.6.25 ebuild fails on uclibc/embedded. (mincore+fadvise missing)
Summary: xfsprogs-2.6.25 ebuild fails on uclibc/embedded. (mincore+fadvise missing)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
: 117559 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-08 17:33 UTC by Axel Dyks
Modified: 2006-01-03 06:16 UTC (History)
2 users (show)

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


Attachments
The "configure/aclocal.m4-patch" and a modified ebuild that applies the patch (xfsprogs-2.6.25-new-ebuild.tar.gz,1.63 KB, application/x-gzip)
2004-12-08 17:39 UTC, Axel Dyks
Details
Test-Case for fadvise on glibc/uclibc platforms (test-fadvise.tar.gz,359 bytes, application/x-gzip)
2004-12-21 18:14 UTC, Axel Dyks
Details
2.6.25-uclibc-fadvise.patch (2.6.25-uclibc-fadvise.patch,849 bytes, patch)
2005-01-29 06:31 UTC, solar (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Dyks 2004-12-08 17:33:43 UTC
Make/Linking fails in subdir "./io" on unresolved symbols "mincore" (mincore.o)
and "posix_fadvise64" (fadvise.o).

Availability of these (system) functions is checked by "./configure",
but not detected correctly (test-compile works, linking would fail).
I will attach a patch for "./configure" and "aclocal.m4" (in case
someone wants to run autoconf).

Don't know, if it's possible to fix this upstream (http://oss.sgi.com/bugzilla/,
http://www.uclibc.org), but I will try my very best.

ByTheWay: "xfsprogs" are obviously meant to run _also_ on systems 
  without "mincore"/"fadvise". Otherwise "./configure" would terminate
  with an error. 

-Axel
Comment 1 Axel Dyks 2004-12-08 17:39:44 UTC
Created attachment 45579 [details]
The "configure/aclocal.m4-patch" and a modified ebuild that applies the patch
Comment 2 solar (RETIRED) gentoo-dev 2004-12-09 06:15:12 UTC
In the ebuild you have.
-------------------------------------------------------------
        # "mincore" and "fadvise" are not available when building
        # with "uclibc", although "configure" detects them.
        use uclibc && \
                epatch ${FILESDIR}/${PV}-uclibc-mincore-fadvise.patch
-------------------------------------------------------------
We try to never conditionally patch.
Comment 3 Axel Dyks 2004-12-09 07:33:42 UTC
Is something like adding "ifdef __UCLIBC__" to "io/Makefile"
and setting __UCLIBC__ (on "use uclibc") ok for you?

If so, I'd change the patch and the ebuild...

Don't know very much of your (internal) rules for creating
ebuilds, so please be forgiving. :-)

-Axel
Comment 4 solar (RETIRED) gentoo-dev 2004-12-14 19:29:24 UTC
I can add mincore() to uClibc itself. As for the posix_fadvise/posix_fadvise64 part I think xfsprogs is probably handling it wrong. It should only be used when __USE_XOPEN2K is defined. see /usr/include/fcntl.h
Comment 5 Axel Dyks 2004-12-21 18:14:03 UTC
Created attachment 46598 [details]
Test-Case for fadvise on glibc/uclibc platforms

Hmm... I'm not sure, if I 've correctly understood.

I've found your discussion on "ibot.rikers.org/uclibc" about the missing
mincore() function and that somebody said "should be trivial to implement it in
uClibc". Don't know if it's really that simple but building xfsprogs on
uclibc without needing a patch would be great. :-)

I can't follow your statement on "fadvise/fadvise64".
After reading "fcntl.h" and some references about posix-defined
functions I wrote the small test-case that I have attached.

Compilation is successfull on uclibc- and glibc-platforms.
Linking is successfull on glibc but FAILS on uclibc.

Axel
Comment 6 Axel Dyks 2004-12-21 19:10:43 UTC
I 've just inspected <fcntl.h> from my "original" uclibc-buildroot
and found the following...

-----------------------------------------------------------------------------
#if 0

/* FIXME -- uClibc should probably implement these... */

#ifdef __USE_XOPEN2K
/* Advice the system about the expected behaviour of the application with
   respect to the file associated with FD.  */
# ifndef __USE_FILE_OFFSET64
extern int posix_fadvise (int __fd, __off_t __offset, size_t __len,
			  int __advise) __THROW;
# else
# ifdef __REDIRECT
extern int __REDIRECT (posix_fadvise, (int __fd, __off64_t __offset,
				       size_t __len, int __advise) __THROW,
		       posix_fadvise64);
# else
#  define posix_fadvise posix_fadvise64
# endif
# endif
# ifdef __USE_LARGEFILE64
extern int posix_fadvise64 (int __fd, __off64_t __offset, size_t __len,
			    int __advise) __THROW;
# endif

...

-----------------------------------------------------------------------------

I think the actual problem is that some header files of gentoo-embedded
do not correspond with the underlying "uclibc", i. e. an external function
is declared although it is not implemented.

For xfsprogs' (and other's?) "configure" only tries to _compile_
test code containing the functions in question (fadvise, mincore, ...)
it does not recognize that the implementation is missing from the library.

Axel
Comment 7 SpanKY gentoo-dev 2005-01-11 20:07:44 UTC
solar fixed this by implementing the needed functions in uclibc ;)
Comment 8 solar (RETIRED) gentoo-dev 2005-01-11 21:48:06 UTC
SpanKY: only 50% fixed.  posix_fadvise64() does not exist.
Comment 9 SpanKY gentoo-dev 2005-01-11 21:51:49 UTC
what's the status of that function ?  do we just need a syscall wrapper in uclibc ?
Comment 10 Axel Dyks 2005-01-12 03:32:49 UTC
And what about "#if 0 ..." in "fcntl.h"?
At least until those functions (fadvise, ...) have been implemented.

--Axel
Comment 11 SpanKY gentoo-dev 2005-01-17 15:23:49 UTC
ive implemented the two functions in upsteam uclibc cvs, but i need to implement _syscall6() for i386 ... then i can cut a patch from cvs and this should be resolved for everyone
Comment 12 solar (RETIRED) gentoo-dev 2005-01-28 19:07:02 UTC
in the mean time is xfsprogs not building for people? 
If so shall we disable the one module for now so people can build it again?
Comment 13 Jory A. Pratt 2005-01-28 19:10:25 UTC
I think we should disable it as long as it isnt gonna cause problems with the package, from what I have read doesnt appear it will!!
Comment 14 solar (RETIRED) gentoo-dev 2005-01-29 06:31:40 UTC
Created attachment 49828 [details, diff]
2.6.25-uclibc-fadvise.patch

slimmed down aclocal patch
Comment 15 solar (RETIRED) gentoo-dev 2005-01-29 07:08:59 UTC
last patch is in cvs..
Comment 16 Axel Dyks 2005-01-29 08:05:23 UTC
Thanks!
(also for providing mincore in uclibc)
--Axel
Comment 17 solar (RETIRED) gentoo-dev 2005-01-30 11:18:03 UTC
Resolve bug as FIXED. Spanky will add syscall6 when he is in the mood and we will revisit xfsprogs another day.
Comment 18 SpanKY gentoo-dev 2006-01-03 06:16:50 UTC
*** Bug 117559 has been marked as a duplicate of this bug. ***