Skip to content

Commit

Permalink
clc: Build with preprocessor conformance mode when linking with clang…
Browse files Browse the repository at this point in the history
…>=18

workaround llvm/llvm-project#86028
  • Loading branch information
pal1000 committed Mar 26, 2024
1 parent 2c38938 commit 05567cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion buildscript/modules/mesa3d.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@

@IF %toolchain%==msvc set buildconf=%buildconf% --prefix="%devroot:\=/%/%projectname%" -Db_vscrt=mt -Dzlib:default_library=static
@IF %toolchain%==msvc IF %intmesaver% GEQ 21200 IF %intmesaver% LSS 22100 set buildconf=%buildconf% -Dcpp_std=vc++latest
@IF %toolchain%==msvc set CFLAGS=

@IF NOT %toolchain%==msvc IF %abi%==aarch64 set CFLAGS=-march^=armv8-a -pipe
@IF NOT %toolchain%==msvc IF NOT %abi%==aarch64 set CFLAGS=-march^=core2 -pipe
Expand Down Expand Up @@ -221,7 +222,7 @@
@echo.
@if /I "%mesaenableasserts%"=="y" set buildconf=%buildconf% -Db_ndebug=false
@if /I NOT "%mesaenableasserts%"=="y" set buildconf=%buildconf% -Db_ndebug=true
@if /I NOT "%mesaenableasserts%"=="y" IF %toolchain%==msvc set CFLAGS=/wd4189
@if /I NOT "%mesaenableasserts%"=="y" IF %toolchain%==msvc set CFLAGS=%CFLAGS% /wd4189

@set linkmingwdynamic=n
@IF NOT %toolchain%==msvc set /p linkmingwdynamic=Link dependencies dynamically for debuggging purposes (y/n):
Expand Down Expand Up @@ -437,6 +438,7 @@
@IF /I "%mclc%"=="y" set PKG_CONFIG_LIBCLC=1
@IF /I "%mclc%"=="y" set PKG_CONFIG_SPV=1
@IF /I "%mclc%"=="y" set buildconf=%buildconf% -Dmicrosoft-clc=%mesonbooltrue%
@IF /I "%mclc%"=="y" IF %toolchain%==msvc IF EXIST "%llvminstloc%\%abi%\lib\clang\" for /f tokens^=1^ delims^=.^ eol^= %%a IN ('dir /B /A:D "%llvminstloc%\%abi%\lib\clang\"') DO @IF %%a GEQ 18 set CFLAGS=%CFLAGS% /Zc^:preprocessor
@IF /I NOT "%mclc%"=="y" IF %intmesaver% GEQ 21000 set buildconf=%buildconf% -Dmicrosoft-clc=%mesonboolfalse%

@rem Build clover
Expand Down Expand Up @@ -501,6 +503,7 @@
@set "PKG_CONFIG_PATH="

@rem Pass additional compiler and linker flags
@if defined CFLAGS IF %toolchain%==msvc set CFLAGS=%CFLAGS:~1%
@if defined CFLAGS set buildconf=%buildconf% -Dc_args="%CFLAGS%" -Dcpp_args="%CFLAGS%"
@if defined LDFLAGS IF NOT %toolchain%==msvc set LDFLAGS=%LDFLAGS:~1%
@if defined LDFLAGS set buildconf=%buildconf% -Dc_link_args="%LDFLAGS%" -Dcpp_link_args="%LDFLAGS%"
Expand Down
6 changes: 4 additions & 2 deletions releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
### Out of tree patching
- Fix clc build unresolved symbols when static linking LLVM+clang 18.
### Documentation
- Document dxil availability in DirectX shader compiler;
- dozen driver depends on dxil;
- openclon12: Document CLON12_WARP_IS_HARDWARE variable.
### Out of tree patching
- Fix clc build unresolved symbols when static linking LLVM+clang 18.
### Build script
- clc: Build with preprocessor conformance mode when linking with clang>=18, workaround llvm/llvm-project#86028.
# 24.0.3
- Updated Mesa3D to [24.0.3](https://gitlab.freedesktop.org/mesa/mesa/-/blob/24.0/docs/relnotes/24.0.3.rst?ref_type=heads&plain=0).
### Build script
Expand Down

0 comments on commit 05567cf

Please sign in to comment.