From owner-freebsd-emulation@freebsd.org Sat Jan 5 03:40:06 2019 Return-Path: Delivered-To: freebsd-emulation@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 BB38D1486CF7 for ; Sat, 5 Jan 2019 03:40:05 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-4.consmr.mail.bf2.yahoo.com (sonic307-4.consmr.mail.bf2.yahoo.com [74.6.134.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 AD07193A83 for ; Sat, 5 Jan 2019 03:40:04 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: wsCSi_AVM1lH5G0laNpexMcIWfrTm5zzjwmcAPD.a0b6oK8s9W1OhBIWs6h_1Ph Ceg9aT2tQDkhde9i9O5IGuR8H0Au9asqOSqvEn28lTJFWWUA16vWnCfn_4KRhXz0irxkXdBMaVsC mmrYnZ9LlK_0z26nTsJqRgHslTcOTUDjen7WotJVCusjnUdPhTx6Bd41RqAs8vD2pZfLteWsjO5Q GJDqoy2RCWYGRDYWHqVC0X_nEocCRgYJZyJxXkQ_QEx5Bp3XDnXY7DK2xjPnbGROpB6j_fOw.T_J q_dpMvHtj.bVH60HJux18TUnGF5QZ8HjcBvCM9hNgRWb.A2aglZfXPo1Lozd9s1Q_6ZDOI8RGQol e60v5YiBdIqBRc_j5Wj1kShwH9hKJ5Q4FYATuslL4h8pltuOegFl2hfsylPtYOuqZPsMElRyrRcx 8EBfF80xjm4iTE5OPWjpRr.79po3XPpMVvsPEGpmUVfLu7aSbdhj7h9MTvZLFv7v2u.K0oO6BC1c yBDTZEwckGBLKkeAY0t2M0WW3M887ebXShFSLIuYaagpfGDrfMwszgOmExu4GpwG.HsQ2eU2sTZv d32lDfkMd0ck4C5ysb7uE_GLPJmNWkYoJol7RYoCq1XSdXGujjMiYOpdY322VrvdsmySKfmf.b6C EAtueOPpNUNqvtYGcAT5lj3AJsDY6OmASPja7kPFQol1_z50xA4CmjpzUR0WUJ194PLvSncCCf8W UO0XETF99Z3zOi1X_g7CtIA2b.hmxX4ZFn0J7IFSgZXblxAe391NCrHQaIDRKtWKPEhpWIVPG0vN 6Ln.IWfdzoAQtdh9unYSLkSxM26xIYuTHQA2gLNMZ.BPyPJwzzZNRpedQTws_6hCxpYWODvMzfPE _Ewo8e0f_GC_SpA.EZfoQ2Og57o4k2CfJJzRVTZtqGTaHzQKK80H8LUHYOZ14pdGLDbgvRY.fVYm nCOxaY.C6If1bY2y5Aye5Ij3kit02LmlZQzU.V4X0iQq1xt4eFNWnGtpTXxYWSztdpRWsyr3mefC 9usKS1CwK1Je1ZM9SXKg1x2BOrQFhmaYTaAAVbWhxjJLRMEeoiyFTHIR8PCn4sM0xEYThVef4yu8 GvHk9 Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.bf2.yahoo.com with HTTP; Sat, 5 Jan 2019 03:39:58 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.109]) ([67.170.167.181]) by smtp422.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 0c25ded08e83581e60d16ab4a68d0580; Sat, 05 Jan 2019 03:29:54 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: qemu-x86_64-static has target_freebsd_flock being too large (__packed use issue) Message-Id: <1139EAD0-FED3-428C-AA0E-00ABB8BD111D@yahoo.com> Date: Fri, 4 Jan 2019 19:29:51 -0800 Cc: Sean Bruno To: Kyle Evans , freebsd-emulation@freebsd.org, ports-list freebsd X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: AD07193A83 X-Spamd-Bar: ++ X-Spamd-Result: default: False [2.59 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; 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)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(0.90)[0.898,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.36)[ip: (4.24), ipnet: 74.6.128.0/21(1.47), asn: 26101(1.17), country: US(-0.08)]; NEURAL_SPAM_MEDIUM(0.46)[0.464,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.38)[0.375,0]; RCVD_IN_DNSWL_NONE(0.00)[43.134.6.74.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2019 03:40:06 -0000 [qemu-aarch64-static has the same problem but qemu-armv7-sstatic does = not. The context here is FreeBSD head -r341836 based and ports head -r488859 based.] Note: I assume that "struct target_freebsd_flock" is meant to match the = memory layout of the target's native "struct flock". Otherwise the reported = differences below could be irrelevant. For amd64 and aarch64 the following code: printf("sizeof(struct flock) =3D %lu\n", (unsigned long) = sizeof(struct flock)); printf("l_start %lu\n", (unsigned long) offsetof(struct flock, = l_start)); printf("l_len %lu\n", (unsigned long) offsetof(struct flock, = l_len)); printf("l_pid %lu\n", (unsigned long) offsetof(struct flock, = l_pid)); printf("l_type %lu\n", (unsigned long) offsetof(struct flock, = l_type)); printf("l_whence %lu\n", (unsigned long) offsetof(struct flock, = l_whence)); printf("l_sysid %lu\n", (unsigned long) offsetof(struct flock, = l_sysid)); =20 produces: sizeof(struct flock) =3D 32 l_start 0 l_len 8 l_pid 16 l_type 20 l_whence 22 l_sysid 24 However gdb reports for qemu-x86_64-static and qemu-aarch64-static and qemu-arm-static: (gdb) p/d sizeof(struct target_freebsd_flock) $10 =3D 28 (gdb) p/d &((struct target_freebsd_flock *)0)->l_start =20 $11 =3D 0 (gdb) p/d &((struct target_freebsd_flock *)0)->l_len =20 $12 =3D 8 (gdb) p/d &((struct target_freebsd_flock *)0)->l_pid $13 =3D 16 (gdb) p/d &((struct target_freebsd_flock *)0)->l_type $14 =3D 20 (gdb) p/d &((struct target_freebsd_flock *)0)->l_whence $15 =3D 22 (gdb) p/d &((struct target_freebsd_flock *)0)->l_sysid=20 $16 =3D 24 So only the overall size is different for this information. But: struct target_freebsd_flock { int64_t l_start; int64_t l_len; int32_t l_pid; int16_t l_type; int16_t l_whence; int32_t l_sysid; } QEMU_PACKED; with a potential packed vs. /usr/include/sys/fcntl.h : struct flock { off_t l_start; /* starting offset */ off_t l_len; /* len =3D 0 means until end of file */ pid_t l_pid; /* lock owner */ short l_type; /* lock type: read/write, etc. */ short l_whence; /* type of l_start */ int l_sysid; /* remote system id or zero for local */ }; with no potential __packed. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)