Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 612612 - sys-devel/gcc-5.4.0[gcj]: fails to compile: install-xattr: setxattr() failed: Operation not supported
Summary: sys-devel/gcc-5.4.0[gcj]: fails to compile: install-xattr: setxattr() failed:...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard: masked in 17.0 profiles
Keywords:
: 622486 624850 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-03-14 12:48 UTC by Agostino Sarubbo
Modified: 2019-12-29 11:08 UTC (History)
9 users (show)

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


Attachments
gcc-build-logs (gcc-build-logs.tar.bz2,739.51 KB, application/x-bzip)
2017-03-14 12:48 UTC, Agostino Sarubbo
Details
strace (file_612612.txt,19.17 KB, text/plain)
2017-03-15 08:14 UTC, Agostino Sarubbo
Details
mounts (file_612612.txt,5.10 KB, text/plain)
2017-03-15 16:04 UTC, Agostino Sarubbo
Details
build logs of failed gcc emerge (gcc-build-logs.tar.bz2,733.10 KB, application/x-bzip)
2017-04-18 17:17 UTC, Erik Quaeghebeur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2017-03-14 12:48:40 UTC
Created attachment 467014 [details]
gcc-build-logs

It is reproducible with a fresh-downloaded stage3 with the following:

echo "=sys-devel/gcc-5.4.0-r3" /etc/portage/package.keywords
USE="cxx fortran gcj nls nptl objc openmp sanitize vtv" emerge -avq1 gcc


 /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 libgcj-5.4.0.jar libgcj-tools-5.4.0.jar /var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/gcc-5.4.0/libjava/../ecj.jar '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/image//usr/share/gcc-data/x86_64-pc-linux-gnu/5.4.0/java'
install-xattr: setxattr() failed: Operation not supported
make[6]: *** [Makefile:10195: install-jarDATA] Error 1
make[6]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/x86_64-pc-linux-gnu/32/libjava'
make[5]: *** [Makefile:10382: install-am] Error 2
make[5]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/x86_64-pc-linux-gnu/32/libjava'
make[4]: *** [Makefile:10240: install-recursive] Error 1
make[4]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/x86_64-pc-linux-gnu/32/libjava'
make[3]: *** [Makefile:12804: multi-do] Error 1
make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/x86_64-pc-linux-gnu/libjava'
make[2]: *** [Makefile:12770: install-multi] Error 2
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/x86_64-pc-linux-gnu/libjava'
make[1]: *** [Makefile:18256: install-target-libjava] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build'
make: *** [Makefile:2301: install] Error 2
 * ERROR: sys-devel/gcc-5.4.0-r3::gentoo failed (install phase):
 *   emake failed
Comment 1 SpanKY gentoo-dev 2017-03-14 18:02:56 UTC
looks like an install-xattr problem

what are your mounts exactly ?
Comment 2 Magnus Granberg gentoo-dev 2017-03-14 20:35:44 UTC
Ago can you post the trace that you did show me?
For it looks like some of the files you have is having a xattr and then install-xattr trying to copy it to image dir and fail for user.xdg.origin.url is not allowed in tmpfs. If you have /var/tmp/portage as tmpfs.
Comment 3 Agostino Sarubbo gentoo-dev 2017-03-15 08:14:52 UTC
Created attachment 467104 [details]
strace

(In reply to Magnus Granberg from comment #2)
>If you have /var/tmp/portage as tmpfs.

Yes, it is on tmpfs
Comment 4 Agostino Sarubbo gentoo-dev 2017-03-15 16:04:26 UTC
Created attachment 467140 [details]
mounts

(In reply to SpanKY from comment #1)
> looks like an install-xattr problem
> 
> what are your mounts exactly ?

I printed what is outside the chroot.

The issue happens only if $PORTAGE_TMPDIR is on tmpfs
Comment 5 Agostino Sarubbo gentoo-dev 2017-03-16 20:41:38 UTC
asked from Zorry on irc:

(chroot) vh distfiles # getfattr ecj-4.5.jar 
# file: ecj-4.5.jar
user.xdg.origin.url

So, as a workaround, the failure does not happen if If I delete it via:
# setfattr --remove=user.xdg.origin.url ecj-4.5.jar
Comment 6 Magnus Granberg gentoo-dev 2017-03-24 20:43:00 UTC
This is not a gcc problem.
Something on youre end is adding user.xdm... to downloded files.
user.XXXXXX exept user.pax don't work on tmpfs and install-xattr just try to copy the xattr and fail for the tmpfs don't support it.
Comment 7 Erik Quaeghebeur 2017-04-18 17:17:59 UTC
Created attachment 470360 [details]
build logs of failed gcc emerge

I'm getting this as well, updating an existing install now that gcc 5.4 is stable. Also building on tmpfs. Comment 6 says that the problem is on my end; where? (GCJ is pulled in by app-text/pdftk-2.02.)
Comment 8 Fabian Henze 2017-04-20 10:40:06 UTC
Same here. Can this be worked around?
Comment 9 Erik Quaeghebeur 2017-04-21 06:25:39 UTC
Does portage's xattr use flag have anything to do with it?
Comment 10 Nikolay Kichukov 2017-04-21 10:36:20 UTC
This only happens if built on tmpfs as it does not support the xattr, even when the kernel is compiled with this support:

CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y

A temporary workaround is to create environment definition for gcc or any other package which wants to make use of xattr to be compiled outside of the tmpfs mountpoint. ie:

>sys-devel/gcc-5.4 notmpfs.conf

The problem comes from line 10195 in the Makefile (/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/x86_64-pc-linux-gnu/libjava/Makefile)

install-jarDATA: $(jar_DATA)
        @$(NORMAL_INSTALL)
        test -z "$(jardir)" || $(MKDIR_P) "$(DESTDIR)$(jardir)"
        @list='$(jar_DATA)'; test -n "$(jardir)" || list=; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
        done | $(am__base_list) | \
        while read files; do \
          echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(jardir)'"; \
          $(INSTALL_DATA) $$files "$(DESTDIR)$(jardir)" || exit $$?; \
        done

the INSTALL_DATA is defined as: INSTALL_DATA = /usr/lib/portage/python2.7/ebuild-helpers/xattr/install -c -m 644


which tells the installer to use the xattr install(why not the doins?). This is wrong for tmpfs. What makes the decision which helper to use for install when creating the Makefile?

In my case the files in question have no extended attributes, ie:

/var/tmp/portage/sys-devel/gcc-5.4.0-r3/image/usr/share/gcc-data/x86_64-pc-linux-gnu/5.4.0/java $ getfattr libgcj-5.4.0.jar

returns nothing and of course this is correct as tmpfs does not support it!

Thank you,
-Nikolay
Comment 11 Erik Quaeghebeur 2017-04-21 11:04:27 UTC
(In reply to Erik Quaeghebeur from comment #9)
> Does portage's xattr use flag have anything to do with it?

emerging portage with -xattr and then emerging gcc indeed provides a workaround (I tested it).
Comment 12 Magnus Granberg gentoo-dev 2017-04-29 19:18:17 UTC
(In reply to Nikolay Kichukov from comment #10)
> This only happens if built on tmpfs as it does not support the xattr, even
> when the kernel is compiled with this support:
> 
> CONFIG_TMPFS=y
> CONFIG_TMPFS_POSIX_ACL=y
> CONFIG_TMPFS_XATTR=y
> 
> A temporary workaround is to create environment definition for gcc or any
> other package which wants to make use of xattr to be compiled outside of the
> tmpfs mountpoint. ie:
> 
> >sys-devel/gcc-5.4 notmpfs.conf
> 
> The problem comes from line 10195 in the Makefile
> (/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/x86_64-pc-linux-gnu/
> libjava/Makefile)
> 
> install-jarDATA: $(jar_DATA)
>         @$(NORMAL_INSTALL)
>         test -z "$(jardir)" || $(MKDIR_P) "$(DESTDIR)$(jardir)"
>         @list='$(jar_DATA)'; test -n "$(jardir)" || list=; \
>         for p in $$list; do \
>           if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
>           echo "$$d$$p"; \
>         done | $(am__base_list) | \
>         while read files; do \
>           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(jardir)'"; \
>           $(INSTALL_DATA) $$files "$(DESTDIR)$(jardir)" || exit $$?; \
>         done
> 
> the INSTALL_DATA is defined as: INSTALL_DATA =
> /usr/lib/portage/python2.7/ebuild-helpers/xattr/install -c -m 644
> 
> 
> which tells the installer to use the xattr install(why not the doins?). This
> is wrong for tmpfs. What makes the decision which helper to use for install
> when creating the Makefile?
> 
> In my case the files in question have no extended attributes, ie:
> 
> /var/tmp/portage/sys-devel/gcc-5.4.0-r3/image/usr/share/gcc-data/x86_64-pc-
> linux-gnu/5.4.0/java $ getfattr libgcj-5.4.0.jar
> 
> returns nothing and of course this is correct as tmpfs does not support it!
> 
> Thank you,
> -Nikolay
Do ecj-4.5.jar have any extended attributes?
Comment 13 Mike Gilbert gentoo-dev 2017-06-22 23:06:22 UTC
*** Bug 622486 has been marked as a duplicate of this bug. ***
Comment 14 Agostino Sarubbo gentoo-dev 2017-07-13 09:13:42 UTC
*** Bug 624850 has been marked as a duplicate of this bug. ***
Comment 15 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-09-30 14:55:54 UTC
fwiw, just ran into this with 5.4.0-r3 as well, /var/tmp on tmpfs 

test -z "/usr/share/gcc-data/x86_64-pc-linux-gnu/5.4.0/java" || /bin/mkdir -p "/var/tmp/portage/sys-devel/gcc-5.4.0-r3/image//usr/share/gcc-data/x86_64-pc-linux-gnu/5.4.0/java"
 /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 libgcj-5.4.0.jar libgcj-tools-5.4.0.jar /var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/gcc-5.4.0/libjava/../ecj.jar '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/image//usr/share/gcc-data/x86_64-pc-linux-gnu/5.4.0/java'
install-xattr: setxattr() failed: Operation not supported
make[6]: *** [Makefile:10195: install-jarDATA] Error 1
make[6]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/x86_64-pc-linux-gnu/32/libjava' 
make[5]: *** [Makefile:10382: install-am] Error 2
make[5]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/x86_64-pc-linux-gnu/32/libjava' 
make[4]: *** [Makefile:10240: install-recursive] Error 1
Comment 16 Magnus Granberg gentoo-dev 2017-09-30 16:53:52 UTC
(In reply to Kristian Fiskerstrand from comment #15)
> fwiw, just ran into this with 5.4.0-r3 as well, /var/tmp on tmpfs 
> 
> test -z "/usr/share/gcc-data/x86_64-pc-linux-gnu/5.4.0/java" || /bin/mkdir
> -p
> "/var/tmp/portage/sys-devel/gcc-5.4.0-r3/image//usr/share/gcc-data/x86_64-pc-
> linux-gnu/5.4.0/java"
>  /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644
> libgcj-5.4.0.jar libgcj-tools-5.4.0.jar
> /var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/gcc-5.4.0/libjava/../ecj.jar
> '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/image//usr/share/gcc-data/x86_64-pc-
> linux-gnu/5.4.0/java'
> install-xattr: setxattr() failed: Operation not supported
> make[6]: *** [Makefile:10195: install-jarDATA] Error 1
> make[6]: Leaving directory
> '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/x86_64-pc-linux-gnu/32/
> libjava' 
> make[5]: *** [Makefile:10382: install-am] Error 2
> make[5]: Leaving directory
> '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/x86_64-pc-linux-gnu/32/
> libjava' 
> make[4]: *** [Makefile:10240: install-recursive] Error 1

Do ecj-4.5.jar have any extended attributes?
Comment 17 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-09-30 17:12:49 UTC
(In reply to Magnus Granberg from comment #16)
 
> Do ecj-4.5.jar have any extended attributes?

The distfile (not on tmpfs)

lsattr /usr/portage/distfiles/ecj-4.5.jar
--------------e---- /usr/portage/distfiles/ecj-4.5.jar

From /var/tmp/portage...
# ls -l ecj.jar 
lrwxrwxrwx 1 portage portage 34 Sep 30 16:15 ecj.jar -> /usr/portage/distfiles/ecj-4.5.jar

# lsattr ecj.jar 
lsattr: Operation not supported While reading flags on ecj.jar
Comment 18 Larry the Git Cow gentoo-dev 2017-12-11 02:27:14 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=8401685e8d03c8d3ba0e2c7fc432f430880a4c8c

commit 8401685e8d03c8d3ba0e2c7fc432f430880a4c8c
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2017-12-10 09:17:33 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2017-12-10 09:21:40 +0000

    PORTAGE_XATTR_EXCLUDE: add common user.* attributes (bug 640290)
    
    Common user.* attributes should be safe to exclude, and they
    are not supported on tmpfs, except for user.pax.* attributes
    that are supported with the patch from bug 470644.
    
    See: https://www.freedesktop.org/wiki/CommonExtendedAttributes/
    Bug: https://bugs.gentoo.org/612612
    Bug: https://bugs.gentoo.org/640290

 cnf/make.globals | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)}