From owner-freebsd-ports@freebsd.org Sat Nov 17 04:45:50 2018 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 399F91124D7F for ; Sat, 17 Nov 2018 04:45:50 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-4.consmr.mail.bf2.yahoo.com (sonic306-4.consmr.mail.bf2.yahoo.com [74.6.132.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D7FE7A196 for ; Sat, 17 Nov 2018 04:45:49 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 4AbBfhAVM1mAJimEHNCc0TR1jThZZVYYkDesBGe02PcOgYVxrV0pHNnvsmg.j9b gnRB6pnkgZ2m_OqCEZWLdeR1ozJvM_KZPJvGjzGFuVnvJOD3FLVJdO._W6mi7Nd64fmojNpvaX8i EBZ2FTRJfGWkq5u.tzaxxNUEXjcFGBA7Zdzg00Z7jDFuqkLsLxcVoZrwQds.UtEyQ6hkZq0Fyn9l Z9E4tZcmATF3ypAuq8Ogq64_2WOBk0fiXBtqxhpo3nzn.P9.jQDjsnuoRGKWmnf1Nqhw3nmCu_BV XJEK8SKgmdJ1FleiKO4AdDg5YBdf21l9exRY6I2nv4tSW8WzaTjYAr0Z04JcF99ITh0uXURRlRbA wZP5lTsjFTo5d.g.5Sai0lQYkel1tXP.TWI_JzbjAU6ppJBpaOHgApmLTky2lpCqlGGu_Yg9ExTm zXGJH7vm8mNsi8hv_lZ4XBFBUf1n2F1T3TYXaT26UvFuF9RFTHOorzwd0NnWhOsjT_JJoedxaUK9 8i0EK568RefkrXPVF79FhRjx8AV_GX39avoFjLsaa2rz1heJhhMJjEb.ulVJvkELka5gOytCQu.h 1B56NL4bRP1FsqqzIPQtlhEWe9AJrtZ11uodxMR8.kqhqI6lUr_Ms2DTSA648wnXqKRErLtj_zy9 E2Q4B6nBvcuGvIhTwZd.nKK9AOALMnULExlB9UC28GrMGJKJi5XsGVBwuIh3oR3iNcKevvhB4Tmx nMMgESX6BExHumxi6SYpReKSYAfPmmaMT1c68IysoJcVbJdTHESm1BxZLVB.5Yq.KCsuLvc4h5Ij Od2zhLlsWYmWKqu3XlC8b9qoisyeQkdXr5SRGmqgqH.zIlqEEZRg0rS9K7eT8iozDFSUnbQdyT1x QWvVhr_nVtB21U64dn9McYOTyV6uRNDFAwlhkAadfMmq8pLNoPh2QhkfhKpXlTEmiHAofVaoZw40 AXxEjLzBkQgmCfpq9_I3ImU1Z7_1YvrYQuLD3FagPps28j_2KIZQ_bHVpKWYwh40e2ALQVIQxsE. 4ZydZKoYnnJ9o_LNIlhtURL2ZT488XPq5yEeTrXlT3w9956f5cUMwh12iEaUw8M48 Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Sat, 17 Nov 2018 04:45:48 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp405.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID f1cc85da3f21904a8284d8c543e9902d; Sat, 17 Nov 2018 04:45:47 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: Re: ports head -r484652: lang/ruby24 fails to amd64 -> armv7 cross build: qemu: uncaught target signal 11 (2 of them) [armv7 native build worked] From: Mark Millard In-Reply-To: Date: Fri, 16 Nov 2018 20:45:45 -0800 Cc: Jan Beich Content-Transfer-Encoding: quoted-printable Message-Id: References: <0E2549AE-5235-40C3-A5F8-4D66D3F3E0E5@yahoo.com> To: ports-list freebsd , freebsd-ruby@freebsd.org X-Mailer: Apple Mail (2.3445.101.1) X-Rspamd-Queue-Id: 5D7FE7A196 X-Spamd-Result: default: False [2.23 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.97)[0.973,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCVD_IN_DNSWL_NONE(0.00)[43.132.6.74.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; IP_SCORE(1.76)[ip: (5.03), ipnet: 74.6.128.0/21(2.16), asn: 26101(1.73), country: US(-0.10)]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2018 04:45:50 -0000 Top post about bad comparison: The comparison to x11/pixman turns out to be a misnomer. More testing by Jan B. showed that -O2 vs -O was not sufficient to control the behavior for x11/pixman's builds. pixman's issue traces back to use of .object_arch armv4 in four .S files and them causing R_ARM_V4BX relocation record use, which lld only had support-for checked in to llvm's truck today (2018-Nov-16). Despite that, the build environment's use of -O2 instead of -O is real for poudriere/qemu-arm-static/nxb/. . . use. ruby's problem is not tied to R_ARM_V4BX use: different problem. (No updated text below. The above did not fit there well.) On 2018-Nov-15, at 11:46, Mark Millard wrote: > [While the poudriere-devel/qemu-arm-static/nxb-bin/ amd64 -> armv7 > cross build failed, a native armv7 build worked. It turns out the > difference that matters is likely -O2 use vs -O use. More later > below.] >=20 > On 2018-Nov-10, at 23:29, Mark Millard wrote: >=20 >> Poudriere-devel reported: >>=20 >> [00:18:32] [07] [00:02:56] Saved lang/ruby24 | ruby-2.4.5,1 wrkdir = to: = /usr/local/poudriere/data/wrkdirs/FBSDFSSDjailArmV7-default/default/ruby-2= .4.5,1.tbz >> [00:18:32] [07] [00:02:56] Finished lang/ruby24 | ruby-2.4.5,1: = Failed: build >>=20 >> The log showed: >>=20 >> --- miniruby --- >> linking miniruby >> --- .rbconfig.time --- >> --- encdb.h --- >> generating encdb.h >> --- .rbconfig.time --- >> qemu: uncaught target signal 11 (Segmentation fault) - core dumped >> Segmentation fault >> *** [.rbconfig.time] Error code 139 >>=20 >> make[1]: stopped in /wrkdirs/usr/ports/lang/ruby24/work/ruby-2.4.5 >> --- encdb.h --- >> qemu: uncaught target signal 11 (Segmentation fault) - core dumped >> Segmentation fault >> *** [encdb.h] Error code 139 >>=20 >> make[1]: stopped in /wrkdirs/usr/ports/lang/ruby24/work/ruby-2.4.5 >> 2 errors >>=20 >>=20 >> Despite how the above looks, I find only one .core file in the >> tar archive produced for the failure: >>=20 >> # find /wrkdirs/usr/ports/lang/ruby/ -name "*.core" -print >> /wrkdirs/usr/ports/lang/ruby/work/ruby-2.4.5/qemu_miniruby.core >>=20 >> Apparently qemu does not allow for separate files for distinct >> processes. >>=20 >> For that .core file I find (libexec/gdb): >>=20 >> # chroot /usr/obj/DESTDIRs/clang-armv7-installworld-poud >> # cd /wrkdirs/usr/ports/lang/ruby/work/ruby-2.4.5/ >> # /usr/libexec/gdb miniruby qemu_miniruby.core=20 >> . . . >> (gdb) bt >> #0 0x00113f84 in rb_gc_writebarrier_unprotect (obj=3D4104601600) at = gc.c:1119 >> 1119 return RVALUE_WB_UNPROTECTED_BITMAP(obj) !=3D 0; >> [New Thread f4b5d000 (LWP 100638/)] >> [New LWP 61684] >> Current language: auto; currently minimal >> (gdb) bt >> #0 0x00113f84 in rb_gc_writebarrier_unprotect (obj=3D4104601600) at = gc.c:1119 >> #1 0x000c3fc8 in rb_include_class_new (module=3D4104569400, = super=3D) at ruby.h:1456 >> #2 0x000c4424 in include_modules_at (klass=3D4104602160, = c=3D4104602160, module=3D4104569400, search_super=3D) at class.c:913 >> #3 0x000c41f0 in rb_include_module (klass=3D4104602160, = module=3D4104569400) at class.c:870 >> #4 0x001f6dec in Init_String () at string.c:10021 >> #5 0x00129398 in rb_call_inits () at inits.c:28 >> #6 0x00103bac in ruby_setup () at eval.c:60 >> #7 0x00103be8 in ruby_init () at eval.c:76 >> #8 0x000a3300 in main (argc=3D11, argv=3D0x9fffe41c) at main.c:35 >> (gdb) up >> #1 0x000c3fc8 in rb_include_class_new (module=3D4104569400, = super=3D) at ruby.h:1456 >> 1456 rb_gc_writebarrier_unprotect(x); >> (gdb) up >> #2 0x000c4424 in include_modules_at (klass=3D4104602160, = c=3D4104602160, module=3D4104569400, search_super=3D) at class.c:913 >> 913 iclass =3D rb_include_class_new(module, = RCLASS_SUPER(c)); >> (gdb) up >> #3 0x000c41f0 in rb_include_module (klass=3D4104602160, = module=3D4104569400) at class.c:870 >> 870 changed =3D include_modules_at(klass, RCLASS_ORIGIN(klass), = module, TRUE); >> (gdb) up >> #4 0x001f6dec in Init_String () at string.c:10021 >> 10021 rb_include_module(rb_cString, rb_mComparable); >> (gdb) up >> #5 0x00129398 in rb_call_inits () at inits.c:28 >> 28 CALL(String); >> (gdb) up >> #6 0x00103bac in ruby_setup () at eval.c:60 >> 60 rb_call_inits(); >> (gdb) up >> #7 0x00103be8 in ruby_init () at eval.c:76 >> 76 int state =3D ruby_setup(); >> (gdb) up >> #8 0x000a3300 in main (argc=3D11, argv=3D0x9fffe41c) at main.c:35 >> 35 ruby_init(); >>=20 >> (I'm not familiar with what details libexec/gdb gets >> right vs. wrong. But the call chain seems coherent.) >>=20 >> Host environment: >>=20 >> # uname -apKU >> FreeBSD FBSDFSSD 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r340287M: Fri = Nov 9 08:37:01 PST 2018 = markmi@FBSDFSSD:/usr/obj/amd64_clang/amd64.amd64/usr/src/amd64.amd64/sys/G= ENERIC-NODBG amd64 amd64 1300003 1300003 >=20 > A prior example that fails for native armv7 builds > but works for poudriere-devel/qemu-arm-static/nxb-bin/ > (native cross tools based) amd64 -> armv7 cross builds > is x11/pixman. >=20 > Previously I discovered that x11/pixman builds fine in > poudriere-devel/qemu-arm-static/nxb-bin/ amd64 -> armv7 > cross builds but a link fails during native armv7 > builds. It turned out that with the host-native cross > tools involved -O2 was being used where native -O > was being used: the code in share/mk/sys.mk that > is designed to use -O for arm fails to do so and uses > -O2 instead. >=20 > (MACHINE_ARCH temporarily looks to be amd64, which > gets a -O2 put in CFLAGS instead of -O .) >=20 > ruby seems to go the other direction: with -O2 involved > something builds that fails to run during the build. > With -O involved instead ruby builds fine and produces > a ruby that works. >=20 > (I've not done any analysis to see if the -O2 based > build failure is because of code making assumption > that are not guaranteed vs. if the compiler/linker > is producing something bad from well-defined code.) >=20 >=20 > Bryan Drewery is now aware of the odd -O2 vs. -O > behavior under poudriere-devel/qemu-arm-static/nxb-bin/ > amd64 -> armv7 cross builds and likely it will be > fixed at some point. >=20 > But the existing behavior means that official armv6 and armv7 > port builds that use that poudriere-devel/qemu-arm-static/nxb-bin/ > amd64 -> armv7 cross build structure have been using > -O2 for a long time. This may challenge the use of > -O by default in CFLAGS for armv6 and armv7, in that -O2 > has been under an implicit test for as long as the > cross build structure has been used with share/mk/sys.mk > having the MACHINE_ARCH based selection of -O2 vs. -O . >=20 > mips* may have similar issues to arm* based on what > share/mk/sys.mk does for -O2 vs. -O . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)