pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/60299: cross/avr-gcc: build on Darwin
>Number: 60299
>Category: pkg
>Synopsis: avr-gcc does not build with latest xcode tools (v15)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu May 28 09:00:00 +0000 2026
>Originator: Diogo
>Release: Darwin 24.6.0
>Organization:
>Environment:
System: Darwin 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:34 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T8103 arm64
xcrun --show-sdk-version: 15.5
>Description:
avr-gcc does not build with latest xcode tools (v15).
>How-To-Repeat:
bmake -C /path/to/pkgsrc/cross/avr-gcc build
>Fix:
Here is a simple patch to include Apple's libc++ headers before
safe-ctype.h. That is sufficient to ensure the package gets built.
---
diff --git a/cross/avr-gcc/patches/patch-gcc_system.h b/cross/avr-gcc/patches/patch-gcc_system.h
new file mode 100644
index 000000000000..4ddfd6afc8cf
--- /dev/null
+++ b/cross/avr-gcc/patches/patch-gcc_system.h
@@ -0,0 +1,34 @@
+$NetBSD$
+
+Include Apple libc++ headers before GCC poisons ctype macros through
+safe-ctype.h. Newer libc++ pulls locale formatting declarations into headers
+such as <map> and <vector>, which exposes overloads like islower(char, locale)
+that collide with GCC's one-argument islower poison macro.
+
+--- gcc/system.h.orig 2023-07-27 08:13:03.000000000 +0000
++++ gcc/system.h
+@@ -194,13 +194,22 @@ extern int fprintf_unlocked (FILE *, con
+ #undef fread_unlocked
+ #undef fwrite_unlocked
+
+-/* Include <string> before "safe-ctype.h" to avoid GCC poisoning
+- the ctype macros through safe-ctype.h */
++/* Include C++ standard library headers before "safe-ctype.h" to avoid GCC
++ poisoning the ctype macros through safe-ctype.h. */
+
+ #ifdef __cplusplus
+ #ifdef INCLUDE_STRING
+ # include <string>
+ #endif
++#ifdef INCLUDE_MAP
++# include <map>
++#endif
++#ifdef INCLUDE_VECTOR
++# include <vector>
++#endif
++#ifdef INCLUDE_MEMORY
++# include <memory>
++#endif
+ #endif
+
+ /* There are an extraordinary number of issues with <ctype.h>.
Home |
Main Index |
Thread Index |
Old Index