sys-apps/file-5.00-r2 is now the only unmasked version of file in the portage tree. On IRIX, it fails to compile with: source='getopt_long.c' object='getopt_long.lo' libtool=yes \ DEPDIR=.deps depmode=sgi /opt/portage/bin/bash ../depcomp \ /opt/portage/bin/bash ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -DMAGIC='"/opt/portage/usr/share/misc/magic"' -I/opt/portage/usr/include -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -woff 1174,1183,1185,1552,3968,3970 -D_GNU_SOURCE -c -o getopt_long.lo getopt_long.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/opt/portage/usr/share/misc/magic\" -I/opt/portage/usr/include -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -woff 1174,1183,1185,1552,3968,3970 -D_GNU_SOURCE -c getopt_long.c -Wp,-MDupdate,.deps/getopt_long.TPlo -DPIC -o .libs/getopt_long.o cc-1204 cc: WARNING File = getopt_long.c, Line = 360 The indicated declaration is not visible outside of the function. const struct option *long_options; ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 408 The expression must be a pointer to a complete object type. for (i = 0; long_options[i].name; i++) { ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 410 The expression must be a pointer to a complete object type. if (strncmp(current_argv, long_options[i].name, ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 414 The expression must be a pointer to a complete object type. if (strlen(long_options[i].name) == ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 423 The expression must be a pointer to a complete object type. else if (!IDENTICAL_INTERPRETATION(i, match)) ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 423 The expression must be a pointer to a complete object type. else if (!IDENTICAL_INTERPRETATION(i, match)) ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 423 The expression must be a pointer to a complete object type. else if (!IDENTICAL_INTERPRETATION(i, match)) ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 423 The expression must be a pointer to a complete object type. else if (!IDENTICAL_INTERPRETATION(i, match)) ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 423 The expression must be a pointer to a complete object type. else if (!IDENTICAL_INTERPRETATION(i, match)) ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 423 The expression must be a pointer to a complete object type. else if (!IDENTICAL_INTERPRETATION(i, match)) ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 435 The expression must be a pointer to a complete object type. if (long_options[match].has_arg == no_argument ^ cc-1020 cc: ERROR File = getopt_long.c, Line = 435 The identifier "no_argument" is undefined. if (long_options[match].has_arg == no_argument ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 444 The expression must be a pointer to a complete object type. if (long_options[match].flag == NULL) ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 445 The expression must be a pointer to a complete object type. optopt = long_options[match].val; ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 450 The expression must be a pointer to a complete object type. if (long_options[match].has_arg == required_argument || ^ cc-1020 cc: ERROR File = getopt_long.c, Line = 450 The identifier "required_argument" is undefined. if (long_options[match].has_arg == required_argument || ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 451 The expression must be a pointer to a complete object type. long_options[match].has_arg == optional_argument) { ^ cc-1020 cc: ERROR File = getopt_long.c, Line = 451 The identifier "optional_argument" is undefined. long_options[match].has_arg == optional_argument) { ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 454 The expression must be a pointer to a complete object type. else if (long_options[match].has_arg == ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 463 The expression must be a pointer to a complete object type. if ((long_options[match].has_arg == required_argument) ^ cc-1020 cc: ERROR File = getopt_long.c, Line = 463 The identifier "required_argument" is undefined. if ((long_options[match].has_arg == required_argument) ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 475 The expression must be a pointer to a complete object type. if (long_options[match].flag == NULL) ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 476 The expression must be a pointer to a complete object type. optopt = long_options[match].val; ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 488 The expression must be a pointer to a complete object type. if (long_options[match].flag) { ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 489 The expression must be a pointer to a complete object type. *long_options[match].flag = long_options[match].val; ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 489 The expression must be a pointer to a complete object type. *long_options[match].flag = long_options[match].val; ^ cc-3316 cc: ERROR File = getopt_long.c, Line = 492 The expression must be a pointer to a complete object type. retval = long_options[match].val; ^ 26 errors detected in the compilation of "getopt_long.c". make[2]: *** [getopt_long.lo] Error 1 make[2]: Leaving directory `/usr/opt/portage/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/opt/portage/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00' make: *** [all] Error 2 * ERROR: sys-apps/file-5.00-r2 failed: * emake failed * * Call stack: * ebuild.sh: 49: <call src_compile> * environment:3364: emake || die "emake failed"; *
*** Bug 267073 has been marked as a duplicate of this bug. ***
I looked briefly at the sources for file-5.00 and file-4.23 and the parts that your compiler chokes on are identical. What compiler are you using? Btw you can bring back file-4.23 in a local overlay. Are you sure it still builds?
I've downloaded the most recent file-4.23 from http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/file/, and this builds successfully but tries to install files outside of $EPREIFX. Where is the gentoo-prefix/gentoo-alt repository? I'm using the platform's native MIPSpro compiler suite. emerge --info: !!! No gcc found. You probably need to 'source /etc/profile' !!! to update the environment of this terminal and possibly !!! other terminals also. Portage 2.2.00.13346-prefix (prefix/irix/6.5/mips, [unavailable], unavailable, 6.5 IP35) ================================================================= System uname: IRIX-6.5-IP35-mips-32bit-ELF Timestamp of tree: Wed, 22 Apr 2009 09:51:49 +0000 app-shells/bash: 3.2_p48-r1 dev-lang/python: 2.5.4-r2 sys-devel/autoconf: 2.63-r1 sys-devel/automake: 1.7.9-r1, 1.9.6-r2, 1.10.2-r00.1 sys-devel/libtool: 2.2.6a ACCEPT_KEYWORDS="mips-irix ~mips-irix" CBUILD="mips-sgi-irix6.5" CFLAGS="-c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -woff 1174,1183,1185,1552,3968,3970" CHOST="mips-sgi-irix6.5" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo" CPPFLAGS=" -I/opt/portage/usr/include" CXXFLAGS="-J2 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -FE:eliminate_duplicate_inline_copies:template_in_elf_section -woff 1174,1183,1185,1552,3968,3970 " DISTDIR="/opt/portage/usr/portage/distfiles" EPREFIX="/opt/portage" FEATURES="collision-protect distlocks fixpackages nostrip parallel-fetch preserve-libs protect-owned sfperms strict test unmerge-orphans userfetch userpriv" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="en_GB" LDFLAGS="-Wl,-s,-x,-n32,-mips4,-rdata_shared,-allow_jump_at_eop,-rpath,/opt/portage/usr/lib:/opt/portage/lib -L/opt/portage/usr/lib -L/opt/portage/lib" LINGUAS="en en_GB" PKGDIR="/opt/portage/usr/portage/packages" PORTAGE_CONFIGROOT="/opt/portage/" 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="/opt/portage/var/tmp" PORTDIR="/opt/portage/usr/portage" PORTDIR_OVERLAY="/opt/portage/usr/local/portage" SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix" USE="X acl ao bash-completion berkdb bzip2 cleartype cracklib crypt cscope dbus expat fam gdbm gnutls gtk hal iconv ipv6 ithreads jpeg jpeg2k libnotify lzo midi mips-irix mmap ncurses nls opengl openmp pcre perl png prefix python readline slang spell sqlite sqlite3 ssl svg tcl test threads tiff unicode urandom vim-pager vim-syntax xft xinerama xprint 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 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" ELIBC="IRIX" INPUT_DEVICES="keyboard mouse" KERNEL="IRIX" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB" USERLAND="GNU" Unset: CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
(In reply to comment #3) > I've downloaded the most recent file-4.23 from > http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/file/, and this builds > successfully but tries to install files outside of $EPREIFX. Where is the > gentoo-prefix/gentoo-alt repository? http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay
Created attachment 189822 [details] dev-libs/libgnugetopt I'm getting further with the attached 'libgnugetopt' ebuild (from FreeBSD's libgnugetopt) and the following change to the ebuild... (As previously discussed, IRIX has a system getopt.h header, but it isn't GNU getopt-compatible - many builds assume that if the header is present it will implicitly be GNU, without checking this)
Created attachment 189823 [details, diff] Patch to allow libgnugetopt to compile cleanly on IRIX
Created attachment 189824 [details, diff] Updated file-5.00-r2 ebuild to use libgnugetopt (if present) This patch allows the file build to progress past the getopt_long problems and compile successfully, but the 'test' stage fails with: >>> Test phase [check]: sys-apps/file-5.00-r2 make -j1 check Making check in src make[1]: Entering directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/src' make[1]: Nothing to be done for `check'. make[1]: Leaving directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/src' Making check in magic make[1]: Entering directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/magic' make[1]: Nothing to be done for `check'. make[1]: Leaving directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/magic' Making check in tests make[1]: Entering directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/tests' make test make[2]: Entering directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/tests' source='test.c' object='test-test.o' libtool=no \ DEPDIR=.deps depmode=sgi /opt/gentoo/bin/bash ../depcomp \ cc -DHAVE_CONFIG_H -I. -I.. -I../src -I/opt/gentoo/usr/include -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -woff 1174,1183,1185,1552,3968,3970 -D_GNU_SOURCE -c -o test-test.o `test -f 'test.c' || echo './'`test.c /opt/gentoo/bin/bash ../libtool --tag=CC --mode=link cc -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -woff 1174,1183,1185,1552,3968,3970 -D_GNU_SOURCE -Wl,-s,-x,-n32,-mips4,-rdata_shared,-allow_jump_at_eop,-rpath,/opt/gentoo/usr/lib:/opt/gentoo/lib -L/opt/gentoo/usr/lib -L/opt/gentoo/lib -o test test-test.o ../src/libmagic.la -lz libtool: link: cc -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -woff 1174,1183,1185,1552,3968,3970 -D_GNU_SOURCE -Wl,-s -Wl,-x -Wl,-n32 -Wl,-mips4 -Wl,-rdata_shared -Wl,-allow_jump_at_eop -Wl,-rpath -Wl,/opt/gentoo/usr/lib:/opt/gentoo/lib -o .libs/test test-test.o -L/opt/gentoo/usr/lib -L/opt/gentoo/lib ../src/.libs/libmagic.so -lz -Wl,-rpath -Wl,/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/src/.libs:/opt/gentoo/usr/lib make[2]: Leaving directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/tests' make check-local make[2]: Entering directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/tests' MAGIC=../magic/magic ./test ERROR loading with NULL file: file `../magic/magic.mgc' is too small make[2]: *** [check-local] Error 11 make[2]: Leaving directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/tests' make[1]: *** [check-am] Error 2 make[1]: Leaving directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.00-r2/work/file-5.00/tests' make: *** [check-recursive] Error 1 * ERROR: sys-apps/file-5.00-r2 failed: * Make check failed. See above for details. * * Call stack: * ebuild.sh: 49: <call src_test> * environment:3384: <call _eapi0_src_test> * ebuild.sh: 602: hasq test $FEATURES && die "Make check failed. See above for details."
Created attachment 189825 [details] Broken magic.mgc created during 'test' stage... This magic.mgc file, created during the file-5.00-r2 'test' stage, is obviously wrong.
(Although if I use the new 'file' binary from this build with the existing file-4.23 'magic' data, then it does appear to work correctly)
Since libgnugetopt isn't in-tree, I've been trying to get file-5.04 to build successfully against gnulib. If built from the stock ebuild, the process fails with: Making all in magic make[2]: Entering directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.04/work/file-5.04/magic' ../src/file -C -m magic 924413:/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.04/work/file-5.04/src/.libs/lt-file:rld: Fatal Error: attempted access to unresolvable symbol in /usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.04/work/file-5.04/src/.libs/lt-file: getopt_long make[2]: *** [magic.mgc] Error 1 make[2]: Leaving directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.04/work/file-5.04/magic' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.04/work/file-5.04' make: *** [all] Error 2 * ERROR: sys-apps/file-5.04 failed: * (no error message) * * Call stack: * ebuild.sh, line 54: Called call-ebuildshell 'src_compile' * environment, line 723: Called src_compile * environment, line 4456: Called die * The specific snippet of code: * emake || die; With gnulib integrated into the ebuild and ac_cv_func_getopt_long=yes set, the build instead fails with: creating test make[2]: Leaving directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.04/work/file-5.04/tests' make check-local make[2]: Entering directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.04/work/file-5.04/tests' MAGIC=../magic/magic ./test ERROR loading with NULL file: file `../magic/magic.mgc' is too small make[2]: *** [check-local] Error 11 make[2]: Leaving directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.04/work/file-5.04/tests' make[1]: *** [check-am] Error 2 make[1]: Leaving directory `/usr/opt/gentoo/var/tmp/portage/sys-apps/file-5.04/work/file-5.04/tests' make: *** [check-recursive] Error 1 * ERROR: sys-apps/file-5.04 failed: * Make check failed. See above for details. * * Call stack: * ebuild.sh, line 54: Called call-ebuildshell 'src_test' * environment, line 729: Called src_test * environment, line 4476: Called _eapi0_src_test * ebuild.sh, line 666: Called die * The specific snippet of code: * hasq test $FEATURES && die "Make check failed. See above for details." ... if FEATURES="test". However, the 'file' binary itself does appear to do the right thing! Unfortunately, the package as a whole doesn't: Whilst it works correctly with file-4.23's magic.mgc file, the one installed by file-5.04 is only 8 bytes long, and when 'file' is invoked it simply outputs: "file: File 5.4 supports only version 7 magic files. `/opt/gentoo/usr/share/misc/magic.mgc' is version 4" ... so there are clearly still significant problems here :(
$ xxd ~/../usr/share/misc/magic.mgc 0000000: f11e 041c 0000 0004 ........ ... however, rebuilding and installing 'file-5.04' a second time does result in a 1.7Mb magic.mgc file! Is the build process incorrectly using the already-installed 'file' binary (which is file-4.23 in the above case), and that's why processing magic.mgc fails?
Confirmed: On first build, file-5.04 fails its tests and installs an invalid 8-byte magic.mgc file. On the same system, an immediate second installation results in all tests passing and a valid magic.mgc file being created. ebuild changes: --- file-5.04.ebuild 2010-01-29 20:31:53.000000000 +0000 +++ file-5.04.ebuild 2010-02-08 18:57:47.916883640 +0000 @@ -17,7 +17,10 @@ KEYWORDS="~ppc-aix ~x64-freebsd ~x86-fre IUSE="python" -DEPEND="python? ( virtual/python )" +DEPEND="python? ( virtual/python ) + mips-irix? ( + dev-libs/gnulib + )" RDEPEND="${DEPEND}" src_unpack() { @@ -48,6 +51,14 @@ src_compile() { # file uses things like strndup() and wcwidth() append-flags -D_GNU_SOURCE + if [[ "${CHOST}" == *-irix* ]]; then + export ac_cv_func_getopt_long=yes + append-flags -I"${EPREFIX}"/usr/$(get_libdir)/gnulib/include + append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)/gnulib/$(get_libdir) + append-libs -lgnu + fi + + econf || die emake || die
Created attachment 218925 [details, diff] Revised file-5.04.ebuild Revised file-5.04.ebuild, modified to build correctly on IRIX (on the second attempt...)
We are sorry to close this bug. We lack the man-power and devotion to support mips-irix in the tree.