NetBSD Problem Report #59822
From dholland@netbsd.org Sun Dec 7 21:49:25 2025
Return-Path: <dholland@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)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 7DABB1A9239
for <gnats-bugs@gnats.NetBSD.org>; Sun, 7 Dec 2025 21:49:25 +0000 (UTC)
Message-Id: <20251207214924.D505D8566D@mail.netbsd.org>
Date: Sun, 7 Dec 2025 21:49:24 +0000 (UTC)
From: dholland@NetBSD.org
Reply-To: dholland@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: the pkgsrc guide is missing many compiler/target/OS macros
X-Send-Pr-Version: 3.95
>Number: 59822
>Category: pkg
>Synopsis: the pkgsrc guide is missing many compiler/target/OS macros
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Sun Dec 07 21:50:00 +0000 2025
>Originator: David A. Holland
>Release: pkgsrc 20251207
>Organization:
Enabling Coinductive Structural Engineering with Turtles(TM)
>Environment:
irrelevant
>Description:
The lists of recommended test macros for compilers, targets, OSes, and
such in fixes.xml is missing a lot of stuff.
This is important because for many there are multiple choices and some
are more reliably available than others. This is where our collective
experience about that is supposed to be documented.
The following targets that appear in mk/platform don't have documented
recognition macros:
- AIX
- FreeMINT
- HPUX
- MidnightBSD
- OSF/1
- QNX
- SCO_SV
- Unixware
The following CPUs that we presumptively care about don't have
documented recognition macros:
- alpha
- m68k
- riscv
- sh3
- vax
plus at least the following that we may not actually care about:
- microblaze
- or1k
plus unless the recommended way to detect aargh64 is __arm__ and
__LP64__, which I don't think is the case, the proper recognition
macro should be added to the arm entry.
There is also no discussion of whether __LP64__ or _LP64 or something
else is the preferred test for that, and there should also be a table
for detecting 32-on-64 configs (most notably __mips__ with __N32__).
The following _compilers_ that appear in mk/compiler have no
documented recognition macro:
- DEC/Compaq ccc
- clang (!)
- distcc (not exactly a compiler but someone might reasonably want
to detect it)
- HP's HPUX compiler
- the Intel x86 compiler
- the SGI compiler
- mipspro
- pcc
- IBM's XL compiler
>How-To-Repeat:
Reading.
>Fix:
I don't know what most of these are (even for things like __alpha__
vs. __ALPHA__, it's just been too long) so I mostly can't fill any of
it in myself.
My immediately available clang build produces only __riscv for RISC-V
(not __riscv__ or __RISCV__ and not e.g. __RV32__ or __RV64__). It
produces __m68k__ for M68k. I don't have runnable cross-gcc builds for
any of the above cpus at the moment.
clang also produces __clang__ (not __CLANG__, I guess that's too
loud)... but note that because clang pretends to be gcc, if you need
to test specifically for clang you need to do it first; this
discussion needs to appear in the text as well.
(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-2025
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.