Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 184564 - sys-apps/attr-2.4.38 compile fails when $PLATFORM is set in env
Summary: sys-apps/attr-2.4.38 compile fails when $PLATFORM is set in env
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-08 03:54 UTC by Woza
Modified: 2007-09-20 07:06 UTC (History)
1 user (show)

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


Attachments
Full build log, as requested (build.log,19.17 KB, text/plain)
2007-07-08 12:13 UTC, Woza
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Woza 2007-07-08 03:54:22 UTC
When attempting to emerge sys-apps/attr on an ~x86 platform, I encountered the following compile error:

---------- Begin log ------------

=== getfattr ===
gmake[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
i686-pc-linux-gnu-gcc -O2 -march=pentium4 -pipe -fexpensive-optimizations -O2 -march=pentium4 -pipe -fexpensive-optimizations -DNDEBUG -funsigned-char -fno-strict-aliasing -Wall -DVERSION=\"2.4.38\" -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"attr\" -I./include   -O2 -march=pentium4 -pipe -fexpensive-optimizations -DNDEBUG -funsigned-char -fno-strict-aliasing -Wall -DVERSION=\"2.4.38\" -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"attr\" -I../include     -c -o getfattr.o getfattr.c
getfattr.c:351: warning: ‘struct FTW’ declared inside parameter list
getfattr.c:351: warning: its scope is only this definition or declaration, which is probably not what you want
getfattr.c: In function ‘do_print’:
getfattr.c:364: error: dereferencing pointer to incomplete type
getfattr.c: In function ‘main’:
getfattr.c:418: warning: implicit declaration of function ‘basename’
getfattr.c:418: warning: assignment makes pointer from integer without a cast
getfattr.c:502: warning: implicit declaration of function ‘nftw’
getfattr.c:503: error: ‘FTW_PHYS’ undeclared (first use in this function)
getfattr.c:503: error: (Each undeclared identifier is reported only once
getfattr.c:503: error: for each function it appears in.)
gmake[1]: *** [getfattr.o] Error 1
make: *** [default] Error 2

!!! ERROR: sys-apps/attr-2.4.38 failed.
Call stack:
  ebuild.sh, line 1615:   Called dyn_compile
  ebuild.sh, line 972:   Called qa_call 'src_compile'
  ebuild.sh, line 44:   Called src_compile
  attr-2.4.38.ebuild, line 44:   Called die

!!! (no error message)
!!! If you need support, post the topmost build error, and the call stack if relevant.
!!! A complete build log is located at '/var/tmp/portage/sys-apps/attr-2.4.38/temp/build.log'

---------- End log ------------

The affected file was attr-2.4.38/getfattr/getfattr.c .  The 'struct FTW' that it wants is defined in /usr/include/ftw.h, but it is protected by #ifdef guards.  
I changed line 31 in getfattr.c from

#include <ftw.h>

to 

#define _USE_XOPEN_EXTENDED 1
#include <ftw.h>
#undef _USE_XOPEN_EXTENDED

The undef probably isn't necessary.

Following this change, I used ebuild to complete the compilation and installation process - it all seemed to work fine.

The man page for ftw indicates that the required #define is _XOPEN_SOURCE 500.  However, when I tried this, it didn't help - hence why I had to dig through ftw.h


Reproducible: Always

Steps to Reproduce:
emerge sys-apps/attr-2.4.38 on ax ~x86 platform.



In case it is meaningful, the output of emerge info:
emerge --info
Portage 2.1.2.9 (default-linux/x86/2007.0/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.18.6-no-alsa i686)
=================================================================
System uname: 2.6.18.6-no-alsa i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Sat, 07 Jul 2007 04:30:01 +0000
dev-java/java-config: 1.3.7, 2.0.31-r7
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.15-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe -fexpensive-optimizations"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=pentium4 -pipe -fexpensive-optimizations"
DISTDIR="/var/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.aarnet.edu.au/pub/gentoo http://ftp.swin.edu.au/gentoo"
LANG="en_AU.utf8"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa arts berkdb bitmap-fonts cairo cdr cli cracklib crypt cups dbus dri dvd dvdr dvdread eds emboss encode esd evo fam firefox fortran gdbm gif gpm gstreamer hal iconv ipv6 isdnlog jpeg kde kerberos ldap libg++ mad midi mikmod mp3 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pcre pdf perl png pppd python qt qt3 qt3support qt4 quicktime readline reflection sdl session spell spl ssl svg tcpd tetex tiff truetype truetype-fonts type1-fonts unicode vorbis win32codecs x86 xml xorg xv zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="ati raedon"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Harald van Dijk (RETIRED) gentoo-dev 2007-07-08 09:03:46 UTC
__USE_XOPEN_EXTENDED should not be defined by anything other than glibc itself.

attr is supposed to be compiling with -D_GNU_SOURCE (which will cause __USE_XOPEN_EXTENDED to become defined), but according to the compilation command you included that's not happening. That's the problem that needs to be fixed. Could you please attach your full build log?
Comment 2 Woza 2007-07-08 12:13:34 UTC
Created attachment 124231 [details]
Full build log, as requested
Comment 3 Harald van Dijk (RETIRED) gentoo-dev 2007-07-08 13:53:52 UTC
Thank you. Unfortunately, I see nothing strange in your build log before the compilation commands. In fact, using your compiler options, I get identical output.

The relevant block from include/builddefs.in is

ifneq "$(findstring $(PKG_PLATFORM), linux gnu gnu/kfreebsd gnu/knetbsd)" ""
PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
endif

Is PKG_PLATFORM defined appropriately for your system, in the generated include/builddefs file? Do you perhaps have an environment variable PLATFORM set, which would override the autodetection in the attr configure script?
Comment 4 Woza 2007-07-08 14:08:19 UTC
Ah, yes.  I had PLATFORM set to i386-unknown-linux2.4 for some other work I'm doing.  If I unset that, everything works fine.

Thanks for your help.  I'll leave this bug open in case you want to do something else with it, but as far as I'm concerned you can close it.
Comment 5 Harald van Dijk (RETIRED) gentoo-dev 2007-07-08 14:24:15 UTC
I'm not sure what the best thing to do here is either, so I'll leave it open for someone else, too.
Comment 6 SpanKY gentoo-dev 2007-07-09 01:16:00 UTC
we'd be unsetting this before because of profile pollution, but with that fixed, the unset was dropped

attr isnt the only thing affected ... all of the SGI packages are (acl/attr/xfsprogs/etc...)
Comment 7 SpanKY gentoo-dev 2007-09-20 07:06:03 UTC
fixed in attr-2.4.39