NetBSD Problem Report #57837

From  Fri Jan 12 01:00:29 2024
Return-Path: <>
Received: from ( [])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id EA12E1A9238
	for <>; Fri, 12 Jan 2024 01:00:28 +0000 (UTC)
Message-Id: <>
Date: Fri, 12 Jan 2024 01:00:27 +0000 (UTC)
Subject: bootstrap-mk-files defines wrong OBJECT_FMT on macOS (Darwin)
X-Send-Pr-Version: www-1.0

>Number:         57837
>Category:       pkg
>Synopsis:       bootstrap-mk-files defines wrong OBJECT_FMT on macOS (Darwin)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 12 01:05:00 +0000 2024
>Last-Modified:  Fri Jan 26 03:30:02 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current
The NetBSDarwin Foundation
On macOS (`Darwin'), bootstrap-mk-files defines OBJECT_FMT=ELF even though the correct definition is OBJECT_FMT=Mach-O.

pkgsrc's mk infrastructure has a workaround in mk/

# Set this before <> does, since it doesn't know about Darwin
.if ${OPSYS} == "Darwin"
OBJECT_FMT?=            Mach-O

But it would be nice if bootstrap-mk-files defined this correctly in the first place to render this workaround unnecessary.
$ cat Makefile
.include <>
$ bmake -V OBJECT_FMT
Yes, please!

From: "Taylor R Campbell" <>
Subject: PR/57837 CVS commit: pkgsrc/mk
Date: Fri, 26 Jan 2024 03:25:36 +0000

 Module Name:	pkgsrc
 Committed By:	riastradh
 Date:		Fri Jan 26 03:25:36 UTC 2024

 Modified Files:

 Log Message: Set OBJECT_FMT for Darwin before cross variables.

 This way it can be handled by the cross variable logic when the host
 and target have misatched object formats, like building NetBSD
 packages (ELF) on macOS (Mach-O).

 This whole stanza can be removed when PR pkg/57837
 (bootstrap-mk-files defines wrong OBJECT_FMT on macOS
 (Darwin), is fixed.

 No functional change intended so far -- this just makes subsequent
 patches easier to follow.

 To generate a diff of this commit:
 cvs rdiff -u -r1.437 -r1.438 pkgsrc/mk/

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

NetBSD Home
NetBSD PR Database Search

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