Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 354917 - sys-block/parted-2.3 fails to build on arm
Summary: sys-block/parted-2.3 fails to build on arm
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: ARM Linux
: High normal (vote)
Assignee: Gentoo LiveCD Package Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-14 21:28 UTC by Rob Stoddard
Modified: 2011-03-10 05:00 UTC (History)
4 users (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 Rob Stoddard 2011-02-14 21:28:37 UTC
First, why do I need to have parted be able to build to install a graphical environment?  I can't even install gnome-terminal without successfully installing parted.

The breakage is in sys-block/parted-2.3/work/parted-2.3/libparted/arch/linux.c.


  CC     geom.lo
  CC     constraint.lo
  CC     natmath.lo
  CC     linux.lo
arch/linux.c:1581: error: expected declaration specifiers or '...' before '_llseek'
arch/linux.c:1582: error: expected declaration specifiers or '...' before 'fd'
arch/linux.c:1583: error: expected declaration specifiers or '...' before 'offset_high'
arch/linux.c:1584: error: expected declaration specifiers or '...' before 'offset_low'
arch/linux.c:1585: error: expected declaration specifiers or '...' before 'result'
arch/linux.c:1586: error: expected declaration specifiers or '...' before 'origin'
arch/linux.c:1588: warning: return type defaults to 'int'
arch/linux.c: In function '_syscall5':
arch/linux.c:1590: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:1606: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:1629: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:1663: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:1759: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:1793: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:1902: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:1932: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:1968: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:1982: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:1996: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2006: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2035: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2071: warning: empty declaration
arch/linux.c:2078: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2099: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2130: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2152: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2176: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2206: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2212: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2225: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2249: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2257: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2268: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2280: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2292: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2310: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2324: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2381: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2400: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2438: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2573: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2594: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2633: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2690: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2752: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2781: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2795: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2826: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2844: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
arch/linux.c:2868: error: storage class specified for parameter 'linux_dev_ops'
arch/linux.c:2868: error: parameter 'linux_dev_ops' is initialized
arch/linux.c:2876: error: 'linux_read' undeclared (first use in this function)
arch/linux.c:2876: error: (Each undeclared identifier is reported only once
arch/linux.c:2876: error: for each function it appears in.)
arch/linux.c:2877: error: 'linux_write' undeclared (first use in this function)
arch/linux.c:2878: error: 'linux_check' undeclared (first use in this function)
arch/linux.c:2879: error: 'linux_sync' undeclared (first use in this function)
arch/linux.c:2880: error: 'linux_sync_fast' undeclared (first use in this function)
arch/linux.c:2881: error: 'linux_probe_all' undeclared (first use in this function)
arch/linux.c:2883: error: 'linux_get_minimum_alignment' undeclared (first use in this function)
arch/linux.c:2884: error: 'linux_get_optimum_alignment' undeclared (first use in this function)
arch/linux.c:2888: error: parameter 'linux_disk_ops' is initialized
arch/linux.c:2889: error: 'linux_partition_get_path' undeclared (first use in this function)
arch/linux.c:2890: error: 'linux_partition_is_busy' undeclared (first use in this function)
arch/linux.c:2891: error: 'linux_disk_commit' undeclared (first use in this function)
arch/linux.c:2894: error: parameter 'ped_linux_arch' is initialized
arch/linux.c:1581: error: old-style parameter declarations in prototyped function definition
arch/linux.c:1581: error: parameter name omitted
arch/linux.c:1582: error: parameter name omitted
arch/linux.c:1583: error: parameter name omitted
arch/linux.c:1584: error: parameter name omitted
arch/linux.c:1585: error: parameter name omitted
arch/linux.c:1586: error: parameter name omitted
arch/linux.c:2897: error: expected '{' at end of input
make[3]: *** [linux.lo] Error 1
make[3]: Leaving directory `/var/tmp/portage/sys-block/parted-2.3/work/parted-2.3/libparted'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/sys-block/parted-2.3/work/parted-2.3/libparted'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-block/parted-2.3/work/parted-2.3'
make: *** [all] Error 2
emake failed
 * ERROR: sys-block/parted-2.3 failed:
 *   emake failed


Reproducible: Always

Steps to Reproduce:
on Pandaboard, emerge parted.
Actual Results:  
build is broken.   Takes a while for the build to crap out, so be patient.

Expected Results:  
Build should succeed, parted should install normally.

It looks to me like GCC has a gripe with this code:


  1579  #if SIZEOF_OFF_T < 8
  1580
  1581  static _syscall5(int,_llseek,
  1582                   unsigned int, fd,
  1583                   unsigned long, offset_high,
  1584                   unsigned long, offset_low,
  1585                   loff_t*, result,
  1586                   unsigned int, origin)
  1587
  1588  loff_t
  1589  llseek (unsigned int fd, loff_t offset, unsigned int whence)
  1590  {

I'm under the impression that it's normally OK code...  I don't see why this is not building here.  This is the first invocation of _syscall5 in this file, so perhaps this is a deprecated thing or something that needs to be turned on with an option, or maybe the syntax has changed recently?  I dunno  >.<   I'm not up to date on _syscall stuff.
Comment 1 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-02-14 22:20:26 UTC
this does not belong to the gnome component, please don't touch the component field if you don't know what you are doing, thanks.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2011-02-15 15:23:18 UTC
Please paste the output of `emerge --info =sys-block/parted-2.3' in a comment.
Comment 3 Rob Stoddard 2011-02-15 17:12:48 UTC
Portage 2.1.9.25 (default/linux/arm/10.0, gcc-4.4.4, glibc-2.11.2-r3, 2.6.35.3-00029-g7afdecd armv7l)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.35.3-00029-g7afdecd-armv7l-ARMv7_Processor_rev_2_-v7l-with-gentoo-1.12.14
Timestamp of tree: Mon, 14 Feb 2011 19:30:01 +0000
app-shells/bash:     4.1_p7
dev-lang/python:     2.6.6-r1
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="*"
CBUILD="armv7a-unknown-linux-gnueabi"
CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp"
CHOST="armv7a-unknown-linux-gnueabi"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl apache2 arm berkdb bzip2 cli cracklib crypt cups cxx dbus device-mapper extras fortran gdbm gdu gpm gtk hal iconv ipv6 jpeg kde modules mudflap ncurses nls nptl nptlonly openmp pam pcre perl php png postgres pppd python qt3support readline session ssl static-libs sysfs tcpd unicode userdir xml xml2 xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev omapfb dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2011-02-15 22:21:13 UTC
(In reply to comment #0)
> First, why do I need to have parted be able to build to install a graphical
> environment?  I can't even install gnome-terminal without successfully
> installing parted.

Probably a USE flag. Maybe sys-apps/hal[disk-partition].
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2011-02-15 22:24:15 UTC
Either sys-apps/hal or sys-fs/udisks, I think. Either one or the other is pulled in by gnome. But that's not important.
Comment 6 Andy Getz 2011-03-02 22:08:29 UTC
@Rob Stoddard: please also attach ${PORTAGE_TMPDIR}/portage/sys-block/parted-2.3-r1/temp/build.log

I am guessing you have sys-devel/crossdev installed; I did (20101011), and sys-block/parted-2.3-r1 built properly after unmerging it.

Crossdev triggers the problem by installing some autotools control files in /usr/share/crossdev/include/site that provide autoconf with a priori information about various target platforms to preempt tests which cannot be run in a cross-compilation environment.  Usually this is a good thing, because it enables autotools-enabled packages to be cross-compiled without qemu kung-fu or user-provided autoconf overrides.  Most of these tests, like for sizeof int, will always return the same value on a given target, so hard-coding these is safe.

The problem is ac_cv_sizeof_off_t, which is set in /usr/share/crossdev/include/site/arm-linux-gnueabi to 4, bypassing the test.  This is true on most 32-bit platforms, including ARM, however it limits file operations using off_t to the first INT32_MAX bytes (2GiB).  Large file support (LFS) provides an alternate interface on such 32-bit platforms wherein sizeof off_t is 8 and files can be as large as INT64_MAX bytes (8EiB).  Since disks are often larger than 2GiB, sys-block/parted enables the LFS interface by #defining the appropriate macros in lib/config.h.  autoconf passes the source code a macro SIZEOF_OFF_T=4, the compiler believes correctly that sizeof off_t is 8, and it's no wonder that correct source code becomes nonsense under these circumstances.

The easy workaround is to remove sys-devel/crossdev while building sys-block/parted, however I can imagine other LFS-enabled packages failing to compile or compiling broken binaries due to this discrepancy.

I can think of the following solutions:

Modify the sys-devel/crossdev ebuild to not install control files for $CHOST, since the tests can be run easily.  FHS 2.3 [0] section 4 says /usr/share contents should be "architecture independent", so while this is probably the easiest fix, it is technically contrary to the standard to install conditionally to /usr/share, which may be (for example) an NFS mountpoint shared across systems with different architectures.

Modify whichever mechanism passes these control files to autoconf (portage?) to not pass architecture-specific files when $CHOST == $CTARGET (i.e. when the tests can be run instead).

Invent some mechanism to pass different control files to LFS-enabled packages, thereby ensuring that the provided values are always correct.  This seems like the most difficult solution, but it is the only solution that I can think of that will also enable cross-compilation of LFS-enabled packages to 32-bit targets.

CC += Embedded Gentoo Team, who I believe own sys-devel/crossdev
CC += Diego Pettenò, who I suspect will be interested in this bug; it is thanks to his blog posts [1, etc.] about LFS that I recognized this problem

[0] http://www.pathname.com/fhs/pub/fhs-2.3.html
[1] http://blog.flameeyes.eu/2010/12/15/another-good-reason-to-use-64-bit-installations-large-file-support-headaches
Comment 7 SpanKY gentoo-dev 2011-03-03 04:49:37 UTC
mmm, no, there is no FHS violation here.  you're twisting the logic to apply in a way that they should not.

precomputing answers which change between LFS and non-LFS conditions though is a bad idea and we should punt those from the site files.  such as off_t sizes.