Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 428298 - sys-apps/coreutils-8.XX?: does not compile on NetBSD
Summary: sys-apps/coreutils-8.XX?: does not compile on NetBSD
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 NetBSD
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords: Bug, REGRESSION
Depends on:
Blocks:
 
Reported: 2012-07-27 12:13 UTC by dougztr
Modified: 2017-11-15 17:47 UTC (History)
1 user (show)

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


Attachments
fflush.c from NetBSD stdio lib (fflush.c,3.18 KB, text/plain)
2012-07-27 12:13 UTC, dougztr
Details
fflush.c from NetBSD m4 language (fflush.c,7.14 KB, text/plain)
2012-07-27 12:16 UTC, dougztr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dougztr 2012-07-27 12:13:39 UTC
Created attachment 319388 [details]
fflush.c from NetBSD stdio lib

When trying to boostrap Gentoo prefix in netbsd, the coreutils package fails with the following error:

  CC       fflush.o
fflush.c: In function 'update_fpos_cache':
fflush.c:108:16: error: incompatible types when assigning to type '__off_t' from type 'fpos_t'
make[3]: *** [fflush.o] Error 1

I have attached NetBSD's versions of fflush.c which are part of the stdio lib and m4 macro lanugage respectively.
Comment 1 dougztr 2012-07-27 12:16:44 UTC
Created attachment 319390 [details]
fflush.c from NetBSD m4 language
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-07-27 13:46:44 UTC
Excuse me, what is the proposed fix here?
Comment 3 dougztr 2012-07-27 15:00:13 UTC
I am sorry but I do not know how to solve this or what to propose. I have included the two files to show examples of fflush.c which do compile on NetBSD. From what I gather assigning from fpos_t to off_t is now illegal in NetBSD. That makes me suspect that the union used in coreutils's fflush.c is not fooling the compiler anymore as the comments claim it should be doing.

http://mail-index.netbsd.org/pkgsrc-users/2012/01/31/msg015624.html

"...fpos_t type should be used, correctly treated as opaque type and never be cast to off_t." -- Martin Husemann

I mentioned this bug to ryao on #gentoo-bsd and he suggested that I post a bug here to bring it to the attention of the prefix team.
Comment 4 Fabian Groffen gentoo-dev 2012-07-27 15:04:11 UTC
Did you try "./bootstrap-prefix.sh $EPREFIX/tmp coreutils"? or did you try coreutils812?  Do both fail for you?
Comment 5 Fabian Groffen gentoo-dev 2012-07-27 16:43:21 UTC
netbsd is not anywhere near a supported platform at this moment
Comment 6 dougztr 2012-07-27 21:55:29 UTC
I had not tried coreutils812 until now because I was unaware of it. If you look at the instruction manual page, it lists coreutils8 which does not work at all.

In any case coreutils812 fails in the same fashion as "coreutils" with an error about incompatible types assigning to __off_t from fpos_t.

I agree that NetBSD is not a supported platform. I am testing it out and trying to help here. This problem is a little more complex than I can easily deal with and it was my hope that somebody might have an idea how to proceed.
Comment 8 dougztr 2012-07-28 23:10:40 UTC
I have tested the two patches and they allowed me to continue bootstrapping prefix on amd64 NetBSD 6.99.10
Comment 9 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-07-30 13:59:55 UTC
Thanks for digging into the patches and testing. Two possible outcomes here are :

1) Upstream accepts patches (why weren't they submitted upstream by bsd folks?)
2) Gentoo Linux maintainers accept patches.
Comment 10 dougztr 2012-07-30 18:00:59 UTC
I don't think that assigning fpos_t -> int is the portable kind of solution that upstream will entertain, although it certainly does work for amd64 and it gets us out of the woods in an expeditious manner. I vote for #2 myself ;D
Comment 11 Richard Yao (RETIRED) gentoo-dev 2012-07-31 00:47:56 UTC
(In reply to comment #9)
> Thanks for digging into the patches and testing. Two possible outcomes here
> are :
> 
> 1) Upstream accepts patches (why weren't they submitted upstream by bsd
> folks?)
> 2) Gentoo Linux maintainers accept patches.

I have sent the developer who committed these patches to pkgsrc an email asking about the upstream status. Until then, we probably should patch sys-apps/coreutils. We are currently in the process of merging the prefix changes into the main tree in bug #426322, so we should update that bug with these patches.
Comment 12 Richard Yao (RETIRED) gentoo-dev 2012-07-31 13:30:59 UTC
nbjoerg told me that he never attempted to upstream these patches. They apply to code that coreutils imported from libiberty. If we want to handle this correctly, we would need to unbundle libiberty from coreutils, binutils and anything else that uses it. It will likely be some time before anyone has a chance to do that, so it might be useful to apply these patches until then.
Comment 13 SpanKY gentoo-dev 2014-07-28 09:47:44 UTC
these should be sent to the gnulib project.  they're pretty quick to respond.
Comment 14 Fabian Groffen gentoo-dev 2017-11-15 17:47:20 UTC
netbsd isn't really on our radar anymore, sorry.