Bug 194490 - www/firefox 33.0 does not build on FreeBSD 8.4 under poudriere
Summary: www/firefox 33.0 does not build on FreeBSD 8.4 under poudriere
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-gecko (Nobody)
URL:
Keywords:
Depends on: 195559
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-20 17:26 UTC by Don Lewis
Modified: 2014-12-11 02:29 UTC (History)
0 users

See Also:
jbeich: maintainer-feedback+


Attachments
firefox-34.0.b7,1 build log for 8.4R amd64 (220.09 KB, application/x-gzip)
2014-11-11 22:59 UTC, Jan Beich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Don Lewis freebsd_committer 2014-10-20 17:26:10 UTC
I'm able to build www/firefox version 33.0 by running make in the port directory, but if I attempt to build a package with poudriere, it fails during the configure step.  The failure occurs in the configuration of jemalloc.


checking for memalign... no
checking for valloc... yes
checking configured backtracing method... N/A
checking for sbrk... yes
checking whether utrace(2) is compilable... yes
checking whether valgrind is compilable... no
checking STATIC_PAGE_SHIFT... configure: error: in `/wrkdirs/usr/ports/www/firefox/work/mozilla-release/obj-i386-portbld-freebsd8.4/memory/jemalloc/src':
configure: error: cannot run test program while cross compiling
See `config.log' for more details
configure: error: /wrkdirs/usr/ports/www/firefox/work/mozilla-release/memory/jemalloc/src/configure failed for memory/jemalloc/src
===>  Script "../configure" failed unexpectedly.
Please report the problem to gecko@FreeBSD.org [maintainer] and attach the
"/wrkdirs/usr/ports/www/firefox/work/mozilla-release/obj-i386-portbld-freebsd8.4/config.log"
including the output of the failure of your make command. Also, it might be
a good idea to provide an overview of all packages installed on your system
(e.g. a /usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1

The problem appears to be that the configure script thinks a cross compile is being done even though this is an 8.4-STABLE i386 jail on an 8.4-STABLE i386 host.  A bit earlier in the configure output:

checking build system type... i386-portbld-freebsd8.4
checking host system type... i386-unknown-freebsd8.4

These are both passed to configure:
configuring in memory/jemalloc/src
running /bin/sh /wrkdirs/usr/ports/www/firefox/work/mozilla-release/memory/jemal
loc/src/configure  --build=i386-portbld-freebsd8.4 --host=i386-unknown-freebsd8.
4 --enable-stats --with-jemalloc-prefix=je_ --with-mangling=malloc_usable_size:m
alloc_usable_size,valloc:valloc,memalign:memalign,free:free,realloc:realloc,call
oc:calloc,aligned_alloc:aligned_alloc,posix_memalign:posix_memalign,malloc:mallo
c AS='$(CC)' CC='gcc48' CXX='g++48' CPP='cpp48' LD='/usr/local/bin/ld' AR='/usr/
local/bin/ar' RANLIB='/usr/local/bin/ranlib' STRIP='strip' CPPFLAGS='-isystem/us
r/local/include -I/usr/local/include' EXTRA_CFLAGS='-Wall -Wpointer-arith -Wdecl
aration-after-statement -Werror=return-type -Werror=int-to-pointer-cast -Wtype-l
imits -Wempty-body -Wsign-compare -Wno-unused -Wcast-align -O2 -pipe -O3 -Wl,-rp
ath=/usr/local/lib/gcc48 -fno-strict-aliasing -std=gnu99 -fgnu89-inline -fno-str
ict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -pipe' LDFLAGS=
'-pthread -L/usr/local/lib -Wl,-rpath,/usr/local/lib/firefox -Wl,-rpath=/usr/loc
al/lib/gcc48 -L/usr/local/lib/gcc48 -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-i
d' --cache-file=/wrkdirs/usr/ports/www/firefox/work/mozilla-release/obj-i386-por
tbld-freebsd8.4/memory/jemalloc/src/config.cache --srcdir=/wrkdirs/usr/ports/www
/firefox/work/mozilla-release/memory/jemalloc/src

which compares them to detect cross building:

# FIXME: To remove some day.
if test "x$host_alias" != x; then
  if test "x$build_alias" = x; then
    cross_compiling=maybe
  elif test "x$build_alias" != "x$host_alias"; then
    cross_compiling=yes
  fi
fi
Comment 1 Bugzilla Automation freebsd_committer 2014-10-20 17:26:10 UTC
Auto-assigned to maintainer gecko@FreeBSD.org
Comment 2 Don Lewis freebsd_committer 2014-10-25 03:16:01 UTC
I think this only fails on FreeBSD 8.  The reason is that FreeBSD 8 does not have jemalloc in libc, so the firefox port builds its own internal copy of jemalloc, and the configure step for that fails.  When I tested on FreeBSD 10, the port seems to detect the presence of jemalloc and does not attempt to build its own copy.

Interestingly i386 and amd64 fail differently.  On i386, bsd.port.mk sets CONFIGURE_TARGET to i386-portbld-freebsd8.4, which does not match i386-unknown-freebsd8.4, triggering a false detection of a crossbuild:

configuring in memory/jemalloc/src
running /bin/sh /wrkdirs/usr/ports/www/firefox/work/mozilla-release/memory/jemalloc/src/configure  --build=i386-portbld-freebsd8.4 --host=i386-unknown-freebsd8.4 ...

On amd64, bsd.gecko.mk overrides CONFIGURE_TARGET and sets it to x86_64-unknown-freebsd8.4, which does not match amd64-unknown-freebsd8.4, giving the same end result:

configuring in memory/jemalloc/src
running /bin/sh /wrkdirs/usr/ports/www/firefox/work/mozilla-release/memory/jemalloc/src/configure  --build=x86_64-unknown-freebsd8.4 --host=amd64-unknown-freebsd8.4 ...
Comment 3 Jan Beich freebsd_committer 2014-11-06 23:37:51 UTC
--enable-jemalloc is also used on 9.x but configure doesn't fail there. Anyway, can you try configure target fixes in trunk/ ?

  $ svn export https://trillian.chruetertee.ch/svn/freebsd-gecko/trunk
  $ (cd trunk; for d in */*/files; do rm -rf /usr/ports/$d; done)
  $ cp -R trunk/ /usr/ports/
Comment 4 Don Lewis freebsd_committer 2014-11-11 21:41:47 UTC
Fails to build:
[snip]
===>   Returning to build of firefox-34.0.b7,1
===>   firefox-34.0.b7,1 depends on shared library: libpango-1.0.so - found (/us
r/local/lib/libpango-1.0.so.0.3400.1)
===========================================================================
=======================<phase: configure      >============================
===>  Configuring for firefox-34.0.b7,1
(cd /wrkdirs/usr/ports/www/firefox/work/mozilla-beta && /usr/local/bin/autoconf-
2.13)
(cd /wrkdirs/usr/ports/www/firefox/work/mozilla-beta/js/src/ && /usr/local/bin/a
utoconf-2.13)
===========================================================================
=======================<phase: build          >============================
===>  Building for firefox-34.0.b7,1
gmake: Makefile: No such file or directory
gmake: *** No rule to make target 'Makefile'.  Stop.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop in /usr/ports/www/firefox.
===>  Cleaning for firefox-34.0.b7,1
build of /usr/ports/www/firefox ended at Tue Nov 11 09:35:34 PST 2014
build time: 00:09:32
Comment 5 Don Lewis freebsd_committer 2014-11-11 22:02:45 UTC
Configure succeeds on 9.x because the crossbuild check in jemalloc's configure script isn't getting triggered.

From <http://beefy2.isc.freebsd.org/bulk/91amd64-default/latest/logs/firefox-33.0%2c1.log>:

configuring in memory/jemalloc/src
running /bin/sh /wrkdirs/usr/ports/www/firefox/work/mozilla-release/memory/jemalloc/src/configure  --build=x86_64-unknown-freebsd9.1 --host=x86_64-unknown-freebsd9.1 ...


From <http://beefy1.isc.freebsd.org/bulk/91i386-default/latest/logs/firefox-33.0%2c1.log>:

configuring in memory/jemalloc/src
running /bin/sh /wrkdirs/usr/ports/www/firefox/work/mozilla-release/memory/jemalloc/src/configure  --build=i386-portbld-freebsd9.1 --host=i386-portbld-freebsd9.1 ...

In both cases build == host, which is not what I see on FreeBSD 8.x.
Comment 6 Jan Beich freebsd_committer 2014-11-11 22:59:24 UTC
Created attachment 149300 [details]
firefox-34.0.b7,1 build log for 8.4R amd64

(In reply to Don Lewis from comment #4)
> ===>  Building for firefox-34.0.b7,1
> gmake: Makefile: No such file or directory
> gmake: *** No rule to make target 'Makefile'.  Stop.

Have you sync'd Mk/bsd.gecko.mk ? Otherwise, compare with the attached log.
Comment 7 Don Lewis freebsd_committer 2014-11-12 03:55:41 UTC
That worked.  I get this error on startup:

(process:2183): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed

but firefox appears to function properly.

I suspect that this addition to bsd.gecko.mk would allow 33.0 to build correctly:
+CONFIGURE_TARGET:=${ARCH:C/amd64/x86_64/}-portbld-${OPSYS:tl}${OSREL}
Comment 8 Jan Beich freebsd_committer 2014-11-12 04:26:30 UTC
It isn't that simple. CONFIGURE_TARGET is ignored for client.mk build (used by PGO, thunderbird and seamonkey). non-client.mk build is untested upstream so I've removed it to keep sanity but it turned out thunderbird (unlike seamonkey) sources .mozconfig more than once and breaks.

So, let's not destabilize 33.1 (bug 194945) but wait 2 more weeks for 34.0.
https://wiki.mozilla.org/RapidRelease/Calendar#Future_branch_dates
Comment 9 Jan Beich freebsd_committer 2014-12-11 02:29:10 UTC
Should be fixed since ports r373830.