Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 529426 - dev-java/jffi does not build (libffi flags problem)
Summary: dev-java/jffi does not build (libffi flags problem)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
: 529578 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-16 05:29 UTC by Marien Zwart (RETIRED)
Modified: 2014-11-17 09:09 UTC (History)
1 user (show)

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


Attachments
dev-java/jffi-1.2.7-r1 build.log (build.log,4.41 KB, text/plain)
2014-11-16 05:29 UTC, Marien Zwart (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marien Zwart (RETIRED) gentoo-dev 2014-11-16 05:29:41 UTC
Created attachment 389468 [details]
dev-java/jffi-1.2.7-r1 build.log

Noticed this when building jffi-1.2.7-r1, but the currently installed version (jffi-1.2.7) does not build for me anymore either. Can't figure out why it worked before.

The build fails with:

BUILD SUCCESSFUL
Total time: 3 seconds
make -j8 SRC_DIR=jni JNI_DIR=jni BUILD_DIR=build/jni VERSION=1.2 USE_SYSTEM_LIBFFI=1 -f jni/GNUmakefile 
make: *** No rule to make target '-L/usr/lib64/../lib64', needed by 'build/jni/jffi/LongDouble.o'.  Stop.
 * ERROR: dev-java/jffi-1.2.7-r1::gentoo failed (compile phase):

(I'll attach the build.log)

Looking at jni/GNUmakefile, here's where that bogus dependency comes from:

ifeq ($(USE_SYSTEM_LIBFFI),1)
  LIBFFI_LIBS ?= $(shell pkg-config --libs libffi)
  ...
else
  ...
  LIBFFI = $(LIBFFI_BUILD_DIR)/.libs/libffi_convenience.a
  LIBFFI_LIBS = $(LIBFFI)
  ...
endif

I have libffi-3.2, and pkg-config --libs libffi prints "-L/usr/lib64/../lib64 -lffi". The ebuild sets USE_SYSTEM_LIBFFI.

Further on in the GNUmakefile:

all:	$(LIBJFFI)

$(LIBJFFI):  $(OBJS) $(LIBFFI_LIBS)
	$(CC) -o $@ $(LDFLAGS) $(SOFLAGS) $(OBJS) $(LIBFFI_LIBS) $(LIBS)
	$(STRIP) $@

So if USE_SYSTEM_LIBFFI is set, the Makefile produces a dependency on the libffi linker flags, which makes no sense. Even if -L/usr/lib64/../lib64 wasn't in there, a dependency on -lffi wouldn't work. It will work when not using system libffi, as in that case the linker flags happen to be just the path to a library.

I think the fix is to depend on $(LIBFFI), not $(LIBFFI_FLAGS). That's unset in the system libffi case (which is fine, we don't need a dependency) and is the same as LIBFFI_FLAGS when using internal libffi: path to the internal library that needs to be built. If I'm right about that, the fix should go upstream.

GENTOO_VM=icedtea-7  CLASSPATH="" JAVA_HOME="/usr/lib64/icedtea7"
JAVACFLAGS="-source 1.5 -target 1.5" COMPILER=""

emerge --info '=dev-java/jffi-1.2.7-r1':

Portage 2.2.14 (python 2.7.8-final-0, default/linux/amd64/13.0/desktop/gnome/systemd, gcc-4.8.3, glibc-2.20, 3.17.3-gentoo-m14 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.17.3-gentoo-m14-x86_64-Intel-R-_Core-TM-_i7-4771_CPU_@_3.50GHz-with-gentoo-2.2
KiB Mem:    16379192 total,  11011204 free
KiB Swap:    2097148 total,   2068344 free
Timestamp of tree: Unknown
ld GNU ld (Gentoo 2.24 p1.4) 2.24
ccache version 3.1.10 [disabled]
app-shells/bash:          4.3_p30-r1
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r2
dev-lang/python:          2.7.8, 3.3.5-r1, 3.4.2
dev-util/ccache:          3.1.10-r1
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6-r1, 1.12.6, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.3-r2
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.17-r1 (virtual/os-headers)
sys-libs/glibc:           2.20
Repositories: gentoo marienz
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE @BINARY-REDISTRIBUTABLE freedist free-noncomm AdobeFlash-11.x Google-TOS D1X CC-Sampling-Plus-1.0 unRAR MPEG-4 gSOAP repoze MSttfEULA AMD"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-ggdb -O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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="-ggdb -O2 -pipe -march=native"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy collision-protect compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms sign splitdebug strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.internode.on.net/pub/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/var/tmp/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="/srv/gentoo-x86"
PORTDIR_OVERLAY="/usr/local/portage/private"
USE="X a52 aac acl acpi adns alsa amd64 avahi avx avx2 bluetooth branding btrfs bzip2 cairo canberra caps cdda cdio cdr clang cli clutter colord corefonts crypt cups cxx dbus device-mapper distinct-l doc dos dot dri dri3 dts dvd dvdr dvi eds efi emacs emboss encode equalizer evo exif expat ffmpeg firefox flac fontconfig fortran fuse g3dvl gbm gflags ghcbootstrap gif git glamor gles gles2 gmp gnome gnome-keyring gnome-online-accounts go gpg gstreamer gtk gtk3 gtkstyle http iconv icu idn imap inotify introspection ipv6 irc jpeg lame latex lcms libass libcaca libffi libkms libnotify libsecret libvisual llvm llvm-shared-libs lua lzma mad maildir minizip mmx mmxext mng modules mp3 mp4 mpeg mtp multilib nautilus ncurses nfsidmap nls nptl numpy objc ogg opengl openmp opus pam pango pch pdf playlist png policykit postscript ppds preview-latex pulseaudio python python3 qt3support qt4 readline realtime sandbox scanner schroedinger semantic-desktop session sip smtp socialweb speex spell spice sqlite sse sse2 sse3 sse4_1 ssl ssse3 startup-notification svg symlink system-icu system-jpeg systemd theora tiff tokyocabinet toolkit-scroll-bars tools truetype udev udisks udisks2 unicode upower urwid usb vaapi vala valgrind vorbis vpx wayland webkit wxwidgets x264 xattr xcb xcomposite xft xinerama xml xmp xorg xv xvfb xvmc zlib zsh-completion" ABI_X86="64" ALSA_CARDS="hda_intel" 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" CURL_SSL="nss" DRACUT_MODULES="btrfs" 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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB en_US nl fy fy_NL" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3 python3_4 pypy" QEMU_SOFTMMU_TARGETS="x86_64" RUBY_TARGETS="ruby20" SANE_BACKENDS="u12" USERLAND="GNU" VIDEO_CARDS="intel i965" 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"
USE_PYTHON="2.7 3.3"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-11-16 21:45:25 UTC
*** Bug 529578 has been marked as a duplicate of this bug. ***
Comment 2 Johann Schmitz (ercpe) (RETIRED) gentoo-dev 2014-11-17 09:09:49 UTC
+  17 Nov 2014; Johann Schmitz <ercpe@gentoo.org>
+  +files/jffi-1.2.7-makefile.patch, +jffi-1.2.7-r2.ebuild:
+  Fix for building against libffi-3.2 (bug #529426)