Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LLVM] Rebuild for riscv64 #10204

Merged
merged 5 commits into from
Jan 7, 2025
Merged

Conversation

Zentrik
Copy link
Contributor

@Zentrik Zentrik commented Jan 5, 2025

No description provided.

@giordano
Copy link
Member

giordano commented Jan 5, 2025

For stdlibs we don't have to change version number

L/LLVM/LLVM_full@19/build_tarballs.jl Outdated Show resolved Hide resolved
L/LLVM/LLVM_full_assert@19/build_tarballs.jl Outdated Show resolved Hide resolved
@giordano giordano changed the title [LLVM] Rebuild for riscv64 but change version number [LLVM] Rebuild for riscv64 Jan 5, 2025
@giordano
Copy link
Member

giordano commented Jan 5, 2025

We went very far with the compilation for riscv64, it failed only at linking libllvm:

[21:02:53] [7117/7965] : && /opt/bin/riscv64-linux-gnu-libgfortran5-cxx11/riscv64-linux-gnu-g++ --sysroot=/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/ -fPIC -fno-gnu-unique -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/workspace/build/./lib  -Wl,--gc-sections  -Wl,-Bsymbolic-functions -shared -Wl,-soname,libLLVM.so.19.1jl -o lib/libLLVM.so.19.1jl tools/llvm-shlib/CMakeFiles/LLVM.dir/libllvm.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/usr/local/lib:"  -Wl,--version-script,/workspace/build/./lib/tools/llvm-shlib/simple_version_script.map  -Wl,--whole-archive  lib/libLLVMDemangle.a  lib/libLLVMSupport.a  lib/libLLVMCore.a  lib/libLLVMFuzzerCLI.a  lib/libLLVMFuzzMutate.a  lib/libLLVMFileCheck.a  lib/libLLVMInterfaceStub.a  lib/libLLVMIRPrinter.a  lib/libLLVMIRReader.a  lib/libLLVMCodeGen.a  lib/libLLVMSelectionDAG.a  lib/libLLVMAsmPrinter.a  lib/libLLVMMIRParser.a  lib/libLLVMGlobalISel.a  lib/libLLVMCodeGenData.a  lib/libLLVMCodeGenTypes.a  lib/libLLVMBinaryFormat.a  lib/libLLVMBitReader.a  lib/libLLVMBitWriter.a  lib/libLLVMBitstreamReader.a  lib/libLLVMDWARFLinker.a  lib/libLLVMDWARFLinkerClassic.a  lib/libLLVMDWARFLinkerParallel.a  lib/libLLVMExtensions.a  lib/libLLVMFrontendDriver.a  lib/libLLVMFrontendHLSL.a  lib/libLLVMFrontendOpenACC.a  lib/libLLVMFrontendOpenMP.a  lib/libLLVMFrontendOffloading.a  lib/libLLVMTransformUtils.a  lib/libLLVMInstrumentation.a  lib/libLLVMAggressiveInstCombine.a  lib/libLLVMInstCombine.a  lib/libLLVMScalarOpts.a  lib/libLLVMipo.a  lib/libLLVMVectorize.a  lib/libLLVMObjCARCOpts.a  lib/libLLVMCoroutines.a  lib/libLLVMCFGuard.a  lib/libLLVMHipStdPar.a  lib/libLLVMLinker.a  lib/libLLVMAnalysis.a  lib/libLLVMLTO.a  lib/libLLVMMC.a  lib/libLLVMMCParser.a  lib/libLLVMMCDisassembler.a  lib/libLLVMMCA.a  lib/libLLVMObjCopy.a  lib/libLLVMObject.a  lib/libLLVMObjectYAML.a  lib/libLLVMOption.a  lib/libLLVMRemarks.a  lib/libLLVMDebugInfoDWARF.a  lib/libLLVMDebugInfoGSYM.a  lib/libLLVMDebugInfoLogicalView.a  lib/libLLVMDebugInfoMSF.a  lib/libLLVMDebugInfoCodeView.a  lib/libLLVMDebugInfoPDB.a  lib/libLLVMSymbolize.a  lib/libLLVMDebugInfoBTF.a  lib/libLLVMDWP.a  lib/libLLVMExecutionEngine.a  lib/libLLVMIntelJITProfiling.a  lib/libLLVMIntelJITEvents.a  lib/libLLVMInterpreter.a  lib/libLLVMJITLink.a  lib/libLLVMMCJIT.a  lib/libLLVMOrcJIT.a  lib/libLLVMOrcDebugging.a  lib/libLLVMOrcShared.a  lib/libLLVMOrcTargetProcess.a  lib/libLLVMRuntimeDyld.a  lib/libLLVMPerfJITEvents.a  lib/libLLVMTarget.a  lib/libLLVMAMDGPUCodeGen.a  lib/libLLVMAMDGPUAsmParser.a  lib/libLLVMAMDGPUDisassembler.a  lib/libLLVMAMDGPUTargetMCA.a  lib/libLLVMAMDGPUDesc.a  lib/libLLVMAMDGPUInfo.a  lib/libLLVMAMDGPUUtils.a  lib/libLLVMNVPTXCodeGen.a  lib/libLLVMNVPTXDesc.a  lib/libLLVMNVPTXInfo.a  lib/libLLVMWebAssemblyCodeGen.a  lib/libLLVMWebAssemblyAsmParser.a  lib/libLLVMWebAssemblyDisassembler.a  lib/libLLVMWebAssemblyDesc.a  lib/libLLVMWebAssemblyInfo.a  lib/libLLVMWebAssemblyUtils.a  lib/libLLVMBPFCodeGen.a  lib/libLLVMBPFAsmParser.a  lib/libLLVMBPFDisassembler.a  lib/libLLVMBPFDesc.a  lib/libLLVMBPFInfo.a  lib/libLLVMAVRCodeGen.a  lib/libLLVMAVRAsmParser.a  lib/libLLVMAVRDisassembler.a  lib/libLLVMAVRDesc.a  lib/libLLVMAVRInfo.a  lib/libLLVMRISCVCodeGen.a  lib/libLLVMRISCVAsmParser.a  lib/libLLVMRISCVDisassembler.a  lib/libLLVMRISCVDesc.a  lib/libLLVMRISCVTargetMCA.a  lib/libLLVMRISCVInfo.a  lib/libLLVMSandboxIR.a  lib/libLLVMAsmParser.a  lib/libLLVMLineEditor.a  lib/libLLVMProfileData.a  lib/libLLVMCoverage.a  lib/libLLVMPasses.a  lib/libLLVMTargetParser.a  lib/libLLVMTextAPI.a  lib/libLLVMTextAPIBinaryReader.a  lib/libLLVMDlltoolDriver.a  lib/libLLVMLibDriver.a  lib/libLLVMXRay.a  lib/libLLVMWindowsDriver.a  lib/libLLVMWindowsManifest.a  -Wl,--no-whole-archive  lib/libLLVMDWARFLinker.a  lib/libLLVMExtensions.a  lib/libLLVMOrcJIT.a  lib/libLLVMJITLink.a  lib/libLLVMWindowsDriver.a  lib/libLLVMExecutionEngine.a  lib/libLLVMOrcTargetProcess.a  lib/libLLVMIntelJITProfiling.a  lib/libLLVMOrcShared.a  lib/libLLVMRuntimeDyld.a  lib/libLLVMMIRParser.a  lib/libLLVMWebAssemblyDesc.a  lib/libLLVMWebAssemblyInfo.a  lib/libLLVMPasses.a  lib/libLLVMIRPrinter.a  lib/libLLVMCoroutines.a  lib/libLLVMCFGuard.a  lib/libLLVMHipStdPar.a  lib/libLLVMAsmPrinter.a  lib/libLLVMGlobalISel.a  lib/libLLVMSelectionDAG.a  lib/libLLVMCodeGen.a  lib/libLLVMObjCARCOpts.a  lib/libLLVMipo.a  lib/libLLVMBitWriter.a  lib/libLLVMFrontendOpenMP.a  lib/libLLVMFrontendOffloading.a  lib/libLLVMInstrumentation.a  lib/libLLVMScalarOpts.a  lib/libLLVMAggressiveInstCombine.a  lib/libLLVMInstCombine.a  lib/libLLVMLinker.a  lib/libLLVMVectorize.a  lib/libLLVMTransformUtils.a  lib/libLLVMTarget.a  lib/libLLVMAnalysis.a  lib/libLLVMMCDisassembler.a  lib/libLLVMCodeGenTypes.a  lib/libLLVMMCA.a  lib/libLLVMRISCVDesc.a  lib/libLLVMRISCVInfo.a  lib/libLLVMProfileData.a  lib/libLLVMSymbolize.a  lib/libLLVMDebugInfoPDB.a  lib/libLLVMDebugInfoMSF.a  lib/libLLVMDebugInfoBTF.a  lib/libLLVMDebugInfoDWARF.a  lib/libLLVMOption.a  lib/libLLVMObject.a  lib/libLLVMIRReader.a  lib/libLLVMAsmParser.a  lib/libLLVMBitReader.a  lib/libLLVMCore.a  lib/libLLVMRemarks.a  lib/libLLVMBitstreamReader.a  lib/libLLVMMCParser.a  lib/libLLVMMC.a  lib/libLLVMDebugInfoCodeView.a  lib/libLLVMTextAPI.a  lib/libLLVMBinaryFormat.a  lib/libLLVMTargetParser.a  lib/libLLVMSupport.a  lib/libLLVMDemangle.a  -lrt  -ldl  -lm  /opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/usr/local/lib/libz.so && :
[21:03:48] ninja: job failed: : && /opt/bin/riscv64-linux-gnu-libgfortran5-cxx11/riscv64-linux-gnu-g++ --sysroot=/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/ -fPIC -fno-gnu-unique -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/workspace/build/./lib  -Wl,--gc-sections  -Wl,-Bsymbolic-functions -shared -Wl,-soname,libLLVM.so.19.1jl -o lib/libLLVM.so.19.1jl tools/llvm-shlib/CMakeFiles/LLVM.dir/libllvm.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/usr/local/lib:"  -Wl,--version-script,/workspace/build/./lib/tools/llvm-shlib/simple_version_script.map  -Wl,--whole-archive  lib/libLLVMDemangle.a  lib/libLLVMSupport.a  lib/libLLVMCore.a  lib/libLLVMFuzzerCLI.a  lib/libLLVMFuzzMutate.a  lib/libLLVMFileCheck.a  lib/libLLVMInterfaceStub.a  lib/libLLVMIRPrinter.a  lib/libLLVMIRReader.a  lib/libLLVMCodeGen.a  lib/libLLVMSelectionDAG.a  lib/libLLVMAsmPrinter.a  lib/libLLVMMIRParser.a  lib/libLLVMGlobalISel.a  lib/libLLVMCodeGenData.a  lib/libLLVMCodeGenTypes.a  lib/libLLVMBinaryFormat.a  lib/libLLVMBitReader.a  lib/libLLVMBitWriter.a  lib/libLLVMBitstreamReader.a  lib/libLLVMDWARFLinker.a  lib/libLLVMDWARFLinkerClassic.a  lib/libLLVMDWARFLinkerParallel.a  lib/libLLVMExtensions.a  lib/libLLVMFrontendDriver.a  lib/libLLVMFrontendHLSL.a  lib/libLLVMFrontendOpenACC.a  lib/libLLVMFrontendOpenMP.a  lib/libLLVMFrontendOffloading.a  lib/libLLVMTransformUtils.a  lib/libLLVMInstrumentation.a  lib/libLLVMAggressiveInstCombine.a  lib/libLLVMInstCombine.a  lib/libLLVMScalarOpts.a  lib/libLLVMipo.a  lib/libLLVMVectorize.a  lib/libLLVMObjCARCOpts.a  lib/libLLVMCoroutines.a  lib/libLLVMCFGuard.a  lib/libLLVMHipStdPar.a  lib/libLLVMLinker.a  lib/libLLVMAnalysis.a  lib/libLLVMLTO.a  lib/libLLVMMC.a  lib/libLLVMMCParser.a  lib/libLLVMMCDisassembler.a  lib/libLLVMMCA.a  lib/libLLVMObjCopy.a  lib/libLLVMObject.a  lib/libLLVMObjectYAML.a  lib/libLLVMOption.a  lib/libLLVMRemarks.a  lib/libLLVMDebugInfoDWARF.a  lib/libLLVMDebugInfoGSYM.a  lib/libLLVMDebugInfoLogicalView.a  lib/libLLVMDebugInfoMSF.a  lib/libLLVMDebugInfoCodeView.a  lib/libLLVMDebugInfoPDB.a  lib/libLLVMSymbolize.a  lib/libLLVMDebugInfoBTF.a  lib/libLLVMDWP.a  lib/libLLVMExecutionEngine.a  lib/libLLVMIntelJITProfiling.a  lib/libLLVMIntelJITEvents.a  lib/libLLVMInterpreter.a  lib/libLLVMJITLink.a  lib/libLLVMMCJIT.a  lib/libLLVMOrcJIT.a  lib/libLLVMOrcDebugging.a  lib/libLLVMOrcShared.a  lib/libLLVMOrcTargetProcess.a  lib/libLLVMRuntimeDyld.a  lib/libLLVMPerfJITEvents.a  lib/libLLVMTarget.a  lib/libLLVMAMDGPUCodeGen.a  lib/libLLVMAMDGPUAsmParser.a  lib/libLLVMAMDGPUDisassembler.a  lib/libLLVMAMDGPUTargetMCA.a  lib/libLLVMAMDGPUDesc.a  lib/libLLVMAMDGPUInfo.a  lib/libLLVMAMDGPUUtils.a  lib/libLLVMNVPTXCodeGen.a  lib/libLLVMNVPTXDesc.a  lib/libLLVMNVPTXInfo.a  lib/libLLVMWebAssemblyCodeGen.a  lib/libLLVMWebAssemblyAsmParser.a  lib/libLLVMWebAssemblyDisassembler.a  lib/libLLVMWebAssemblyDesc.a  lib/libLLVMWebAssemblyInfo.a  lib/libLLVMWebAssemblyUtils.a  lib/libLLVMBPFCodeGen.a  lib/libLLVMBPFAsmParser.a  lib/libLLVMBPFDisassembler.a  lib/libLLVMBPFDesc.a  lib/libLLVMBPFInfo.a  lib/libLLVMAVRCodeGen.a  lib/libLLVMAVRAsmParser.a  lib/libLLVMAVRDisassembler.a  lib/libLLVMAVRDesc.a  lib/libLLVMAVRInfo.a  lib/libLLVMRISCVCodeGen.a  lib/libLLVMRISCVAsmParser.a  lib/libLLVMRISCVDisassembler.a  lib/libLLVMRISCVDesc.a  lib/libLLVMRISCVTargetMCA.a  lib/libLLVMRISCVInfo.a  lib/libLLVMSandboxIR.a  lib/libLLVMAsmParser.a  lib/libLLVMLineEditor.a  lib/libLLVMProfileData.a  lib/libLLVMCoverage.a  lib/libLLVMPasses.a  lib/libLLVMTargetParser.a  lib/libLLVMTextAPI.a  lib/libLLVMTextAPIBinaryReader.a  lib/libLLVMDlltoolDriver.a  lib/libLLVMLibDriver.a  lib/libLLVMXRay.a  lib/libLLVMWindowsDriver.a  lib/libLLVMWindowsManifest.a  -Wl,--no-whole-archive  lib/libLLVMDWARFLinker.a  lib/libLLVMExtensions.a  lib/libLLVMOrcJIT.a  lib/libLLVMJITLink.a  lib/libLLVMWindowsDriver.a  lib/libLLVMExecutionEngine.a  lib/libLLVMOrcTargetProcess.a  lib/libLLVMIntelJITProfiling.a  lib/libLLVMOrcShared.a  lib/libLLVMRuntimeDyld.a  lib/libLLVMMIRParser.a  lib/libLLVMWebAssemblyDesc.a  lib/libLLVMWebAssemblyInfo.a  lib/libLLVMPasses.a  lib/libLLVMIRPrinter.a  lib/libLLVMCoroutines.a  lib/libLLVMCFGuard.a  lib/libLLVMHipStdPar.a  lib/libLLVMAsmPrinter.a  lib/libLLVMGlobalISel.a  lib/libLLVMSelectionDAG.a  lib/libLLVMCodeGen.a  lib/libLLVMObjCARCOpts.a  lib/libLLVMipo.a  lib/libLLVMBitWriter.a  lib/libLLVMFrontendOpenMP.a  lib/libLLVMFrontendOffloading.a  lib/libLLVMInstrumentation.a  lib/libLLVMScalarOpts.a  lib/libLLVMAggressiveInstCombine.a  lib/libLLVMInstCombine.a  lib/libLLVMLinker.a  lib/libLLVMVectorize.a  lib/libLLVMTransformUtils.a  lib/libLLVMTarget.a  lib/libLLVMAnalysis.a  lib/libLLVMMCDisassembler.a  lib/libLLVMCodeGenTypes.a  lib/libLLVMMCA.a  lib/libLLVMRISCVDesc.a  lib/libLLVMRISCVInfo.a  lib/libLLVMProfileData.a  lib/libLLVMSymbolize.a  lib/libLLVMDebugInfoPDB.a  lib/libLLVMDebugInfoMSF.a  lib/libLLVMDebugInfoBTF.a  lib/libLLVMDebugInfoDWARF.a  lib/libLLVMOption.a  lib/libLLVMObject.a  lib/libLLVMIRReader.a  lib/libLLVMAsmParser.a  lib/libLLVMBitReader.a  lib/libLLVMCore.a  lib/libLLVMRemarks.a  lib/libLLVMBitstreamReader.a  lib/libLLVMMCParser.a  lib/libLLVMMC.a  lib/libLLVMDebugInfoCodeView.a  lib/libLLVMTextAPI.a  lib/libLLVMBinaryFormat.a  lib/libLLVMTargetParser.a  lib/libLLVMSupport.a  lib/libLLVMDemangle.a  -lrt  -ldl  -lm  /opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/usr/local/lib/libz.so && :
[21:03:48] /opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/13.2.0/../../../../riscv64-linux-gnu/bin/ld: lib/libLLVMIntelJITProfiling.a(ittnotify_static.c.o): in function `.L0 ':
[21:03:48] ittnotify_static.c:(.text.__itt_domain_create_init_3_0+0x23a): undefined reference to `__TBB_machine_fetchadd4'
[21:03:48] /opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/13.2.0/../../../../riscv64-linux-gnu/bin/ld: ittnotify_static.c:(.text.__itt_string_handle_create_init_3_0+0x234): undefined reference to `__TBB_machine_fetchadd4'
[21:03:48] /opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/13.2.0/../../../../riscv64-linux-gnu/bin/ld: ittnotify_static.c:(.text.__itt_counter_create_init_3_0+0x292): undefined reference to `__TBB_machine_fetchadd4'
[21:03:48] /opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/13.2.0/../../../../riscv64-linux-gnu/bin/ld: ittnotify_static.c:(.text.__itt_counter_create_typed_init_3_0+0x29e): undefined reference to `__TBB_machine_fetchadd4'
[21:03:48] /opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/13.2.0/../../../../riscv64-linux-gnu/bin/ld: lib/libLLVMIntelJITProfiling.a(ittnotify_static.c.o): in function `.L2109':
[21:03:48] ittnotify_static.c:(.text.__itt_fini_ittlib+0x196): undefined reference to `__TBB_machine_fetchadd4'
[21:03:48] /opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/13.2.0/../../../../riscv64-linux-gnu/bin/ld: lib/libLLVMIntelJITProfiling.a(ittnotify_static.c.o):ittnotify_static.c:(.text.__itt_init_ittlib+0x2ac): more undefined references to `__TBB_machine_fetchadd4' follow
[21:03:48] collect2: error: ld returned 1 exit status
[21:03:48] ninja: subcommand failed

Maybe another thing which requires GCC 14? I was able to compile LLVM on riscv64 with GCC 14.2 (it just took half a day 🥲)

@imciner2
Copy link
Member

imciner2 commented Jan 5, 2025

__TBB_machine_fetchadd4 sounds like it is coming from TBB, so is there a dependency on it that isn't declared somewhere? Because we don't have a RISCV build for it yet (that is going to be part of the larger update in #10082, but I haven't gotten around to sorting out the errors yet).

@imciner2
Copy link
Member

imciner2 commented Jan 5, 2025

I haven't looked closely here yet uxlfoundation/oneTBB#186, but it sounds like there might be some arch-specific code paths in the ITT library there that might need fixing up.

@Zentrik
Copy link
Contributor Author

Zentrik commented Jan 5, 2025

@giordano
Copy link
Member

giordano commented Jan 5, 2025

But...why are we compiling this code path for riscv? 😕 For the record, my Make.user is

# -*- makefile -*-

override USECCACHE = 1
MARCH := rv64gcv
CFLAGS := -mabi=lp64d
CXXFLAGS := $(CFLAGS)
FFLAGS := $(CFLAGS)

USE_INTEL_JITEVENTS = 0

USE_BINARYBUILDER:=0

DEPS_GIT = llvm
override LLVM_VER=19.1.1
override LLVM_BRANCH=julia-release/19.x
override LLVM_SHA1=julia-release/19.x

and USE_INTEL_JITEVENTS is used at https://github.com/JuliaLang/julia/blob/89afe2026671dee633747a7eeeb4db721395835b/deps/llvm.mk#L123-L125. I guess we should restrict

Yggdrasil/L/LLVM/common.jl

Lines 251 to 253 in e3d93c0

if [[ ${target} == *linux* ]]; then # TODO only LLVM12
CMAKE_FLAGS+=(-DLLVM_USE_INTEL_JITEVENTS=1)
fi
to Intel architectures?

@giordano
Copy link
Member

giordano commented Jan 5, 2025

Based on https://www.intel.com/content/www/us/en/developer/articles/system-requirements/vtune-profiler-system-requirements.html VTune is compatible only with x86_64, not even 32-bit systems (unless I'm missing something). Edit: I opened JuliaLang/julia#56964 to disable LLVM_USE_INTEL_JITEVENTS on non-x86_64 architectures.

giordano added a commit to JuliaLang/julia that referenced this pull request Jan 6, 2025
Currently we are enabling it for all Linux systems, but [Intel VTune
supports only
x86_64](https://www.intel.com/content/www/us/en/developer/articles/system-requirements/vtune-profiler-system-requirements.html)
and building LLVM with ITTAPI support is problematic on some platforms
(e.g. riscv64, ref:
JuliaPackaging/Yggdrasil#10204).
@giordano
Copy link
Member

giordano commented Jan 6, 2025

Progress: lib/libLLVM.so.19.1jl is now linked correctly, but we've got a different linking error, this time while building bin/clang-fuzzer-dictionary:

[16:03:09] [7199/7958] : && /opt/bin/riscv64-linux-gnu-libgfortran5-cxx11/riscv64-linux-gnu-gcc --sysroot=/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/ -fPIC -fno-semantic-interposition -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-rpath-link,/workspace/build/./lib  -Wl,--gc-sections tools/clang/tools/clang-fuzzer/dictionary/CMakeFiles/clang-fuzzer-dictionary.dir/dictionary.c.o -o bin/clang-fuzzer-dictionary  -Wl,-rpath,"\$ORIGIN/../lib:/workspace/build/lib"  lib/libLLVM.so.19.1jl && :
[...]
[16:03:10] ninja: job failed: : && /opt/bin/riscv64-linux-gnu-libgfortran5-cxx11/riscv64-linux-gnu-gcc --sysroot=/opt/riscv64-linux-gnu/riscv64-linux-gnu/sys-root/ -fPIC -fno-semantic-interposition -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-rpath-link,/workspace/build/./lib  -Wl,--gc-sections tools/clang/tools/clang-fuzzer/dictionary/CMakeFiles/clang-fuzzer-dictionary.dir/dictionary.c.o -o bin/clang-fuzzer-dictionary  -Wl,-rpath,"\$ORIGIN/../lib:/workspace/build/lib"  lib/libLLVM.so.19.1jl && :
[16:03:10] /opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/13.2.0/../../../../riscv64-linux-gnu/bin/ld: warning: libstdc++.so.6, needed by lib/libLLVM.so.19.1jl, not found (try using -rpath or -rpath-link)
[16:03:10] /opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/13.2.0/../../../../riscv64-linux-gnu/bin/ld: lib/libLLVM.so.19.1jl: undefined reference to `std::ctype<char>::_M_widen_init() const@GLIBCXX_3.4.11'
[16:03:10] /opt/riscv64-linux-gnu/bin/../lib/gcc/riscv64-linux-gnu/13.2.0/../../../../riscv64-linux-gnu/bin/ld: lib/libLLVM.so.19.1jl: undefined reference to `operator new(unsigned long)@GLIBCXX_3.4'

I guess the issue is that gcc is being used instead of g++, but don't know why. Feels like an issue with the build system though.

@giordano
Copy link
Member

giordano commented Jan 6, 2025

Couple of observations:

@giordano
Copy link
Member

giordano commented Jan 6, 2025

Mumble mumble mumble, I bet the problem is https://github.com/JuliaPackaging/BinaryBuilderBase.jl/blob/4d0883a222bcb60871f8e24e56ef6e322502ec80/src/Runner.jl#L553-L559 + #10132 (comment): our compiler wrappers expect compiler libraries in the lib64 directory for 64-bit platforms, but because of a typo they ended up in lib for riscv64. We can work around this issue in BBB for the time being.

@giordano
Copy link
Member

giordano commented Jan 7, 2025

It's working!

@Zentrik
Copy link
Contributor Author

Zentrik commented Jan 7, 2025

Thanks for debugging and getting this working.

@giordano giordano enabled auto-merge (squash) January 7, 2025 08:04
@giordano giordano merged commit b15cf34 into JuliaPackaging:master Jan 7, 2025
33 checks passed
@vchuravy
Copy link
Member

vchuravy commented Jan 7, 2025

Congratulations!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants