Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 417179 - dev-libs/libffi-3.0.11 fails to build with Clang on Gentoo FreeBSD
Summary: dev-libs/libffi-3.0.11 fails to build with Clang on Gentoo FreeBSD
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: AMD64 FreeBSD
: Normal QA (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://bugzilla.mozilla.org/show_bug...
Whiteboard:
Keywords: Bug, PATCH
Depends on:
Blocks: freebsd-clang-3.1
  Show dependency tree
 
Reported: 2012-05-22 23:47 UTC by Richard Yao (RETIRED)
Modified: 2013-01-13 04:52 UTC (History)
0 users

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


Attachments
dev-libs/libffi-3.0.11 build failure (build.log,16.33 KB, text/plain)
2012-05-22 23:47 UTC, Richard Yao (RETIRED)
Details
Patch to fix dev-libs/libffi-3.0.11 build failure on FreeBSD (libffi-3.0.11-fix-clang-build-failure.patch,424 bytes, patch)
2012-05-22 23:49 UTC, Richard Yao (RETIRED)
Details | Diff
Mozilla patch to fix build failure (libffi-3.0.11-fix-clang-compilation.patch,3.96 KB, patch)
2012-05-27 16:38 UTC, Richard Yao (RETIRED)
Details | Diff
Upstream patch to fix issue (libffi-3.0.11-clang-support.patch,3.55 KB, patch)
2013-01-11 17:40 UTC, Richard Yao (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao (RETIRED) gentoo-dev 2012-05-22 23:47:10 UTC
Created attachment 312765 [details]
dev-libs/libffi-3.0.11 build failure

This failure only occurs when building libffi with Clang on Gentoo FreeBSD. Building libffi with Clang on Gentoo Linux works.

# emerge --info
Portage 2.2.0_alpha107 (default/bsd/fbsd/amd64/9.0, gcc-4.4.7, freebsd-lib-9.0-r2, 9.0-Gentoo amd64)
=================================================================
System uname: FreeBSD-9.0-Gentoo-amd64-64bit-ELF
Timestamp of tree: Sun, 20 May 2012 21:00:01 +0000
app-shells/bash:         4.2_p28
dev-lang/python:         2.7.3-r2
sys-apps/baselayout:     2.1-r1
sys-apps/openrc:         0.9.9.3
sys-devel/autoconf:      2.69
sys-devel/automake:      1.9.6-r3, 1.11.5
sys-devel/binutils:      2.20.1-r1
sys-devel/gcc:           4.4.7, 4.5.3-r2, 4.6.3
sys-devel/gcc-config:    1.7.1
sys-devel/libtool:       2.4.2
sys-devel/make:          3.82-r3
sys-freebsd/freebsd-lib: 9.0-r2 (virtual/os-headers)
Repositories: gentoo zfs local_overlay
Installed sets: 
ACCEPT_KEYWORDS="amd64-fbsd ~amd64-fbsd"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-gentoo-freebsd9.0"
CFLAGS="-O2 -pipe -march=amdfam10 -mtune=amdfam10"
CHOST="x86_64-gentoo-freebsd9.0"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=amdfam10 -mtune=amdfam10"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs chflags config-protect-if-modified distlocks ebuild-locks fixlafiles news noinfo parallel-fetch parallel-install parse-eapi-ebuild-head preserve-libs protect-owned sfperms split-log splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"
MAKEOPTS="-j7"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --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="/var/lib/layman/zfs /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl amd64-fbsd berkdb cracklib crypt cups cxx dri gdbm iconv ipv6 java5 java6 mmx modules multilib ncurses nls oss pcre readline sse sse2 ssl tcpd unicode xorg zfs 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="FreeBSD" 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" KERNEL="FreeBSD" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby18" USERLAND="BSD" VIDEO_CARDS="apm ark chips cirrus cyrix dummy i128 intel mach64 mga neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis tga trident tseng 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, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Richard Yao (RETIRED) gentoo-dev 2012-05-22 23:49:50 UTC
Created attachment 312767 [details, diff]
Patch to fix dev-libs/libffi-3.0.11 build failure on FreeBSD

FreeBSD's devel/libffi port applies a configure script patch that removes ${CFLAGS} from a test, among a few other fixes (ppc64-freebsd support). The patch doesn't apply cleanly against libffi, so I wrote a new patch that does.

This fixes the build failure on Gentoo FreeBSD.
Comment 2 SpanKY gentoo-dev 2012-05-24 05:40:29 UTC
Comment on attachment 312767 [details, diff]
Patch to fix dev-libs/libffi-3.0.11 build failure on FreeBSD

seems to me this will break when CFLAGS contains flags that change the ABI
Comment 3 Richard Yao (RETIRED) gentoo-dev 2012-05-26 05:00:19 UTC
My time to work on this is limited for the next 2 weeks. If I do not have a new patch in 3 weeks, please ping me.
Comment 4 Richard Yao (RETIRED) gentoo-dev 2012-05-27 16:38:54 UTC
Created attachment 313299 [details, diff]
Mozilla patch to fix build failure

The Mozilla developers wrote a patch for this that was sent upstream.
Comment 5 SpanKY gentoo-dev 2012-05-30 18:44:33 UTC
Comment on attachment 313299 [details, diff]
Mozilla patch to fix build failure

can't say this patch makes me all warm&fuzzy ... but certainly if upstream accepts it, feel free to merge into our ebuild ...
Comment 6 Richard Yao (RETIRED) gentoo-dev 2012-05-30 22:05:36 UTC
The Mozilla developers do not appear to have sent this patch upstream. I have opened an issue report on the upstream github bug tracker:

https://github.com/atgreen/libffi/issues/21
Comment 7 Richard Yao (RETIRED) gentoo-dev 2012-06-11 00:50:31 UTC
(In reply to comment #6)
> The Mozilla developers do not appear to have sent this patch upstream. I
> have opened an issue report on the upstream github bug tracker:
> 
> https://github.com/atgreen/libffi/issues/21

Upstream is non-responsive. Could we commit without waiting for upstream?
Comment 8 Richard Yao (RETIRED) gentoo-dev 2012-06-13 19:51:46 UTC
I have added epatch_user support to the dev-libs/libffi so that users will not need to wait for us to apply this to this tree.
Comment 9 SpanKY gentoo-dev 2012-06-14 17:37:09 UTC
(In reply to comment #7)

clean up the patch and attach a new version

http://dev.gentoo.org/~vapier/clean-patches
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2012-07-02 20:52:13 UTC
(In reply to comment #6)
> The Mozilla developers do not appear to have sent this patch upstream. I
> have opened an issue report on the upstream github bug tracker:
> 
> https://github.com/atgreen/libffi/issues/21

wrong place, the patches for libffi get submitted to the libffi-discuss mailing list for review
Comment 11 Richard Yao (RETIRED) gentoo-dev 2013-01-11 17:40:05 UTC
Created attachment 335246 [details, diff]
Upstream patch to fix issue

Upstream has written a patch for this issue. I can confirm that it works. May I commit?
Comment 12 Richard Yao (RETIRED) gentoo-dev 2013-01-11 17:41:28 UTC
By the way, the original patch is here:

https://github.com/atgreen/libffi/commit/bff052d9cd5be41ba9e47c76114054af487d3c30

I deleted the Changelog hunk from what I attached because it prevents the patch from applying properly.
Comment 13 SpanKY gentoo-dev 2013-01-13 04:52:18 UTC
should be all set now in the tree; thanks for the report!

Commit message: Add fix from upstream for PIC compile checks
http://sources.gentoo.org/dev-libs/libffi/files/libffi-3.0.11-x86-pic-check.patch?rev=1.1
http://sources.gentoo.org/dev-libs/libffi/libffi-3.0.11.ebuild?r1=1.17&r2=1.18