Bug 201473 - devel/boehm-gc: Fix armv6 support
Summary: devel/boehm-gc: Fix armv6 support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Sean Bruno
URL: http://chips.ysv.freebsd.org/data/11a...
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-07-11 10:06 UTC by Andrew Turner
Modified: 2015-11-08 19:28 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (cjpm)


Attachments
Patch to update the arm code (4.05 KB, patch)
2015-07-11 10:06 UTC, Andrew Turner
no flags Details | Diff
boehm-gc build log on 11armv6232 (62.91 KB, text/x-log)
2015-07-14 11:42 UTC, Carlos J Puga Medina
no flags Details
add support for arm and mips (7.08 KB, patch)
2015-07-15 12:29 UTC, Carlos J Puga Medina
no flags Details | Diff
boehm-gc build log on 11mips32 (61.49 KB, text/x-log)
2015-07-15 12:30 UTC, Carlos J Puga Medina
no flags Details
w3m build log on 11mips32 (65.03 KB, text/x-log)
2015-07-18 11:05 UTC, Carlos J Puga Medina
no flags Details
boehm-gc add support for armv6 and mips (7.48 KB, patch)
2015-08-06 06:50 UTC, Carlos J Puga Medina
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Turner freebsd_committer freebsd_triage 2015-07-11 10:06:01 UTC
Created attachment 158608 [details]
Patch to update the arm code

The attached patch updates the arm code to match arm64, powerpc, and x86.

With this I can build www/w3m, which is broken with the message:

GC Warning: Out of memory - trying to allocate less
Insufficient memory for GC_all_nils
Comment 1 Andrew Turner freebsd_committer freebsd_triage 2015-07-11 10:08:31 UTC
I expect mips will need a similar change, but I don't have hardware or a VM setup to test.
Comment 2 Sean Bruno freebsd_committer freebsd_triage 2015-07-11 21:47:06 UTC
(In reply to Andrew Turner from comment #1)
This was our initial attempt at getting mips support.  From looking at the diff for ARM, it looks like we were insufficient?

https://svnweb.freebsd.org/ports?view=revision&revision=374308
Comment 3 Carlos J Puga Medina 2015-07-12 16:27:41 UTC
Next week I will test@work via poudriere and commit this code into the mainline.
Comment 4 Carlos J Puga Medina 2015-07-14 11:42:30 UTC
Created attachment 158743 [details]
boehm-gc build log on 11armv6232

It passed all tests :)
Comment 5 Carlos J Puga Medina 2015-07-14 11:47:43 UTC
(In reply to Sean Bruno from comment #2)

We can open a new PR for MIPS support.
Comment 6 Carlos J Puga Medina 2015-07-15 12:29:39 UTC
Created attachment 158795 [details]
add support for arm and mips

This patch updates the arm and mips code
Comment 7 Carlos J Puga Medina 2015-07-15 12:30:26 UTC
Created attachment 158796 [details]
boehm-gc build log on 11mips32
Comment 8 Andrew Turner freebsd_committer freebsd_triage 2015-07-15 13:30:14 UTC
Does www/w3m build with this patch? It has been what finds issues in this port on other architectures.
Comment 9 Carlos J Puga Medina 2015-07-15 13:48:59 UTC
(In reply to Andrew Turner from comment #8)

I hope so :)

I will attach poudriere build logs when done.
Comment 10 Carlos J Puga Medina 2015-07-18 11:05:41 UTC
Created attachment 158933 [details]
w3m build log on 11mips32

It works fine as expected.
Comment 11 Sean Bruno freebsd_committer freebsd_triage 2015-07-18 16:59:08 UTC
(In reply to Carlos Jacobo Puga Medina from comment #10)
Do you need a committer to push this into the tree?
Comment 12 Carlos J Puga Medina 2015-07-18 18:31:08 UTC
(In reply to Sean Bruno from comment #11)

Yes. The patch is ready to be committed.
Comment 13 Carlos J Puga Medina 2015-07-19 05:14:44 UTC
Report upstream:

https://github.com/ivmai/bdwgc/issues/76
Comment 14 Sean Bruno freebsd_committer freebsd_triage 2015-07-20 14:14:03 UTC
I did some tests of www/w3m to verify the original problem and I still get the same errors as before.  I'm only using the patch you attached to the bug.  Am I missing something?

# svn stat /usr/local/poudriere/ports/default/
M       /usr/local/poudriere/ports/default/devel/boehm-gc/Makefile
M       /usr/local/poudriere/ports/default/devel/boehm-gc/files/patch-doc_gc.man
M       /usr/local/poudriere/ports/default/devel/boehm-gc/files/patch-include_private_gc__priv.h
M       /usr/local/poudriere/ports/default/devel/boehm-gc/files/patch-include_private_gcconfig.h
M       /usr/local/poudriere/ports/default/devel/boehm-gc/files/patch-os__dep.c
Comment 15 Carlos J Puga Medina 2015-07-20 14:35:27 UTC
(In reply to Sean Bruno from comment #14)

Sean,

It builds fine for me.

Can you show the errors?
Comment 16 Sean Bruno freebsd_committer freebsd_triage 2015-07-20 14:48:46 UTC
(In reply to Carlos Jacobo Puga Medina from comment #15)
Yeah, its the same as before.  I'm not sure what I'm doing wrong here.

http://tasty.ysv.freebsd.org/build.html?mastername=11mips-default&build=2015-07-20_01h54m57s
Comment 17 Carlos J Puga Medina 2015-07-20 14:55:14 UTC
(In reply to Sean Bruno from comment #16)

Add CFLAGS= -DNO_INCREMENTAL to boehm-gc/Makefile

Rebuild boehm-gc port and try again.
Comment 18 Sean Bruno freebsd_committer freebsd_triage 2015-07-20 17:23:35 UTC
(In reply to Carlos Jacobo Puga Medina from comment #17)
no, don't see any change here.  I've done a clean poudriere run "poudriere bulk -c -j 11mips www/w3m" 

http://tasty.ysv.freebsd.org/build.html?mastername=11mips-default&build=2015-07-20_01h54m57s
Comment 19 Carlos J Puga Medina 2015-07-20 17:32:11 UTC
(In reply to Sean Bruno from comment #18)

Hmmm... you didn't add -DNO_INCREMENTAL flag as you can see.


-MAKE_ENV--
XDG_DATA_HOME=/wrkdirs/usr/ports/devel/boehm-gc/work  XDG_CONFIG_HOME=/wrkdirs/usr/ports/devel/boehm-gc/work  HOME=/wrkdirs/usr/ports/devel/boehm-gc/work TMPDIR="/tmp" NO_PIE=yes SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  LIBDIR="/usr/lib"  CC="/nxb-bin/usr/bin/cc" CFLAGS="-O2 -pipe -G0  -fno-strict-aliasing"  CPP="/nxb-bin/usr/bin/cpp" CPPFLAGS=""  LDFLAGS="" LIBS=""  CXX="/nxb-bin/usr/bin/c++" CXXFLAGS="-O2 -pipe -G0 -fno-strict-aliasing "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 444"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444"
--End MAKE_ENV--
Comment 20 Sean Bruno freebsd_committer freebsd_triage 2015-07-21 00:02:45 UTC
(In reply to Carlos Jacobo Puga Medina from comment #19)
http://tasty.ysv.freebsd.org/build.html?mastername=11mips-default&build=2015-07-20_23h41m48s

This still looks broken, even with the -DNO_INCREMENTAL flag.
Comment 21 Carlos J Puga Medina 2015-07-21 14:08:28 UTC
(In reply to Sean Bruno from comment #20)

Run into devel/boehm-gc
# make test

Does it pass all tests?
Comment 22 Mikael Urankar freebsd_committer freebsd_triage 2015-07-21 14:32:45 UTC
Looks like a qemu regression as it builds fine on real hw but not with poudriere/qemu-arm-static. I'm also seeing that in Carlos' log:
Host OSVERSION: 1001000
Jail OSVERSION: 1100077

build log on real hw:
http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/w3m-0.5.3_4.log

strace log:
http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/w3m_mktable_qemu.log
Comment 23 Carlos J Puga Medina 2015-07-21 15:08:42 UTC
(In reply to mikael.urankar from comment #22)

Mikael,

Did you have any problem to build graphics/cairo and print/harfbuzz ports on MIPS?

I had some problems related to atomic operations support.

See bugs 201683 and 201618.
Comment 24 Carlos J Puga Medina 2015-07-21 15:09:44 UTC
(In reply to Carlos Jacobo Puga Medina from comment #23)

Sorry,

The bugs are 201683 and 201681.
Comment 25 Mikael Urankar freebsd_committer freebsd_triage 2015-07-24 09:15:48 UTC
(In reply to Sean Bruno from comment #20)
I don't know how to interpret that but the build failure happens with src@283998
https://svnweb.freebsd.org/base?view=revision&revision=283998
Comment 26 Sean Bruno freebsd_committer freebsd_triage 2015-07-25 20:34:27 UTC
(In reply to mikael.urankar from comment #25)
Hrm ... w3m used to build under emulation too.

http://chips.ysv.freebsd.org/data/11armv6-default/2015-05-30_20h01m28s/logs/w3m-0.5.3_4.log

I think a syscall structure has changed ... let me see if I can bisect a change.
Comment 27 Sean Bruno freebsd_committer freebsd_triage 2015-07-25 23:53:55 UTC
(In reply to Sean Bruno from comment #26)
ok, confirmed that I can build with a head jail + latest qemu-user-static when the host revision is at:

[11mips-default] [1/1] Deinstalling w3m-0.5.3_4...
[11mips-default] [1/1] Deleting files for w3m-0.5.3_4: .......... done
===========================================================================
====>> Checking for extra files and directories
=======================<phase: Interactive    >============================
[00:11:07] ====>> Installing packages
[00:11:07] ====>> Installing run-depends for www/w3m
===>   w3m-0.5.3_4 depends on file: /usr/local/bin/perl5.20.2 - found
[00:11:08] ====>> Installing www/w3m
[11mips-default] Installing w3m-0.5.3_4...
[11mips-default] Extracting w3m-0.5.3_4: 100%
[00:11:09] ====>> Installing local Pkg repository to /usr/local/etc/pkg/repos
[00:11:09] ====>> Leaving jail 11mips-default-n running, mounted at /usr/local/poudriere/data/.m/11mips-default/ref for interactive run testing
[00:11:09] ====>> To enter jail: jexec 11mips-default-n env -i TERM=$TERM /usr/bin/login -fp root
[00:11:09] ====>> To stop jail: poudriere jail -k -j 11mips
root@tasty.ysv:/home/sbruno # uname -a
FreeBSD tasty.ysv.freebsd.org 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r282703: Sun May 10 08:39:18 UTC 2015     peter@build-11.freebsd.org:/usr/obj/usr/src/sys/CLUSTER11  amd64
Comment 28 Sean Bruno freebsd_committer freebsd_triage 2015-07-26 00:45:55 UTC
same jail, same qemu, host system upgraded a bit and it fails.

sort funcname.tab | /usr/bin/awk -f ./functable.awk > functable.tab
./mktable 100 functable.tab > functable.c
GC Warning: Out of memory - trying to allocate less
Insufficient memory for GC_all_nils
*** Error code 1

Stop.
make[1]: stopped in /wrkdirs/usr/ports/www/w3m/work/w3m-0.5.3
*** Error code 1

Stop.
make: stopped in /usr/ports/www/w3m
=======================<phase: Interactive    >============================
[00:08:09] ====>> Installing packages
[00:08:09] ====>> Installing run-depends for www/w3m
===>   w3m-0.5.3_4 depends on file: /usr/local/bin/perl5.20.2 - found
[00:08:09] ====>> Installing www/w3m
pkg-static: /tmp/pkgs/w3m-0.5.3_4.txz: No such file or directory
pkg-static: Was 'pkg install /tmp/pkgs/w3m-0.5.3_4.txz' meant?

Failed to install the following 1 package(s): /tmp/pkgs/w3m-0.5.3_4.txz
*** Error code 70

Stop.
make: stopped in /usr/ports/www/w3m
[00:08:10] ====>> Warning: Failed to install www/w3m
[00:08:10] ====>> Installing local Pkg repository to /usr/local/etc/pkg/repos
[00:08:10] ====>> Leaving jail 11mips-default-n running, mounted at /usr/local/poudriere/data/.m/11mips-default/ref for interactive run testing
[00:08:10] ====>> To enter jail: jexec 11mips-default-n env -i TERM=$TERM /usr/bin/login -fp root
[00:08:10] ====>> To stop jail: poudriere jail -k -j 11mips
root@tasty.ysv:/home/sbruno # uname -a
FreeBSD tasty.ysv.freebsd.org 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r284533: Thu Jun 18 01:25:08 UTC 2015     peter@build-11.freebsd.org:/usr/obj/usr/src/sys/CLUSTER11  amd64
Comment 29 Sean Bruno freebsd_committer freebsd_triage 2015-07-26 01:14:15 UTC
fails here, bisecting again.

/nxb-bin/usr/bin/cc  -I. -I. -O2 -pipe -G0  -fno-strict-aliasing -I./libwc  -I/usr/include/openssl -I/usr/local/include -I/usr/local/include -DHAVE_CONFIG_H -DAUXBIN_DIR=\"/usr/local/libexec/w3m\"  -DCGIBIN_DIR=\"/usr/local/libexec/w3m/cgi-bin\" -DHELP_DIR=\"/usr/local/share/w3m\"  -DETC_DIR=\"/usr/local/etc\" -DCONF_DIR=\"/usr/local/etc/w3m\"  -DRC_DIR=\"~/.w3m\"  -DLOCALEDIR=\"/usr/local/share/locale\" -o mktable mktable.o dummy.o Str.o hash.o myctype.o -L/usr/local/lib -lm -L/usr/local/lib -lgc
sort funcname.tab | /usr/bin/awk -f ./functable.awk > functable.tab
./mktable 100 functable.tab > functable.c
GC Warning: Out of memory - trying to allocate less
Insufficient memory for GC_all_nils
*** Error code 1

Stop.
make[1]: stopped in /wrkdirs/usr/ports/www/w3m/work/w3m-0.5.3
*** Error code 1

Stop.
make: stopped in /usr/ports/www/w3m
=======================<phase: Interactive    >============================
[00:08:06] ====>> Installing packages
[00:08:06] ====>> Installing run-depends for www/w3m
===>   w3m-0.5.3_4 depends on file: /usr/local/bin/perl5.20.2 - found
[00:08:07] ====>> Installing www/w3m
pkg-static: /tmp/pkgs/w3m-0.5.3_4.txz: No such file or directory
pkg-static: Was 'pkg install /tmp/pkgs/w3m-0.5.3_4.txz' meant?

Failed to install the following 1 package(s): /tmp/pkgs/w3m-0.5.3_4.txz
*** Error code 70

Stop.
make: stopped in /usr/ports/www/w3m
[00:08:07] ====>> Warning: Failed to install www/w3m
[00:08:07] ====>> Installing local Pkg repository to /usr/local/etc/pkg/repos
[00:08:07] ====>> Leaving jail 11mips-default-n running, mounted at /usr/local/poudriere/data/.m/11mips-default/ref for interactive run testing
[00:08:07] ====>> To enter jail: jexec 11mips-default-n env -i TERM=$TERM /usr/bin/login -fp root
[00:08:07] ====>> To stop jail: poudriere jail -k -j 11mips
root@tasty.ysv:/home/sbruno # /etc
root@tasty.ysv:/home/sbruno # uname -a
FreeBSD tasty.ysv.freebsd.org 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r284045: Fri Jun  5 22:44:49 UTC 2015     peter@build-11.freebsd.org:/usr/obj/usr/src/sys/CLUSTER11  amd64
Comment 30 Sean Bruno freebsd_committer freebsd_triage 2015-07-26 01:28:44 UTC
and ... works here.  I need to build kernels now as all my prebuilt cluster images are now exhausted.  Will bisect revisions 283584 <-> 284045

=======================<phase: deinstall      >============================
===>  Deinstalling for w3m
===>   Deinstalling w3m-0.5.3_4
Updating database digests format: .... done
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        w3m-0.5.3_4

The operation will free 2 MiB.
[11mips-default] [1/1] Deinstalling w3m-0.5.3_4...
[11mips-default] [1/1] Deleting files for w3m-0.5.3_4: .......... done
===========================================================================
====>> Checking for extra files and directories
=======================<phase: Interactive    >============================
[00:11:07] ====>> Installing packages
[00:11:07] ====>> Installing run-depends for www/w3m
===>   w3m-0.5.3_4 depends on file: /usr/local/bin/perl5.20.2 - found
[00:11:07] ====>> Installing www/w3m
[11mips-default] Installing w3m-0.5.3_4...
[11mips-default] Extracting w3m-0.5.3_4: 100%
[00:11:09] ====>> Installing local Pkg repository to /usr/local/etc/pkg/repos
[00:11:09] ====>> Leaving jail 11mips-default-n running, mounted at /usr/local/poudriere/data/.m/11mips-default/ref for interactive run testing
[00:11:09] ====>> To enter jail: jexec 11mips-default-n env -i TERM=$TERM /usr/bin/login -fp root
[00:11:09] ====>> To stop jail: poudriere jail -k -j 11mips
root@tasty.ysv:/home/sbruno # uname -a
FreeBSD tasty.ysv.freebsd.org 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r283584: Tue May 26 23:18:46 UTC 2015     peter@build-11.freebsd.org:/usr/obj/usr/src/sys/CLUSTER11  amd64
Comment 31 Mikael Urankar freebsd_committer freebsd_triage 2015-07-26 11:01:24 UTC
Sorry Sean if I wasn't clear enough in my previous comment (#25), I've done the bissecting work and r283998 is the culprit.
Comment 32 Carlos J Puga Medina 2015-08-03 17:34:04 UTC
In my case, w3m port builds fine only if I add -DNO_INCREMENTAL flag to boehm-gc/Makefile.

This little tweak is also needed for aarch64 and armv6. Tested on armv6, aarch64 and mips32.
Comment 33 Carlos J Puga Medina 2015-08-06 06:50:54 UTC
Created attachment 159604 [details]
boehm-gc add support for armv6 and mips

- Added -DNO_INCREMENTAL flag for aarch64, armv6 and mips
Comment 34 Sean Bruno freebsd_committer freebsd_triage 2015-10-28 15:47:03 UTC
Carlos:

Currently, devel/boehm-gc builds on mips/armv6 just fine.  Should I close this out or is there something further that you'd like done.

http://beefy7.nyi.freebsd.org/build.html?mastername=head-mips-default&build=p400328_s290048

http://beefy8.nyi.freebsd.org/build.html?mastername=head-armv6-default&build=p400328_s290048
Comment 35 Carlos J Puga Medina 2015-10-29 02:18:37 UTC
(In reply to Sean Bruno from comment #34)

Hi Sean,

I think that we can close this PR.

Thanks for your help.
Comment 36 Kubilay Kocak freebsd_committer freebsd_triage 2015-10-29 04:31:16 UTC
Over to sbruno to resolve as necessary
Comment 37 Sean Bruno freebsd_committer freebsd_triage 2015-11-08 19:28:23 UTC
We resolved this in the qemu-sbruno/qemu-user-static port.