Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 551696 - =app-portage/portage-utils-0.56 fails to compile on Solaris due to d_type and DT_REG
Summary: =app-portage/portage-utils-0.56 fails to compile on Solaris due to d_type and...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-10 18:28 UTC by Fabian Groffen
Modified: 2015-06-23 08:59 UTC (History)
1 user (show)

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


Attachments
no-DT_REG.patch (no-DT_REG.patch,1.09 KB, patch)
2015-06-21 08:07 UTC, Fabian Groffen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2015-06-10 18:28:52 UTC
make[2]: Entering directory '/gentoo/prefix64/var/tmp/portage/app-portage/portage-utils-0.56/work/portage-utils-0.56'
  CC       q-main.o
In file included from libq/libq.c:37:0,
                 from main.c:73:
libq/prelink.c: In function ‘is_prelink_elf’:
libq/prelink.c:105:32: warning: unused parameter ‘fd’ [-Wunused-parameter]
libq/prelink.c:105:48: warning: unused parameter ‘filename’ [-Wunused-parameter]
main.c: In function ‘read_repos_conf’:
main.c:463:34: error: ‘struct dirent’ has no member named ‘d_type’
main.c:463:46: error: ‘DT_REG’ undeclared (first use in this function)
main.c:463:46: note: each undeclared identifier is reported only once for each function it appears in

Solaris doesn't have d_type, IIRC we need to use a macro for that to be portable.
Comment 1 Fabian Groffen gentoo-dev 2015-06-13 05:57:25 UTC
masked on Solaris for the time being
Comment 2 Fabian Groffen gentoo-dev 2015-06-21 08:06:55 UTC
@portage-utils, please review patch coming up in a minute
Comment 3 Fabian Groffen gentoo-dev 2015-06-21 08:07:56 UTC
Created attachment 405460 [details, diff]
no-DT_REG.patch

This changes the code slightly to use a stat to get to the same thing
Comment 4 SpanKY gentoo-dev 2015-06-21 14:00:32 UTC
(In reply to Fabian Groffen from comment #3)

err, no, the whole point of using d_type is to avoid stat().  you also don't check the return value of stat which is bad form.

utilize DT_UNKNOWN or something like libq/vdb.c.
Comment 5 Fabian Groffen gentoo-dev 2015-06-22 08:22:14 UTC
Solaris doesn't have d_type.  Fair enough to avoid the stat, means it needs an ifdef for platforms that don't have/expose d_type.
Comment 6 Michael Haubenwallner (RETIRED) gentoo-dev 2015-06-22 11:13:43 UTC
Same on AIX - probably #ifdef D_REG is more appropriate?
Comment 7 Michael Haubenwallner (RETIRED) gentoo-dev 2015-06-22 11:15:55 UTC
OTOH, embedded gnulib would provide full-fledged dirent module, but apparently only if host completely lacks dirent.h.
Comment 8 Fabian Groffen gentoo-dev 2015-06-22 11:16:34 UTC
since configure already is run, I guess adding a check whether struct dirent has a member named d_type, is cleaner?