diff --git a/llvm.spec b/llvm.spec index a14aac5..6f3f1d3 100644 --- a/llvm.spec +++ b/llvm.spec @@ -42,12 +42,10 @@ # uploading to ABF... %bcond_with apidox %bcond_without clang -%bcond_without bolt -# flang needs MLIR, MLIR is broken in 13.0.0-rc3 +%bcond_with bolt %bcond_without flang # libc is broken in 13.0.0-rc3 (doesn't compile) %bcond_with libc -# MLIR is broken in 13.0.0-rc3 (doesn't compile) %bcond_without mlir %ifarch armv7hnl riscv64 # RISC-V and armv7 don't have a working ocaml compiler yet @@ -106,11 +104,11 @@ %bcond_with upstream_tarballs -%define major %(echo %{version} |cut -d. -f1-2) +%define major %(echo %{version} |cut -d. -f1-2) %define major1 %(echo %{version} |cut -d. -f1) #define is_main 1 -%bcond_without crosscrt +%bcond_with crosscrt # We set LLVM_VERSION_SUFFIX affects the soname of libraries. If unset, # LLVM_VERSION_SUFFIX is set to "git", resulting in libraries like @@ -260,7 +258,10 @@ BuildRequires: python-sphinx-automodapi BuildRequires: python-setuptools BuildRequires: python-requests %if %{with ocaml} -BuildRequires: ocaml-compiler ocaml-compiler-libs ocaml-camlp4 ocaml-findlib >= 1.5.5-2 ocaml-ctypes +BuildRequires: ocaml-compiler +BuildRequires: ocaml-compiler-libs +BuildRequires: ocaml-camlp4 +BuildRequires: ocaml-findlib >= 1.5.5-2 ocaml-ctypes %endif BuildRequires: tcl BuildRequires: sed @@ -287,7 +288,7 @@ BuildRequires: ninja %if %{with apidox} BuildRequires: doxygen %endif -Obsoletes: llvm-ocaml +Obsoletes: llvm-ocaml < 14.0.0 # Some cmake files try to look up the commit hash BuildRequires: git-core # For lldb @@ -295,11 +296,9 @@ BuildRequires: swig BuildRequires: pkgconfig(python3) BuildRequires: gcc BuildRequires: pkgconfig(libtirpc) -%if %mdvver > 3000000 %if !%{with lld} BuildRequires: lld < %{EVRD} %endif -%endif %if %{with openmp} Requires: %{ompname} = %{EVRD} %endif @@ -329,10 +328,10 @@ BuildRequires: devel(libMesaOpenCL) BuildRequires: libunwind-devel %endif -Obsoletes: %{mklibname LLVMRISCVCodeGen 5} < %{EVRD} -Obsoletes: %{mklibname LLVMRISCVDesc 5} < %{EVRD} -Obsoletes: %{mklibname LLVMRISCVInfo 5} < %{EVRD} -Obsoletes: %{mklibname lldConfig 5} < %{EVRD} +Obsoletes: %{mklibname LLVMRISCVCodeGen 5} < 14.0.0 +Obsoletes: %{mklibname LLVMRISCVDesc 5} < 14.0.0 +Obsoletes: %{mklibname LLVMRISCVInfo 5} < 14.0.0 +Obsoletes: %{mklibname lldConfig 5} < 14.0.0 %if %{with crosscrt} %ifnarch %{aarch64} @@ -480,71 +479,41 @@ for effective implementation, proper tail calls or garbage collection. %doc %{_mandir}/man1/FileCheck.1* %doc %{_mandir}/man1/bugpoint.1* - %doc %{_mandir}/man1/dsymutil.1* %doc %{_mandir}/man1/lit.1* %doc %{_mandir}/man1/llc.1* %doc %{_mandir}/man1/lli.1* %doc %{_mandir}/man1/llvm-*.1* %doc %{_mandir}/man1/opt.1* - %doc %{_mandir}/man1/tblgen.1* -%doc %{_mandir}/man1/mlir-tblgen.1* - #----------------------------------------------------------- -%define LLVMLibs LLVMAArch64AsmParser LLVMAArch64CodeGen LLVMAArch64Desc LLVMAArch64Disassembler LLVMAArch64Info LLVMAArch64Utils LLVMAggressiveInstCombine LLVMARMAsmParser LLVMARMCodeGen LLVMARMDesc LLVMARMDisassembler LLVMARMInfo LLVMARMUtils LLVMAnalysis LLVMAsmParser LLVMAsmPrinter LLVMBPFAsmParser LLVMBitReader LLVMBitstreamReader LLVMBitWriter LLVMBPFCodeGen LLVMBPFDesc LLVMBPFDisassembler LLVMBPFInfo LLVMBinaryFormat LLVMCodeGen LLVMCore LLVMDebugInfoCodeView LLVMCoroutines LLVMDebugInfoDWARF LLVMDebugInfoMSF LLVMDebugInfoPDB LLVMDemangle LLVMDlltoolDriver LLVMExecutionEngine LLVMFuzzMutate LLVMHexagonAsmParser LLVMHexagonCodeGen LLVMHexagonDesc LLVMHexagonDisassembler LLVMHexagonInfo LLVMIRReader LLVMInstCombine LLVMInstrumentation LLVMInterpreter LLVMLanaiAsmParser LLVMLanaiCodeGen LLVMLanaiDesc LLVMLanaiDisassembler LLVMLanaiInfo LLVMLTO LLVMLibDriver LLVMLineEditor LLVMLinker LLVMMC LLVMMCDisassembler LLVMMCJIT LLVMMCParser LLVMMIRParser LLVMMSP430CodeGen LLVMMSP430Desc LLVMMSP430Info LLVMMipsAsmParser LLVMMipsCodeGen LLVMMipsDesc LLVMMipsDisassembler LLVMMipsInfo LLVMNVPTXCodeGen LLVMNVPTXDesc LLVMNVPTXInfo LLVMObjCARCOpts LLVMObject LLVMOption LLVMOrcJIT LLVMPasses LLVMPowerPCAsmParser LLVMPowerPCCodeGen LLVMPowerPCDesc LLVMPowerPCDisassembler LLVMPowerPCInfo LLVMProfileData LLVMAMDGPUAsmParser LLVMAMDGPUCodeGen LLVMAMDGPUDesc LLVMAMDGPUDisassembler LLVMAMDGPUInfo LLVMAMDGPUUtils LLVMRuntimeDyld LLVMScalarOpts LLVMSelectionDAG LLVMSparcAsmParser LLVMSparcCodeGen LLVMSparcDesc LLVMSparcDisassembler LLVMSparcInfo LLVMSupport LLVMSymbolize LLVMSystemZAsmParser LLVMSystemZCodeGen LLVMSystemZDesc LLVMSystemZDisassembler LLVMSystemZInfo LLVMTableGen LLVMTarget LLVMTransformUtils LLVMVectorize LLVMWindowsManifest LLVMX86AsmParser LLVMX86CodeGen LLVMX86Desc LLVMX86Disassembler LLVMX86Info LLVMXCoreCodeGen LLVMXCoreDesc LLVMXCoreDisassembler LLVMXCoreInfo LLVMXRay LLVMipo LLVMCoverage LLVMGlobalISel LLVMObjectYAML LLVMMCA LLVMMSP430AsmParser LLVMMSP430Disassembler LLVMRemarks LLVMTextAPI LLVMWebAssemblyAsmParser LLVMWebAssemblyCodeGen LLVMWebAssemblyDesc LLVMWebAssemblyDisassembler LLVMWebAssemblyInfo Remarks LLVMRISCVAsmParser LLVMRISCVCodeGen LLVMRISCVDesc LLVMRISCVDisassembler LLVMRISCVInfo LLVMDebugInfoGSYM LLVMJITLink LLVMCFGuard LLVMDWARFLinker LLVMFrontendOpenMP LLVMAVRAsmParser LLVMAVRCodeGen LLVMAVRDesc LLVMAVRDisassembler LLVMAVRInfo LLVMExtensions LLVMFrontendOpenACC LLVMFileCheck LLVMInterfaceStub LLVMOrcShared LLVMOrcTargetProcess Polly LLVMCFIVerify LLVMDWP LLVMExegesis LLVMExegesisAArch64 LLVMExegesisMips LLVMExegesisPowerPC LLVMExegesisX86 LLVMTableGenGlobalISel LLVMWebAssemblyUtils LLVMSPIRVLib LLVMAMDGPUTargetMCA LLVMDebuginfod LLVMDiff LLVMVEAsmParser LLVMVECodeGen LLVMVEDesc LLVMVEDisassembler LLVMVEInfo LLVMX86TargetMCA -# Removed in 14: LLVMMCACustomBehaviourAMDGPU - -%define LLVM64Libs findAllSymbols -%define ClangLibs LTO clang clang-cpp clangAnalysisFlowSensitive clangAnalysis clangAPINotes clangARCMigrate clangASTMatchers clangAST clangBasic clangCodeGen clangCrossTU clangDependencyScanning clangDirectoryWatcher clangDriver clangDynamicASTMatchers clangEdit clangFormat clangFrontend clangFrontendTool clangHandleCXX clangHandleLLVM clangIndexSerialization clangIndex clangInterpreter clangLex clangParse clangRewriteFrontend clangRewrite clangSema clangSerialization clangStaticAnalyzerCheckers clangStaticAnalyzerCore clangStaticAnalyzerFrontend clangTesting clangToolingASTDiff clangToolingCore clangToolingInclusions clangToolingRefactoring clangTooling clangToolingSyntax clangTransformer -%define Clang64Libs clangApplyReplacements clangChangeNamespace clangDaemon clangDaemonTweaks clangDoc clangIncludeFixer clangIncludeFixerPlugin clangMove clangQuery clangReorderFields clangTidy clangTidyPlugin clangTidyAbseilModule clangTidyAlteraModule clangTidyAndroidModule clangTidyBoostModule clangTidyBugproneModule clangTidyCERTModule clangTidyCppCoreGuidelinesModule clangTidyConcurrencyModule clangTidyDarwinModule clangTidyFuchsiaModule clangTidyGoogleModule clangTidyHICPPModule clangTidyLLVMModule clangTidyLinuxKernelModule clangTidyMiscModule clangTidyModernizeModule clangTidyMPIModule clangTidyObjCModule clangTidyOpenMPModule clangTidyPortabilityModule clangTidyReadabilityModule clangTidyPerformanceModule clangTidyZirconModule clangTidyUtils clangTidyLLVMLibcModule clangTidyMain clangdRemoteIndex clangdSupport - -%define FlangLibs FIRBuilder FIRCodeGen FIRDialect FIRSupport FIRTransforms FortranCommon FortranDecimal FortranEvaluate FortranLower FortranParser FortranRuntime FortranSemantics flangFrontend flangFrontendTool -# Removed in 14: FIROptimizer +%define ClangLibs LTO clang clang-cpp +%define oldClangLibs clangAnalysisFlowSensitive clangAnalysis clangAPINotes clangARCMigrate clangASTMatchers clangAST clangBasic clangCodeGen clangCrossTU clangDependencyScanning clangDirectoryWatcher clangDriver clangDynamicASTMatchers clangEdit clangFormat clangFrontend clangFrontendTool clangHandleCXX clangHandleLLVM clangIndexSerialization clangIndex clangInterpreter clangLex clangParse clangRewriteFrontend clangRewrite clangSema clangSerialization clangStaticAnalyzerCheckers clangStaticAnalyzerCore clangStaticAnalyzerFrontend clangTesting clangToolingASTDiff clangToolingCore clangToolingInclusions clangToolingRefactoring clangTooling clangToolingSyntax clangTransformer clangApplyReplacements clangChangeNamespace clangDaemon clangDaemonTweaks clangDoc clangIncludeFixer clangIncludeFixerPlugin clangMove clangQuery clangReorderFields clangTidy clangTidyPlugin clangTidyAbseilModule clangTidyAlteraModule clangTidyAndroidModule clangTidyBoostModule clangTidyBugproneModule clangTidyCERTModule clangTidyCppCoreGuidelinesModule clangTidyConcurrencyModule clangTidyDarwinModule clangTidyFuchsiaModule clangTidyGoogleModule clangTidyHICPPModule clangTidyLLVMModule clangTidyLinuxKernelModule clangTidyMiscModule clangTidyModernizeModule clangTidyMPIModule clangTidyObjCModule clangTidyOpenMPModule clangTidyPortabilityModule clangTidyReadabilityModule clangTidyPerformanceModule clangTidyZirconModule clangTidyUtils clangTidyLLVMLibcModule clangTidyMain clangdRemoteIndex clangdSupport %define BOLTLibs Core Passes Profile Rewrite RuntimeLibs TargetAArch64 TargetX86 Utils -%if %{with mlir} -%define MLIRLibs MLIRAffineAnalysis MLIRAffineBufferizableOpInterfaceImpl MLIRAffine MLIRAffineToStandard MLIRAffineTransforms MLIRAffineTransformsTestPasses MLIRAffineUtils MLIRAMX MLIRAMXToLLVMIRTranslation MLIRAMXTransforms MLIRAnalysis MLIRArithmetic MLIRArithmeticToLLVM MLIRArithmeticToSPIRV MLIRArithmeticTransforms MLIRArmNeon2dToIntr MLIRArmNeon MLIRArmNeonToLLVMIRTranslation MLIRArmSVE MLIRArmSVEToLLVMIRTranslation MLIRArmSVETransforms MLIRAsync MLIRAsyncToLLVM MLIRAsyncTransforms MLIRBufferization MLIRBufferizationToMemRef MLIRBufferizationTransforms MLIRCallInterfaces MLIRCAPIAsync MLIRCAPIConversion MLIRCAPIDebug MLIRCAPIExecutionEngine MLIRCAPIGPU MLIRCAPIInterfaces MLIRCAPIIR MLIRCAPILinalg MLIRCAPILLVM MLIRCAPIPDL MLIRCAPIQuant MLIRCAPIRegistration MLIRCAPISCF MLIRCAPIShape MLIRCAPISparseTensor MLIRCAPIStandard MLIRCAPITensor MLIRCAPITransforms MLIRCastInterfaces MLIRComplex MLIRComplexToLLVM MLIRComplexToStandard MLIRControlFlowInterfaces MLIRCopyOpInterface MLIRDataLayoutInterfaces MLIRDerivedAttributeOpInterface MLIRDialect MLIRDialectUtils MLIRDLTI MLIRDLTITestPasses MLIREmitC MLIRExecutionEngine MLIRGPUOps MLIRGPUTestPasses MLIRGPUToGPURuntimeTransforms MLIRGPUToNVVMTransforms MLIRGPUToROCDLTransforms MLIRGPUToSPIRV MLIRGPUToVulkanTransforms MLIRGPUTransforms MLIRInferTypeOpInterface MLIRIR MLIRJitRunner MLIRLinalgAnalysis MLIRLinalgBufferizableOpInterfaceImpl MLIRLinalg MLIRLinalgTestPasses MLIRLinalgToLLVM MLIRLinalgToSPIRV MLIRLinalgToStandard MLIRLinalgTransforms MLIRLinalgUtils MLIRLLVMCommonConversion MLIRLLVMIR MLIRLLVMIRTransforms MLIRLLVMToLLVMIRTranslation MLIRLoopLikeInterface MLIRLspServerLib MLIRMath MLIRMathTestPasses MLIRMathToLibm MLIRMathToLLVM MLIRMathToSPIRV MLIRMathTransforms MLIRMemRef MLIRMemRefToLLVM MLIRMemRefToSPIRV MLIRMemRefTransforms MLIRMemRefUtils MLIRMlirOptMain MLIRNVVMIR MLIRNVVMToLLVMIRTranslation MLIROpenACC MLIROpenACCToLLVMIRTranslation MLIROpenACCToLLVM MLIROpenACCToSCF MLIROpenMP MLIROpenMPToLLVMIRTranslation MLIROpenMPToLLVM MLIROptLib MLIRParser MLIRPass MLIRPDLInterp MLIRPDLLAST MLIRPDLLParser MLIRPDL MLIRPDLToPDLInterp MLIRPresburger MLIRQuant MLIRReconcileUnrealizedCasts MLIRReduceLib MLIRReduce MLIRRewrite MLIRROCDLIR MLIRROCDLToLLVMIRTranslation MLIRSCF MLIRSCFTestPasses MLIRSCFToGPU MLIRSCFToOpenMP MLIRSCFToSPIRV MLIRSCFToStandard MLIRSCFTransforms MLIRShapeOpsTransforms MLIRShape MLIRShapeTestPasses MLIRShapeToStandard MLIRSideEffectInterfaces MLIRSparseTensor MLIRSparseTensorTransforms MLIRSparseTensorUtils MLIRSPIRVBinaryUtils MLIRSPIRVConversion MLIRSPIRVDeserialization MLIRSPIRVModuleCombiner MLIRSPIRVSerialization MLIRSPIRV MLIRSPIRVTestPasses MLIRSPIRVToLLVM MLIRSPIRVTransforms MLIRSPIRVTranslateRegistration MLIRSPIRVUtils MLIRStandardOpsTestPasses MLIRStandardOpsTransforms MLIRStandard MLIRStandardToLLVM MLIRStandardToSPIRV MLIRSupportIndentedOstream MLIRSupport MLIRTargetCpp MLIRTargetLLVMIRExport MLIRTargetLLVMIRImport MLIRTensorInferTypeOpInterfaceImpl MLIRTensor MLIRTensorTransforms MLIRTestAnalysis MLIRTestDialect MLIRTestIR MLIRTestPass MLIRTestReducer MLIRTestRewrite MLIRTestStandardToLLVM MLIRTestTransforms MLIRTilingInterface MLIRToLLVMIRTranslationRegistration MLIRTosa MLIRTosaTestPasses MLIRTosaToLinalg MLIRTosaToSCF MLIRTosaToStandard MLIRTosaTransforms MLIRTransforms MLIRTransformUtils MLIRTranslation MLIRVectorInterfaces MLIRVector MLIRVectorTestPasses MLIRVectorToGPU MLIRVectorToLLVM MLIRVectorToROCDL MLIRVectorToSCF MLIRVectorToSPIRV MLIRViewLikeInterface MLIRX86Vector MLIRX86VectorToLLVMIRTranslation MLIRX86VectorTransforms mlir_async_runtime mlir_c_runner_utils mlir_runner_utils MLIRModuleBufferization MLIRTensorTilingInterfaceImpl MLIRTensorUtils MLIRMemRefTestPasses MLIRSCFUtils MLIRSparseTensorPipelines MLIRVectorTransforms MLIRVectorUtils - -# Removed in 14: MLIRLoopAnalysis -%else -%define MLIRLibs %{nil} -%endif - -%if %{with lld} -%define LLDLibs lldCOFF lldCommon lldELF lldMachO lldMinGW lldWasm -%else -%define LLDLibs %{nil} -%endif -# Removed as of 14: lldCore lldDriver lldMachO2 lldReaderWriter lldYAML - %if %{with lldb} %define LLDBLibs lldb lldbIntelFeatures %else %define LLDBLibs %{nil} %endif -%{expand:%(for i in %{LLVMLibs} %{LLVM64Libs} %{ClangLibs} %{Clang64Libs} %{LLDLibs} %{LLDBLibs} %{MLIRLibs}; do echo %%libpackage $i %{major1}; [ "$i" = "clang" ] && echo "%{_libdir}/libclang.so.13"; done)} - -%if %{with flang} -%{expand:%(for i in %{FlangLibs}; do echo %%libpackage $i %{major1}; done)} -%endif +%{expand:%(for i in %{ClangLibs} %{LLDBLibs}; do echo %%libpackage $i %{major1}; [ "$i" = "clang" ] && echo "%{_libdir}/libclang.so.13"; done)} %if %{with bolt} %{expand:%(for i in %{BOLTLibs}; do echo %%libpackage LLVMBOLT$i %{major1}; done)} %endif %if %{with compat32} -%{expand:%(for i in %{LLVMLibs} %{ClangLibs}; do cat <bolt/docs/conf.py - sed -e 's,^/// ,,' bolt/docs/doxygen-mainpage.dox >bolt/docs/index.rst + sed -i -e 's,clang,bolt,g;s,Clang,Bolt,g' clang/docs/conf.py >bolt/docs/conf.py + sed -e 's,^/// ,,' bolt/docs/doxygen-mainpage.dox >bolt/docs/index.rst fi %endif %if %{with clang} -COMPONENTS="$COMPONENTS;clang;clang-tools-extra;polly;compiler-rt" +PROJECTS="$PROJECTS;clang;clang-tools-extra;polly;compiler-rt" %endif %if %{with mlir} -COMPONENTS="$COMPONENTS;mlir" +PROJECTS="$PROJECTS;mlir" %endif %if %{with flang} -COMPONENTS="$COMPONENTS;flang" +PROJECTS="$PROJECTS;flang" %endif %if %{with unwind} -COMPONENTS="$COMPONENTS;libunwind" +RUNTIMES="$RUNTIMES;libunwind" %endif %if %{with lldb} -COMPONENTS="$COMPONENTS;lldb" +PROJECTS="$PROJECTS;lldb" %endif %if %{with lld} -COMPONENTS="$COMPONENTS;lld" +PROJECTS="$PROJECTS;lld" %endif %if %{with openmp} -COMPONENTS="$COMPONENTS;openmp" +RUNTIMES="$RUNTIMES;openmp" %endif %if %{with libcxx} -COMPONENTS="$COMPONENTS;libcxx;libcxxabi;pstl" +PROJECTS="$PROJECTS;pstl" +RUNTIMES="$RUNTIMES;libcxx;libcxxabi" %endif %if %{with libc} -COMPONENTS="$COMPONENTS;libc" +PROJECTS="$PROJECTS;libc" +RUNTIMES="$RUNTIMES;libc" %endif -COMPONENTS="$COMPONENTS;libclc" +PROJECTS="$PROJECTS;libclc" %if %{with bootstrap_gcc} export CC=gcc @@ -1765,15 +1795,29 @@ done # at some point - but right now, builds are broken # %cmake \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ +%ifarch %{armx} %{riscv} + -DLLVM_PARALLEL_LINK_JOBS=1 \ + -DLLVM_PARALLEL_COMPILE_JOBS=1 \ +%else + -DLLVM_PARALLEL_LINK_JOBS=2 \ + -DLLVM_PARALLEL_COMPILE_JOBS=2 \ +%endif -DLLVM_VERSION_SUFFIX="%{SOMINOR}" \ - -DLLVM_ENABLE_PROJECTS="$COMPONENTS" \ + -DLLVM_ENABLE_PROJECTS="$PROJECTS" \ + -DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \ -DCLANG_VENDOR="OpenMandriva %{version}-%{release}" \ -DLLD_VENDOR="OpenMandriva %{version}-%{release}" \ - -DBUILD_SHARED_LIBS:BOOL=ON \ - -DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER:BOOL=ON \ + -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \ + -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ + -DLLVM_DYLIB_COMPONENTS=all \ + -DCLANG_LINK_CLANG_DYLIB:BOOL=ON \ + -DLLVM_ENABLE_NEW_PASS_MANAGER:BOOL=ON \ -DENABLE_X86_RELAX_RELOCATIONS:BOOL=ON \ -DCLANG_DEFAULT_LINKER=lld \ -DCLANG_DEFAULT_OBJCOPY=llvm-objcopy \ + -DCLANG_PLUGIN_SUPPORT:BOOL=ON \ %if %{with default_compilerrt} -DCLANG_DEFAULT_RTLIB=compiler-rt \ -DCOMPILER_RT_USE_BUILTINS_LIBRARY:BOOL=ON \ @@ -1805,11 +1849,12 @@ done -DOCAMLFIND=NOTFOUND \ -DLLVM_LIBDIR_SUFFIX=$(echo %{_lib} |sed -e 's,^lib,,') \ -DCLANG_LIBDIR_SUFFIX=$(echo %{_lib} |sed -e 's,^lib,,') \ - -DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \ + -DLLVM_OPTIMIZED_TABLEGEN:BOOL=OFF \ %ifarch %{arm} -DLLVM_DEFAULT_TARGET_TRIPLE=%{product_arch}-%{_vendor}-%{_os}%{_gnu} \ %endif -DPOLLY_ENABLE_GPGPU_CODEGEN:BOOL=ON \ + -DPOLLY_BUNDLED_ISL:BOOL=ON \ -DWITH_POLLY:BOOL=ON \ -DLINK_POLLY_INTO_TOOLS:BOOL=ON \ %if %{with use_libcxx} @@ -1845,20 +1890,21 @@ done %else -DCLANG_DEFAULT_UNWINDLIB=libgcc \ %endif + -DLIBUNWIND_TARGET_TRIPLE=%{_target_platform} \ -G Ninja \ ../llvm if ! %ninja_build; then - # With many threads, there's a chance of libc++ being built - # before libc++abi, causing linkage to fail. Simply trying - # again "fixes" it. - # flang also seems to have SMP build issues - for i in `seq 1 30`; do - if %ninja_build; then - break - fi - done - %ninja_build -j1 +# With many threads, there's a chance of libc++ being built +# before libc++abi, causing linkage to fail. Simply trying +# again "fixes" it. +# flang also seems to have SMP build issues + for i in $(seq 1 30); do + if %ninja_build; then + break + fi + done + %ninja_build -j1 fi cd .. @@ -1894,11 +1940,17 @@ EOF %if %{with compat32} %cmake32 \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ -DLLVM_VERSION_SUFFIX="%{SOMINOR}" \ -DCMAKE_TOOLCHAIN_FILE="${TOP}/cmake-i686.toolchain" \ -DLLVM_CONFIG_PATH=$(pwd)/../build/bin/llvm-config \ - -DLLVM_ENABLE_PROJECTS="llvm;clang;libunwind;compiler-rt;openmp;polly" \ - -DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER:BOOL=ON \ + -DLLVM_ENABLE_PROJECTS="llvm;clang;polly" \ + -DLLVM_ENABLE_RUNTIMES="compiler-rt;libc;libunwind;openmp" \ + -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \ + -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ + -DLLVM_DYLIB_COMPONENTS=all \ + -DCLANG_LINK_CLANG_DYLIB:BOOL=ON \ + -DLLVM_ENABLE_NEW_PASS_MANAGER:BOOL=ON \ -DENABLE_X86_RELAX_RELOCATIONS:BOOL=ON \ %if %{with default_compilerrt} -DCLANG_DEFAULT_RTLIB=compiler-rt \ @@ -1908,7 +1960,7 @@ EOF %else -DCLANG_DEFAULT_RTLIB=libgcc \ %endif - -DBUILD_SHARED_LIBS:BOOL=ON \ + -DLLVM_BUILD_LLVM_DYLIB=ON \ -DLLVM_ENABLE_FFI:BOOL=ON \ -DLLVM_TARGETS_TO_BUILD=all \ -DLLVM_ENABLE_CXX1Y:BOOL=ON \ @@ -1926,9 +1978,10 @@ EOF -DCOMPILER_RT_BUILD_CRT:BOOL=ON \ -DENABLE_LINKER_BUILD_ID:BOOL=ON \ -DOCAMLFIND=NOTFOUND \ - -DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \ + -DLLVM_OPTIMIZED_TABLEGEN:BOOL=OFF \ -DLLVM_DEFAULT_TARGET_TRIPLE=i686-%{_vendor}-%{_os}%{_gnu} \ -DPOLLY_ENABLE_GPGPU_CODEGEN:BOOL=ON \ + -DPOLLY_BUNDLED_ISL:BOOL=OFF \ -DWITH_POLLY:BOOL=ON \ -DLINK_POLLY_INTO_TOOLS:BOOL=ON \ %if %{with use_libcxx} @@ -2025,59 +2078,58 @@ XCRTARCHES="$XCRTARCHES ppc64" XCRTARCHES="$XCRTARCHES ppc64le" %endif if [ -n "$XCRTARCHES" ]; then - for arch in $XCRTARCHES; do - if [ "$arch" = "armv7hnl" ]; then - LIBC=gnueabihf - else - LIBC=gnu - fi - mkdir xbuild-crt-${arch} - cd xbuild-crt-${arch} - gccver="$(${arch}-openmandriva-linux-${LIBC}-gcc --version |head -n1 |cut -d' ' -f3)" - LFLAGS="-O3 --sysroot=/usr/${arch}-openmandriva-linux-${LIBC} --gcc-toolchain=%{_prefix}" - FLAGS="$LFLAGS -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64" - if echo $arch |grep -q riscv; then - # Workaround of lack of linker relaxation support in lld - LFLAGS="$LFLAGS -fuse-ld=bfd" - fi - cmake \ - ../compiler-rt \ - -G Ninja \ - -DLLVM_VERSION_SUFFIX="%{SOMINOR}" \ - -DCMAKE_CROSSCOMPILING:BOOL=ON \ - -DCMAKE_INSTALL_PREFIX=%{_libdir}/clang/%{version} \ - -DCMAKE_AR=${BINDIR}/llvm-ar \ - -DCMAKE_NM=${BINDIR}/llvm-nm \ - -DCMAKE_RANLIB=${BINDIR}/llvm-ranlib \ + for arch in $XCRTARCHES; do + if [ "$arch" = "armv7hnl" ]; then + LIBC=gnueabihf + else + LIBC=gnu + fi + mkdir xbuild-crt-${arch} + cd xbuild-crt-${arch} + gccver="$(${arch}-openmandriva-linux-${LIBC}-gcc --version |head -n1 |cut -d' ' -f3)" + LFLAGS="-O3 --sysroot=/usr/${arch}-openmandriva-linux-${LIBC} --gcc-toolchain=%{_prefix}" + FLAGS="$LFLAGS -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64" + if echo $arch |grep -q riscv; then +# Workaround of lack of linker relaxation support in lld + LFLAGS="$LFLAGS -fuse-ld=bfd" + fi + cmake \ + ../compiler-rt \ + -G Ninja \ + -DLLVM_VERSION_SUFFIX="%{SOMINOR}" \ + -DCMAKE_CROSSCOMPILING:BOOL=ON \ + -DCMAKE_INSTALL_PREFIX=%{_libdir}/clang/%{version} \ + -DCMAKE_AR=${BINDIR}/llvm-ar \ + -DCMAKE_NM=${BINDIR}/llvm-nm \ + -DCMAKE_RANLIB=${BINDIR}/llvm-ranlib \ %if 0 - -DLLVM_CONFIG_PATH=${BINDIR}/llvm-config \ -%endif - -DCMAKE_ASM_COMPILER_TARGET=${arch}-openmandriva-linux-${LIBC} \ - -DCMAKE_C_COMPILER_TARGET=${arch}-openmandriva-linux-${LIBC} \ - -DCMAKE_CXX_COMPILER_TARGET=${arch}-openmandriva-linux-${LIBC} \ - -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=${arch}-openmandriva-linux-${LIBC} \ - -DCMAKE_C_COMPILER=${BINDIR}/clang \ - -DCMAKE_CXX_COMPILER=${BINDIR}/clang++ \ - -DCMAKE_ASM_FLAGS="$FLAGS" \ - -DCMAKE_C_FLAGS="$FLAGS" \ - -DCMAKE_CXX_FLAGS="$FLAGS -isystem %{_prefix}/${arch}-openmandriva-linux-${LIBC}/include/c++/${gccver}/${arch}-openmandriva-linux-${LIBC}" \ - -DCMAKE_EXE_LINKER_FLAGS="$LFLAGS" \ - -DCMAKE_MODULE_LINKER_FLAGS="$LFLAGS" \ - -DCMAKE_SHARED_LINKER_FLAGS="$LFLAGS" \ - -DCOMPILER_RT_BUILD_BUILTINS:BOOL=ON \ - -DCOMPILER_RT_BUILD_SANITIZERS:BOOL=OFF \ - -DCOMPILER_RT_BUILD_LIBFUZZER:BOOL=OFF \ - -DCOMPILER_RT_BUILD_MEMPROF:BOOL=OFF \ - -DCOMPILER_RT_BUILD_PROFILE:BOOL=OFF \ - -DCOMPILER_RT_BUILD_XRAY:BOOL=OFF \ - -DCOMPILER_RT_DEFAULT_TARGET_ONLY:BOOL=OFF - %ninja_build - cd .. - done + -DLLVM_CONFIG_PATH=${BINDIR}/llvm-config \ +%endif + -DCMAKE_ASM_COMPILER_TARGET=${arch}-openmandriva-linux-${LIBC} \ + -DCMAKE_C_COMPILER_TARGET=${arch}-openmandriva-linux-${LIBC} \ + -DCMAKE_CXX_COMPILER_TARGET=${arch}-openmandriva-linux-${LIBC} \ + -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=${arch}-openmandriva-linux-${LIBC} \ + -DCMAKE_C_COMPILER=${BINDIR}/clang \ + -DCMAKE_CXX_COMPILER=${BINDIR}/clang++ \ + -DCMAKE_ASM_FLAGS="$FLAGS" \ + -DCMAKE_C_FLAGS="$FLAGS" \ + -DCMAKE_CXX_FLAGS="$FLAGS -isystem %{_prefix}/${arch}-openmandriva-linux-${LIBC}/include/c++/${gccver}/${arch}-openmandriva-linux-${LIBC}" \ + -DCMAKE_EXE_LINKER_FLAGS="$LFLAGS" \ + -DCMAKE_MODULE_LINKER_FLAGS="$LFLAGS" \ + -DCMAKE_SHARED_LINKER_FLAGS="$LFLAGS" \ + -DCOMPILER_RT_BUILD_BUILTINS:BOOL=ON \ + -DCOMPILER_RT_BUILD_SANITIZERS:BOOL=OFF \ + -DCOMPILER_RT_BUILD_LIBFUZZER:BOOL=OFF \ + -DCOMPILER_RT_BUILD_MEMPROF:BOOL=OFF \ + -DCOMPILER_RT_BUILD_PROFILE:BOOL=OFF \ + -DCOMPILER_RT_BUILD_XRAY:BOOL=OFF \ + -DCOMPILER_RT_DEFAULT_TARGET_ONLY:BOOL=OFF + %ninja_build + cd .. + done fi %endif - %install %if %{with ocaml} #cp bindings/ocaml/llvm/META.llvm bindings/ocaml/llvm/Release/ @@ -2088,9 +2140,9 @@ fi # Get rid of compat32 stuff that isn't needed in a 64-bit # environment rm -rf \ - %{buildroot}%{_prefix}/lib/LLVMgold.so \ - %{buildroot}%{_prefix}/lib/clang \ - %{buildroot}%{_bindir} + %{buildroot}%{_prefix}/lib/LLVMgold.so \ + %{buildroot}%{_prefix}/lib/clang \ + %{buildroot}%{_bindir} %endif %ninja_install -C build @@ -2144,11 +2196,11 @@ cat >%{buildroot}%{_bindir}/c89 <<'EOF' fl="-std=c89" for opt; do - case "$opt" in - -ansi|-std=c89|-std=iso9899:1990) fl="";; - -std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2 - exit 1;; - esac + case "$opt" in + -ansi|-std=c89|-std=iso9899:1990) fl="";; + -std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2 + exit 1;; + esac done exec %{_bindir}/clang $fl ${1+"$@"} EOF @@ -2157,11 +2209,11 @@ cat >%{buildroot}%{_bindir}/c99 <<'EOF' fl="-std=c99" for opt; do - case "$opt" in - -std=c99|-std=iso9899:1999) fl="";; - -std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2 - exit 1;; - esac + case "$opt" in + -std=c99|-std=iso9899:1999) fl="";; + -std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2 + exit 1;; + esac done exec %{_bindir}/clang $fl ${1+"$@"} EOF