From owner-freebsd-ports@freebsd.org Thu Apr 1 08:47:57 2021 Return-Path: Delivered-To: freebsd-ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 933E05C4675; Thu, 1 Apr 2021 08:47:57 +0000 (UTC) (envelope-from mgorny@gentoo.org) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 4F9xf42B5dz3CWK; Thu, 1 Apr 2021 08:47:55 +0000 (UTC) (envelope-from mgorny@gentoo.org) Message-ID: Subject: Re: Illegal instruction on new port mongodb49 on arm64 From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: Ronald Klop , freebsd-ports@freebsd.org, freebsd-arm@freebsd.org Date: Thu, 01 Apr 2021 10:47:49 +0200 In-Reply-To: <1071728798.124.1617266260257@localhost> References: <1071728798.124.1617266260257@localhost> Organization: Gentoo Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F9xf42B5dz3CWK X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=gentoo.org; spf=pass (mx1.freebsd.org: domain of mgorny@gentoo.org designates 140.211.166.183 as permitted sender) smtp.mailfrom=mgorny@gentoo.org X-Spamd-Result: default: False [-1.39 / 15.00]; ARC_NA(0.00)[]; R_MIXED_CHARSET(0.91)[subject]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:140.211.166.183]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; RWL_MAILSPIKE_GOOD(0.00)[140.211.166.183:from]; HAS_ORG_HEADER(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_POLICY_ALLOW(-0.50)[gentoo.org,none]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:3701, ipnet:140.211.0.0/16, country:US]; MID_RHS_MATCH_FROM(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arm,freebsd-ports]; RCVD_IN_DNSWL_HI(-0.50)[140.211.166.183:from] X-Mailman-Approved-At: Thu, 01 Apr 2021 11:08:13 +0000 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2021 08:47:57 -0000 On Thu, 2021-04-01 at 10:37 +0200, Ronald Klop wrote: > Hi, > > I created a new port for mongodb49: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254631 > It compiles fine: https://www.klop.ws/mongodb49-4.9.0.r0.log > > When I run an application I get "Illegal Instruction" error. > > ============================================================== > [root@rpi4 /tmp]# lldb /usr/local/bin/mongo > (lldb) target create "/usr/local/bin/mongo" > Current executable set to '/usr/local/bin/mongo' (aarch64). > (lldb) run > Process 55420 launching > Process 55420 launched: '/usr/local/bin/mongo' (aarch64) > Process 55420 stopped > * thread #1, name = 'mongo', stop reason = signal SIGILL: illegal trap >     frame #0: 0x00000000016a320c mongo`___lldb_unnamed_symbol32$$mongo + 1784 > mongo`___lldb_unnamed_symbol32$$mongo: > -> 0x16a320c <+1784>: ldaddal x9, x8, [x8] According to [1], this instruction requires ARMv8.1. If I grep correctly, rpi4 is ARMv8-A. Yet you're compiling with -march=armv8.2-a, so it's a case of wrong -march. [1] https://developer.arm.com/documentation/100069/0608/A64-Data-Transfer-Instructions/LDADDA--LDADDAL--LDADD--LDADDL--LDADDAL--LDADD--LDADDL -- Best regards, Michał Górny