NetBSD Problem Report #56475

From www@netbsd.org  Fri Oct 29 20:04:56 2021
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_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 31B0F1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 29 Oct 2021 20:04:56 +0000 (UTC)
Message-Id: <20211029200454.5D05E1A923A@mollari.NetBSD.org>
Date: Fri, 29 Oct 2021 20:04:54 +0000 (UTC)
From: cryintothebluesky@gmail.com
Reply-To: cryintothebluesky@gmail.com
To: gnats-bugs@NetBSD.org
Subject: x11/xf86-video-xgi build fails on Linux with "open with O_CREAT or O_TMPFILE in second argument needs 3 arguments"
X-Send-Pr-Version: www-1.0

>Number:         56475
>Category:       pkg
>Synopsis:       x11/xf86-video-xgi build fails on Linux with "open with O_CREAT or O_TMPFILE in second argument needs 3 arguments"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    joerg
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 29 20:05:00 +0000 2021
>Last-Modified:  Fri Jan 21 22:45:01 +0000 2022
>Originator:     Sad Clouds
>Release:        
>Organization:
>Environment:
Linux debian11 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux

>Description:
This package is pulled in as a dependency of building modular xorg and it fails with the following errors:

In file included from /usr/include/fcntl.h:301,
                 from xgi_driver.c:109:
In function 'open',
    inlined from 'XGIPreInit' at xgi_driver.c:2800:19:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:11: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
   50 |           __open_missing_mode ();
      |           ^~~~~~~~~~~~~~~~~~~~~~
*** [xgi_driver.lo] Error code 1



>How-To-Repeat:

>Fix:
--- /opt/pkg.objects/x11/xf86-video-xgi/work/xf86-video-xgi-1.6.1/src/xgi_driver.c.orig 2021-10-29 18:22:39.908804948 +0100
+++ /opt/pkg.objects/x11/xf86-video-xgi/work/xf86-video-xgi-1.6.1/src/xgi_driver.c      2021-10-29 18:23:55.080936632 +0100
@@ -2797,7 +2797,7 @@
     FbDevExist = FALSE;
    if((pXGI->Chipset != PCI_CHIP_XGIXG20)&&(pXGI->Chipset != PCI_CHIP_XGIXG21)&&( pXGI->Chipset != PCI_CHIP_XGIXG27 ))
    {
-        if ((fd = open("/dev/fb", 'r')) != -1) {
+        if ((fd = open("/dev/fb", O_RDONLY)) != -1) {
             PDEBUG(ErrorF("--- open /dev/fb....   \n"));
             ioctl(fd, FBIOGET_FSCREENINFO, &fix);
             if (fix.accel == FB_ACCEL_XGI_GLAMOUR) {

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->joerg
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Thu, 04 Nov 2021 10:15:44 +0000
Responsible-Changed-Why:
Over to maintainer.


From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56475: x11/xf86-video-xgi build fails on Linux with "open
 with O_CREAT or O_TMPFILE in second argument needs 3 arguments"
Date: Fri, 21 Jan 2022 22:40:44 +0000

 On Fri, Oct 29, 2021 at 08:05:00PM +0000, cryintothebluesky@gmail.com wrote:
  > -        if ((fd = open("/dev/fb", 'r')) != -1) {
  > +        if ((fd = open("/dev/fb", O_RDONLY)) != -1) {

 o_O

 -- 
 David A. Holland
 dholland@netbsd.org

>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.