NetBSD Problem Report #44459

From khorben@defora.org  Tue Jan 25 15:50:13 2011
Return-Path: <khorben@defora.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 9DEFC63B873
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 25 Jan 2011 15:50:13 +0000 (UTC)
Message-Id: <20110125155006.2F34D8F@kwarx.defora.lan>
Date: Tue, 25 Jan 2011 16:50:06 +0100 (CET)
From: Pierre Pronchery <khorben@defora.org>
To: gnats-bugs@gnats.NetBSD.org
Subject: build.sh fails to build when /tmp is mounted noexec
X-Send-Pr-Version: 3.95

>Number:         44459
>Category:       toolchain
>Synopsis:       build.sh fails to build when /tmp is mounted noexec
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lukem
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 25 15:55:00 +0000 2011
>Closed-Date:    Sat Jun 10 07:15:30 +0000 2023
>Last-Modified:  Sat Jun 10 07:15:30 +0000 2023
>Originator:     Pierre Pronchery
>Release:        NetBSD 5.1_STABLE
>Organization:
>Environment:
System: NetBSD kwarx.defora.lan 5.1_STABLE NetBSD 5.1_STABLE (GENERIC) #0: Mon Jan 24 15:02:10 CET 2011 khorben@kwarx.defora.lan:/home/amd64/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
On my system, /tmp is a mfs mounted with the "noexec" flag.
Unfortunately, this seems to break proper operation of the build.sh
script.

>How-To-Repeat:
# mount -t mfs -o noexec mfs /tmp
# cd /usr/src
# ./build.sh tools
[...]
checking whether the C compiler works... configure: error: cannot run C
compiled programs.
If you meant to cross compile, use `--host'.

ERROR: Configure of nbmake failed
*** BUILD ABORTED ***

>Fix:
Forcing TMPDIR to be a different location, with execution permissions,
bypasses the issue:
# TMPDIR=$HOME ./build.sh tools
[...]
checking whether the C compiler works... yes
checking whether we are cross compiling... no

A suggestion on IRC was to default to OBJDIR instead, and supply it as
TMPDIR within the environment during compilation. I think this would
make sense indeed.

>Release-Note:

>Audit-Trail:
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: toolchain-manager@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: re: toolchain/44459: build.sh fails to build when /tmp is mounted noexec
Date: Wed, 26 Jan 2011 07:17:32 +1100

 i think your workaround is about the best we can do here.  the problem
 is that we don't *know* what the OBJDIR is until we've built make, and
 we need this tmpdir to build make.

 documenting this probably the best we can do.


 .mrg.

State-Changed-From-To: open->feedback
State-Changed-By: lukem@NetBSD.org
State-Changed-When: Thu, 18 May 2023 14:24:05 +0000
State-Changed-Why:
I've updated doc/BUILDING.mdoc and BUILDING to describe TMPDIR as:

     TMPDIR            Top-level directory to store temporary directories used
                       by build.sh before paths to other directories such as
                       .OBJDIR can be determined.

                       Note: Must support execution of binaries.  I.e.,
                       without mount(8)'s -o noexec option.

                       Default: "/tmp".

(Per mrg@'s suggestion to document this).

Does that suffice?


From: "Luke Mewburn" <lukem@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44459 CVS commit: src
Date: Thu, 18 May 2023 14:22:53 +0000

 Module Name:	src
 Committed By:	lukem
 Date:		Thu May 18 14:22:53 UTC 2023

 Modified Files:
 	src: BUILDING
 	src/doc: BUILDING.mdoc

 Log Message:
 BUILDING: TMPDIR must not be noexec

 Describe $TMPDIR as used by build.sh, and
 add a note that it can't be mounted noexec.

 PR toolchain/44459


 To generate a diff of this commit:
 cvs rdiff -u -r1.148 -r1.149 src/BUILDING
 cvs rdiff -u -r1.137 -r1.138 src/doc/BUILDING.mdoc

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: toolchain-manager->lukem
Responsible-Changed-By: lukem@NetBSD.org
Responsible-Changed-When: Sat, 20 May 2023 08:35:55 +0000
Responsible-Changed-Why:


State-Changed-From-To: feedback->closed
State-Changed-By: lukem@NetBSD.org
State-Changed-When: Sat, 10 Jun 2023 07:15:30 +0000
State-Changed-Why:
BUILDING updated to describe the $TMPDIR requirement for exec.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.