Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 534614 - net-libs/axtls-1.5.0 - src_install(): install: target '/var/tmp/portage/net-libs/axtls-1.5.0/image//usr/bin' is not a directory
Summary: net-libs/axtls-1.5.0 - src_install(): install: target '/var/tmp/portage/net-l...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-04 13:59 UTC by Toralf Förster
Modified: 2015-05-10 18:30 UTC (History)
1 user (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 Toralf Förster gentoo-dev 2015-01-04 13:59:09 UTC
make[1]: Leaving directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/samples'
>>> Source compiled.
>>> Test phase [not enabled]: net-libs/axtls-1.5.0

>>> Install axtls-1.5.0 into /var/tmp/portage/net-libs/axtls-1.5.0/image/ category net-libs
 * abi_x86_64.amd64: running multilib-minimal_abi_src_install
make -j1 PREFIX=/var/tmp/portage/net-libs/axtls-1.5.0/image//usr install 
make -C crypto
make[1]: Entering directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/crypto'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/crypto'
make -C ssl
make[1]: Entering directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/ssl'
make -C test
make[2]: Entering directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/ssl/test'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/ssl/test'
make[1]: Leaving directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/ssl'
make -C axtlswrap
make[1]: Entering directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/axtlswrap'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/axtlswrap'
make -C samples
make[1]: Entering directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/samples'
make -C c
make[2]: Entering directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/samples/c'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/samples/c'
make[1]: Leaving directory '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64/samples'
cp --no-dereference ./_stage/libax* /var/tmp/portage/net-libs/axtls-1.5.0/image//usr/lib64
chmod 755 /var/tmp/portage/net-libs/axtls-1.5.0/image//usr/lib64/libax* 
install -m 755 ./_stage/ax* /var/tmp/portage/net-libs/axtls-1.5.0/image//usr/bin 
install: target '/var/tmp/portage/net-libs/axtls-1.5.0/image//usr/bin' is not a directory
Makefile:96: recipe for target 'install' failed
make: *** [install] Error 1
 * ERROR: net-libs/axtls-1.5.0::gentoo failed (install phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=net-libs/axtls-1.5.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=net-libs/axtls-1.5.0::gentoo'`.
 * The complete build log is located at '/var/log/portage/net-libs:axtls-1.5.0:20150104-125502.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/net-libs/axtls-1.5.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-libs/axtls-1.5.0/temp/environment'.
 * Working directory: '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code-abi_x86_64.amd64'
 * S: '/var/tmp/portage/net-libs/axtls-1.5.0/work/axtls-code'


This chroot image is located at a hardened amd64 host.

Portage 2.2.14 (python 2.7.9-final-0, default/linux/amd64/13.0, gcc-4.8.3, glibc-2.19-r1, 3.17.7-hardened-r1 x86_64)
=================================================================
System uname: Linux-3.17.7-hardened-r1-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16166924 total,   1218928 free
KiB Swap:   16777212 total,  16767004 free
Timestamp of tree: Sun, 04 Jan 2015 05:45:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p53
dev-lang/perl:            5.18.2-r2
dev-lang/python:          2.7.9-r1, 3.3.5-r1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6-r1, 1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner --tree --quiet-build --deep --jobs 1"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.leaseweb.com/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="acl amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 mbox mmx modules multilib ncurses nls nptl openmp pam pax_kernel pcre readline session sse sse2 ssl tcpd unicode zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" 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 ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware 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, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Anthony Basile gentoo-dev 2015-01-05 15:27:47 UTC
This is strange.  I have an almost identical system and I can't reproduce this.

You do, however, say that this is in a chroot on a hardened host, so maybe grsec protection is doing something.  1) look at the dmesg for anything that might be forbidden.  2) try turning off all grsec chroot protection like this:

   for p in /proc/sys/kernel/grsecurity/chroot_* ; do echo 0 > $p ; done

That's overkill, but if it works, it'll give you a direction to look at.
Comment 2 Toralf Förster gentoo-dev 2015-01-05 17:59:29 UTC
(In reply to Anthony Basile from comment #1)
> This is strange.  I have an almost identical system and I can't reproduce
> this.
> 
> You do, however, say that this is in a chroot on a hardened host, so maybe
> grsec protection is doing something.  1) look at the dmesg for anything that
> might be forbidden.  2) try turning off all grsec chroot protection like
> this:
> 
>    for p in /proc/sys/kernel/grsecurity/chroot_* ; do echo 0 > $p ; done
> 
> That's overkill, but if it works, it'll give you a direction to look at.

Hhm, nothing in dmesg - and reproducible here at a stable amd64 chroot even if I switch off grsec permissions,

(off topic but FWIW there's one GRSec which I had to turn off in general :
# cat /etc/local.d/grsec_tinderbox.start
#       emerge within chroot won't work well otherwise
#
sysctl -w kernel.grsecurity.chroot_deny_chmod=0
)
Comment 3 Anthony Basile gentoo-dev 2015-01-06 11:58:59 UTC
(In reply to Toralf Förster from comment #2)
> (In reply to Anthony Basile from comment #1)
> > This is strange.  I have an almost identical system and I can't reproduce
> > this.
> > 
> > You do, however, say that this is in a chroot on a hardened host, so maybe
> > grsec protection is doing something.  1) look at the dmesg for anything that
> > might be forbidden.  2) try turning off all grsec chroot protection like
> > this:
> > 
> >    for p in /proc/sys/kernel/grsecurity/chroot_* ; do echo 0 > $p ; done
> > 
> > That's overkill, but if it works, it'll give you a direction to look at.
> 
> Hhm, nothing in dmesg - and reproducible here at a stable amd64 chroot even
> if I switch off grsec permissions,
> 
> (off topic but FWIW there's one GRSec which I had to turn off in general :
> # cat /etc/local.d/grsec_tinderbox.start
> #       emerge within chroot won't work well otherwise
> #
> sysctl -w kernel.grsecurity.chroot_deny_chmod=0
> )

Does it happen outside the chroot?  Let's get that out of the way first.

Its not a parallel build issue because you do have MAKEOPTS="-j1".  So that's also eliminated.
Comment 4 Toralf Förster gentoo-dev 2015-01-06 18:15:23 UTC
It happened _not_ outside chroot (douboe checked at 2 hardened systems, one with CONFIG_GRKERNSEC_CONFIG_DESKTOP=y and one with CONFIG_GRKERNSEC_CONFIG_SERVER=y).
Furthermore I tried FEATURES="-sandbox" and FEATURES="userpriv" - w/o luck.
Comment 5 Anthony Basile gentoo-dev 2015-04-15 20:18:03 UTC
(In reply to Toralf Förster from comment #4)
> It happened _not_ outside chroot (douboe checked at 2 hardened systems, one
> with CONFIG_GRKERNSEC_CONFIG_DESKTOP=y and one with
> CONFIG_GRKERNSEC_CONFIG_SERVER=y).
> Furthermore I tried FEATURES="-sandbox" and FEATURES="userpriv" - w/o luck.

I haven't forgotten about this one.  I bet it still happens with 1.5.1 which we're stabilizing now, however, I don't want this to be a blocker because it is a corner case.
Comment 6 Toralf Förster gentoo-dev 2015-04-30 21:11:07 UTC
(In reply to Anthony Basile from comment #5)

> I bet it still happens with 1.5.1 which we're stabilizing now,
confirmed :

install: target ‘/var/tmp/portage/net-libs/axtls-1.5.1/image//usr/bin’ is not a directory
Makefile:96: recipe for target 'install' failed
make: *** [install] Error 1
Comment 7 Joshua Kinard gentoo-dev 2015-05-10 04:31:51 UTC
I reproduced on my Octane in a musl chroot, so it seems it's got something to do with the chroot.

emerge --info of the musl chroot:

Portage 2.2.18 (python 3.3.5-final-0, hardened/linux/musl/mips, gcc-4.8.4, musl-1.1.8-r2, 4.0.2-mipsgit-20150418 mips64)
=================================================================
System uname: Linux-4.0.2-mipsgit-20150418-mips64-R14000_V2.4_FPU_V0.0-with-gentoo-2.2
KiB Mem:     2042948 total,   1218560 free
KiB Swap:    3145716 total,   3145716 free
Timestamp of repository gentoo: Sat, 09 May 2015 16:15:01 +0000
sh bash 4.3_p33-r2
ld GNU ld (Gentoo 2.25 p1.1) 2.25
app-shells/bash:          4.3_p33-r2::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r2::gentoo, 3.3.5-r1::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.15::gentoo
sys-apps/sandbox:         2.6-r999::hardened-dev
sys-devel/autoconf:       2.69-r1::gentoo
sys-devel/automake:       1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25::gentoo
sys-devel/gcc:            4.8.4-r99::hardened-development
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.16::gentoo (virtual/os-headers)
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://<REDACTED>
    priority: -1000

hardened-development
    location: /var/lib/layman/hardened-development
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="mips ~mips"
ACCEPT_LICENSE="* -@EULA"
CBUILD="mips-gentoo-linux-musl"
CFLAGS="-O2 -pipe -march=mips3 -mtune=mips3 -mplt -fomit-frame-pointer -fforce-addr -fivopts"
CHOST="mips-gentoo-linux-musl"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/init.d /etc/pam.d /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe -march=mips3 -mtune=mips3 -mplt -fomit-frame-pointer -fforce-addr -fivopts"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg candy cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sfperms unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/usr/lib/systemd /etc/systemd /usr/lib/charset.alias"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/root/netboot-packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/usr/obj"
USE="cli cracklib crypt cxx dri iconv ipv6 mips modules ncurses nls nptl openmp pax_kernel pcre perl pic readline session ssl tcpd unicode xattr zlib" ABI_MIPS="o32" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="musl" 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 ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="dummy fbdev" 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, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 8 Joshua Kinard gentoo-dev 2015-05-10 04:42:52 UTC
(In reply to Joshua Kinard from comment #7)
> I reproduced on my Octane in a musl chroot, so it seems it's got something
> to do with the chroot.

Scratch that, it failed in my main N32 userland as well.
Comment 9 Joshua Kinard gentoo-dev 2015-05-10 05:01:39 UTC
I see what the problem is.  'install -m 755' won't work if it's installing multiple files by wildcard, and the destination directory doesn't exist yet:

# cd /root/tmp
# touch x1 x2 x3
# install -m 755 ./x* /root/tmp/y7
install: target '/root/tmp/y7' is not a directory

Seems that 'axtls-code/Makefile is making an assumption that $(PREFIX)/bin always exists:

install: $(LIBDIR) $(PREFIX) all
        cp --no-dereference $(STAGE)/libax* $(LIBDIR)
        chmod 755 $(LIBDIR)/libax*
ifdef CONFIG_SAMPLES
        install -m 755 $(STAGE)/ax* $(PREFIX)/bin
endif

I figure, this can be handled in either the ebuild or by patching the Makefile to create the /usr/bin dir in the image/ folder prior to running emake.  Not sure which is the correct solution, though...
Comment 10 Anthony Basile gentoo-dev 2015-05-10 10:18:56 UTC
(In reply to Joshua Kinard from comment #9)
> I see what the problem is.  'install -m 755' won't work if it's installing
> multiple files by wildcard, and the destination directory doesn't exist yet:
> 
> # cd /root/tmp
> # touch x1 x2 x3
> # install -m 755 ./x* /root/tmp/y7
> install: target '/root/tmp/y7' is not a directory
> 
> Seems that 'axtls-code/Makefile is making an assumption that $(PREFIX)/bin
> always exists:
> 
> install: $(LIBDIR) $(PREFIX) all
>         cp --no-dereference $(STAGE)/libax* $(LIBDIR)
>         chmod 755 $(LIBDIR)/libax*
> ifdef CONFIG_SAMPLES
>         install -m 755 $(STAGE)/ax* $(PREFIX)/bin
> endif
> 
> I figure, this can be handled in either the ebuild or by patching the
> Makefile to create the /usr/bin dir in the image/ folder prior to running
> emake.  Not sure which is the correct solution, though...

What I don't get is why I didn't hit this on amd64 despite hte fact that PREFIX didn't exit.  The fix is to patch the Makefile.  I'll take are of it.
Comment 11 Anthony Basile gentoo-dev 2015-05-10 11:31:11 UTC
(In reply to Anthony Basile from comment #10)
> (In reply to Joshua Kinard from comment #9)
> > I figure, this can be handled in either the ebuild or by patching the
> > Makefile to create the /usr/bin dir in the image/ folder prior to running
> > emake.  Not sure which is the correct solution, though...
> 
> What I don't get is why I didn't hit this on amd64 despite hte fact that
> PREFIX didn't exit.  The fix is to patch the Makefile.  I'll take are of it.

Actually, its mgorny's patch that is the problem.  We currently have the following (after the patch):

LIBDIR = $(PREFIX)/lib

$(LIBDIR) :
        @mkdir -p $(LIBDIR)

$(PREFIX) :
        @mkdir -p $(PREFIX)/bin

install: $(LIBDIR) $(PREFIX) all
        cp --no-dereference $(STAGE)/libax* $(LIBDIR)
        chmod 755 $(LIBDIR)/libax* 

I'm having difficulties hitting this so I need your help testing.  Can change those lines to the following and let me know if it fixes it:

LIBDIR = $(PREFIX)/lib

install: all
        @mkdir -p $(PREFIX)/bin
        @mkdir -p $(LIBDIR)
        cp --no-dereference $(STAGE)/libax* $(LIBDIR)
        chmod 755 $(LIBDIR)/libax*
Comment 12 Anthony Basile gentoo-dev 2015-05-10 11:35:33 UTC
> I'm having difficulties hitting this so I need your help testing.  Can
> change those lines to the following and let me know if it fixes it:

Sorry for the bugspam.  I hit this only if I use make -j1.  So no need to test at your end guys.
Comment 13 Anthony Basile gentoo-dev 2015-05-10 12:04:12 UTC
Okay this should be fixed in the tree.  The final fix I went with was the following (because I could just edit the patch in place ... lazy):

diff -u -B -r1.1 explicit-libdir-r1.patch
--- files/explicit-libdir-r1.patch	14 Jun 2014 21:45:52 -0000	1.1
+++ files/explicit-libdir-r1.patch	10 May 2015 11:52:24 -0000
@@ -24,7 +24,7 @@
  ssl/version.h:
  	@echo "#define AXTLS_VERSION    \"(no version)\"" > ssl/version.h
  
-+$(LIBDIR) :
++$(LIBDIR) : $(PREFIX)
 +	@mkdir -p $(LIBDIR)
 +
  $(PREFIX) :


Please test and reopen if its still an issue.

Since this is a cute bug, I'll analyse it.  You definitely hit it only with make -j1.  Any parallelization and you will intermittantly hit it.  It occurs because

 install: $(LIBDIR) $(PREFIX) all

first runs the $(LIBDIR) rule, then the $(PREFIX) rule and final --- think no parallization.  When running the $(LIBDIR) rule, it does

LIBDIR = $(PREFIX)/lib

$(LIBDIR) :
        @mkdir -p $(LIBDIR)

which creates both LIBDIR and PREFIX directories.  But then if the PREFIX directory already exists, it doesn't have to run the $(PREFIX) rule which says:

$(PREFIX) :
        @mkdir -p $(PREFIX)/bin

so $(PREFIX) exists but $(PREFIX)/bin doesn't and ... boom!  Forcing the dependancy of the $(LIBDIR) rule on $(PREFIX) rule gets the order right.

So this is the lazy solution and will work, but it could still fail if, by some magic, $(PREFIX) were created, but NOT $(PREFIX)/bin, before the $(LIBDIR) rule is invoked.  You'd have to have some crazy process racing this because in the context of the makeful no such code pathway exists.

cute, eh?
Comment 14 Joshua Kinard gentoo-dev 2015-05-10 18:30:05 UTC
(In reply to Anthony Basile from comment #13)
> Okay this should be fixed in the tree.  The final fix I went with was the
> following (because I could just edit the patch in place ... lazy):
> 
> diff -u -B -r1.1 explicit-libdir-r1.patch
> --- files/explicit-libdir-r1.patch	14 Jun 2014 21:45:52 -0000	1.1
> +++ files/explicit-libdir-r1.patch	10 May 2015 11:52:24 -0000
> @@ -24,7 +24,7 @@
>   ssl/version.h:
>   	@echo "#define AXTLS_VERSION    \"(no version)\"" > ssl/version.h
>   
> -+$(LIBDIR) :
> ++$(LIBDIR) : $(PREFIX)
>  +	@mkdir -p $(LIBDIR)
>  +
>   $(PREFIX) :
> 
> 
> Please test and reopen if its still an issue.
> 
> Since this is a cute bug, I'll analyse it.  You definitely hit it only with
> make -j1.  Any parallelization and you will intermittantly hit it.  It
> occurs because

Yeah, the Octane has an SMP module in it, but I can't get SMP to work for some reason, so it's running with just one active CPU right now.


> So this is the lazy solution and will work, but it could still fail if, by
> some magic, $(PREFIX) were created, but NOT $(PREFIX)/bin, before the
> $(LIBDIR) rule is invoked.  You'd have to have some crazy process racing
> this because in the context of the makeful no such code pathway exists.
> 
> cute, eh?

Cute indeed.  Could a PREEMPT kernel possibly trigger it?  That's the only mechanism I know of outside of SMP where race conditions are possible.