Remove gcc headers from clang search path due to limits.h conflict 41/324341/1
authorVadim Solomin <v.solomin@partner.samsung.com>
Tue, 13 May 2025 17:18:36 +0000 (20:18 +0300)
committerVadim Solomin <v.solomin@partner.samsung.com>
Thu, 15 May 2025 13:05:27 +0000 (16:05 +0300)
gcc headers were added to clang's include search path long ago
apparently to provide libstdc++'s headers. But that change also addded
C headers from gcc's runtime in addition to c++ headers, leading to
conflicts between gcc's and clang's headers. As clang automatically
includes libstdc++ headers to its search path, reverting the
change.

Change-Id: Ibca301c922d549bdf9070574e0fe35c6ed7bfbf7

packaging/llvm.spec

index daae0f0e00ee748b75b83980435e581878557438..75556151331542440383d3d749132f2aee5fdce9 100644 (file)
@@ -174,12 +174,6 @@ export FFLAGS=${RELFFLAGS}
 cp %{SOURCE1001} .
 %{?asan:%gcc_unforce_options}
 
-%ifarch armv7l armv7hl aarch64
-CPP_INCLUDE_PATHS=$(cpp -xc++ -v < /dev/null 2>&1 | \
-        awk '/search starts here:/{flag=1;next}/End of search list/{flag=0}flag' | \
-        sed -e "s/^ //" | tr '\n' ':' | sed -e 's/.$//')
-%endif
-
 mkdir -p build
 cd build
 cmake \
@@ -204,9 +198,6 @@ cmake \
     -DLLVM_BUILD_DOCS=OFF \
     -DLLVM_INCLUDE_DOCS=OFF \
     -DLLVM_OPTIMIZED_TABLEGEN=ON \
-%ifarch armv7l armv7hl aarch64
-    -DC_INCLUDE_DIRS="${CPP_INCLUDE_PATHS}" \
-%endif
 %ifarch armv7l armv7hl
     -DCMAKE_ASM_FLAGS="-mfpu=neon" \
 %endif