[clang] Revert "[Driver][Haiku] Add /boot/system/develop/headers/gcc/include header path (#140189)" (PR #245206)

Brad Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 03:57:45 PST 2026


https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/245206

This reverts commit a23d18726d32172f855d451375df2816b815c191.

/boot/system/develop/headers/gcc/include is GCC's internal header
directory. Clang has its own copies of these headers in its resource
directory and should not search GCC's. With this path, include_next in
Clang's stdatomic.h picks up GCC's stdatomic.h, which breaks C11 atomics.

https://github.com/haikuports/haikuports/issues/15124

>From e232f2b3793bdbe4cbf7c895f7fecfab079a777b Mon Sep 17 00:00:00 2001
From: Brad Smith <brad at comstyle.com>
Date: Mon, 23 Nov 2026 06:56:00 -0500
Subject: [PATCH] Revert "[Driver][Haiku] Add
 /boot/system/develop/headers/gcc/include header path (#140189)"

This reverts commit a23d18726d32172f855d451375df2816b815c191.

/boot/system/develop/headers/gcc/include is GCC's internal header
directory. Clang has its own copies of these headers in its resource
directory and should not search GCC's. With this path, include_next in
Clang's stdatomic.h picks up GCC's stdatomic.h, which breaks C11 atomics.

https://github.com/haikuports/haikuports/issues/15124

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
---
 clang/lib/Driver/ToolChains/Haiku.cpp | 2 --
 clang/test/Driver/haiku.c             | 1 -
 2 files changed, 3 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Haiku.cpp b/clang/lib/Driver/ToolChains/Haiku.cpp
index 36b07f888cc66c..605fd793e765a1 100644
--- a/clang/lib/Driver/ToolChains/Haiku.cpp
+++ b/clang/lib/Driver/ToolChains/Haiku.cpp
@@ -262,8 +262,6 @@ void Haiku::AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
                    "/boot/system/develop/headers/gnu"));
   addSystemInclude(DriverArgs, CC1Args, concat(D.SysRoot,
                    "/boot/system/develop/headers/posix"));
-  addSystemInclude(DriverArgs, CC1Args, concat(D.SysRoot,
-                   "/boot/system/develop/headers/gcc/include"));
   addSystemInclude(DriverArgs, CC1Args, concat(D.SysRoot,
                    "/boot/system/develop/headers"));
 }
diff --git a/clang/test/Driver/haiku.c b/clang/test/Driver/haiku.c
index 8316ae83bd0f06..3d2529942ee65f 100644
--- a/clang/test/Driver/haiku.c
+++ b/clang/test/Driver/haiku.c
@@ -35,7 +35,6 @@
 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/glibc"
 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/gnu"
 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/posix"
-// CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/gcc/include"
 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers"
 
 // Check x86_64-unknown-haiku, X86_64



More information about the cfe-commits mailing list