NetBSD Problem Report #54165

From tsutsui@ceres.dti.ne.jp  Mon May  6 05:13:24 2019
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A65B37A186
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  6 May 2019 05:13:24 +0000 (UTC)
Message-Id: <201905060513.x465DJ0o001797@ceres.dti.ne.jp>
Date: Mon, 6 May 2019 14:13:19 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: pkgsrc/devel/SDL2 should not use rpi option for all arm
X-Send-Pr-Version: 3.95

>Number:         54165
>Category:       pkg
>Synopsis:       pkgsrc/devel/SDL2 should not use rpi option for all arm
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 06 05:15:00 +0000 2019
>Closed-Date:    Thu Jan 14 12:38:20 +0000 2021
>Last-Modified:  Thu Jan 14 12:38:20 +0000 2021
>Originator:     Izumi Tsutsui
>Release:        NetBSD/hpcarm 8.0 + pkgsrc-2019Q1
>Organization:
>Environment:
System: 
NetBSD wzero3 8.0 NetBSD 8.0 (WZERO3) #0: Tue Jul 17 14:59:51 UTC 2018  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/hpcarm/compile/WZERO3 hpcarm
Architecture: earmv4
Machine: hpcarm
>Description:
pkgsrc/devel/SDL2/options.mk choose 'rpi' option
if MACHINE_ARCH includes 'arm' strings:
---
.if !empty(MACHINE_ARCH:M*arm*)
PKG_OPTIONS_GROUP.gl+= rpi
PKG_SUGGESTED_OPTIONS+= rpi
.else
PKG_SUGGESTED_OPTIONS+= opengl
.endif
---

But it causes SIGILL on running SDL2 applications
on hpcarm WS003SH (armv5 XScale PXA270):

---
wzero3-% PC6001VX
Illegal instruction (core dumped)
wzero3-% gdb PC6001VX

 :

Program received signal SIGILL, Illegal instruction.
0xb8e48774 in vcos_log_register (name=0xb8e4b194 "default",
category=0xb8e5e954 <dflt_log_category>)
at /usr/obj.earmv4/pkgsrc/misc/raspberrypi-userland/work.earmv4/userland-734d76b0675685e9ec9148694f2cc00f58e5ebc0/interface/vcos/generic/vcos_logcat.c:378
 :

---

>How-To-Repeat:
Build and exec PC6001VX (and other packages that use SDL2) on hpcarm
or other armv[45] machines.

>Fix:
Enable it only on armv[678]?
---
===================================================================
RCS file: /cvsroot/pkgsrc/devel/SDL2/options.mk,v
retrieving revision 1.10
diff -u -p -d -r1.10 options.mk
--- options.mk  24 Dec 2018 16:25:30 -0000      1.10
+++ options.mk  6 May 2019 05:08:21 -0000
@@ -12,7 +12,7 @@ PKG_SUGGESTED_OPTIONS+=       x11

 .include "../../mk/bsd.fast.prefs.mk"

-.if !empty(MACHINE_ARCH:M*arm*)
+.if !empty(MACHINE_ARCH:M*armv[678]*)
 PKG_OPTIONS_GROUP.gl+= rpi
 PKG_SUGGESTED_OPTIONS+=        rpi
 .else
---

Or make it actually optional?
(no way to switch runtime with both options?)

---
Izumi Tsutsui

>Release-Note:

>Audit-Trail:
From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54165: pkgsrc/devel/SDL2 should not use rpi option for all
 arm
Date: Mon, 27 May 2019 01:56:38 +0000

 If it correctly enables rpi option on ARMv6, sounds good. Please commit
 it.

 I am not sure if it's a good idea to assume all newer ARM is RPI, and
 disable opengl, but very few ARM things will have full OpenGL.

State-Changed-From-To: open->closed
State-Changed-By: nia@NetBSD.org
State-Changed-When: Thu, 14 Jan 2021 12:38:20 +0000
State-Changed-Why:
The rpi option hasn't been enabled by default on arm for some time.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.